@Override protected ExplicitCallGraph createEmptyCallGraph(IMethod fakeRootClass, AnalysisOptions options) { return new CrossLanguageCallGraph(makeRootNodeSelector(), fakeRootClass, options, getAnalysisCache()); }
@Override protected CGNode makeFakeRootNode() throws CancelException { return findOrCreateNode(new CrossLanguageFakeRoot(cha, options, getAnalysisCache()), Everywhere.EVERYWHERE); } }
@Override public SSANewInstruction addAllocation(TypeReference type) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addAllocation(type); }
@SuppressWarnings("deprecation") public AbstractRootMethod getLanguageRoot(Atom language){ if (!languageRoots.containsKey(language)) { AbstractRootMethod languageRoot = roots.get(language, this); CGNode languageRootNode = null; try { languageRootNode = findOrCreateNode(languageRoot, Everywhere.EVERYWHERE); } catch (CancelException e) { e.printStackTrace(); Assertions.UNREACHABLE(); } languageRootNodes.add(languageRootNode); CallSiteReference site = CallSiteReference.make(1, languageRoot.getReference(), IInvokeInstruction.Dispatch.STATIC); CGNode fakeRootNode = getFakeRootNode(); CrossLanguageFakeRoot fakeRootMethod = (CrossLanguageFakeRoot) fakeRootNode.getMethod(); site = fakeRootMethod.addInvocationInternal(new int[0], site).getCallSite(); fakeRootNode.addTarget(site, languageRootNode); languageRoots.put(language, languageRoot); } return (AbstractRootMethod) languageRoots.get(language); }
@Override public SSANewInstruction addAllocation(TypeReference type) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addAllocation(type); }
@SuppressWarnings("deprecation") public AbstractRootMethod getLanguageRoot(Atom language){ if (!languageRoots.containsKey(language)) { AbstractRootMethod languageRoot = roots.get(language, this); CGNode languageRootNode = null; try { languageRootNode = findOrCreateNode(languageRoot, Everywhere.EVERYWHERE); } catch (CancelException e) { e.printStackTrace(); Assertions.UNREACHABLE(); } languageRootNodes.add(languageRootNode); CallSiteReference site = CallSiteReference.make(1, languageRoot.getReference(), IInvokeInstruction.Dispatch.STATIC); CGNode fakeRootNode = getFakeRootNode(); CrossLanguageFakeRoot fakeRootMethod = (CrossLanguageFakeRoot) fakeRootNode.getMethod(); site = fakeRootMethod.addInvocationInternal(new int[0], site).getCallSite(); fakeRootNode.addTarget(site, languageRootNode); languageRoots.put(language, languageRoot); } return (AbstractRootMethod) languageRoots.get(language); }
@Override public int addCheckcast(TypeReference[] type, int rv, boolean isPEI) { Atom language = type[0].getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addCheckcast(type, rv, isPEI); }
@Override protected CGNode makeFakeRootNode() throws CancelException { return findOrCreateNode(new CrossLanguageFakeRoot(cha, options, getAnalysisCache()), Everywhere.EVERYWHERE); } }
@Override protected ExplicitCallGraph createEmptyCallGraph(IMethod fakeRootClass, AnalysisOptions options) { return new CrossLanguageCallGraph(makeRootNodeSelector(), fakeRootClass, options, getAnalysisCache()); }
public int addPhi(TypeReference type, int[] values) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addPhi(values); }
@Override public AstLexicalRead addGlobalRead(TypeReference type, String name) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return ((AstFakeRoot) root).addGlobalRead(type, name); }
public int addPhi(TypeReference type, int[] values) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addPhi(values); }
@Override public int addCheckcast(TypeReference[] type, int rv, boolean isPEI) { Atom language = type[0].getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addCheckcast(type, rv, isPEI); }
@Override public AstLexicalRead addGlobalRead(TypeReference type, String name) { Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return ((AstFakeRoot) root).addGlobalRead(type, name); }
@Override public int addGetInstance(FieldReference ref, int object) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetInstance(ref, object); }
@Override public int addGetStatic(FieldReference ref) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetStatic(ref); }
@Override public int addGetStatic(FieldReference ref) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetStatic(ref); }
@Override public int addGetInstance(FieldReference ref, int object) { TypeReference type = ref.getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addGetInstance(ref, object); }
@Override public SSAAbstractInvokeInstruction addInvocation(int[] params, CallSiteReference site) { TypeReference type = site.getDeclaredTarget().getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return root.addInvocation(params, site); }
@Override public SSAAbstractInvokeInstruction addDirectCall(int functionVn, int[] argVns, CallSiteReference callSite) { TypeReference type = callSite.getDeclaredTarget().getDeclaringClass(); Atom language = type.getClassLoader().getLanguage(); AbstractRootMethod root = getLanguageRoot(language); return ((ScriptFakeRoot) root).addDirectCall(functionVn, argVns, callSite); } }