public soot.jimple.toolkits.callgraph.CHATransformer soot_jimple_toolkits_callgraph_CHATransformer() { if (instance_soot_jimple_toolkits_callgraph_CHATransformer == null) { synchronized (this) { if (instance_soot_jimple_toolkits_callgraph_CHATransformer == null) instance_soot_jimple_toolkits_callgraph_CHATransformer = new soot.jimple.toolkits.callgraph.CHATransformer(g); } } return instance_soot_jimple_toolkits_callgraph_CHATransformer; } protected void release_soot_jimple_toolkits_callgraph_CHATransformer() {
private void processNewMethodContext(MethodOrMethodContext momc) { SootMethod m = momc.method(); Iterator<Edge> it = cicg.edgesOutOf(m); while (it.hasNext()) { Edge e = it.next(); cm.addStaticEdge(momc, e.srcUnit(), e.tgt(), e.kind()); } }
public Iterator<MethodOrMethodContext> iterator(MethodOrMethodContext momc) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator<Edge> it = cg.edgesOutOf(momc); if (filter != null) { it = filter.wrap(it); } while (it.hasNext()) { Edge e = (Edge) it.next(); methods.add(e.getTgt()); } return iterator(methods.iterator()); }
public OnFlyCallGraph(PAG pag, boolean appOnly) { this.pag = pag; callGraph = Scene.v().internalMakeCallGraph(); Scene.v().setCallGraph(callGraph); ContextManager cm = CallGraphBuilder.makeContextManager(callGraph); reachableMethods = Scene.v().getReachableMethods(); ofcgb = new OnFlyCallGraphBuilder(cm, reachableMethods, appOnly); reachablesReader = reachableMethods.listener(); callEdges = cm.callGraph().listener(); }
public ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints, Filter filter) { this.filter = filter; this.cg = graph; addMethods(entryPoints); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if (filter != null) { this.edgeSource = filter.wrap(this.edgeSource); } }
private void resolveStaticTypes(Set<Type> s, InvokeCallSite ics) { ArrayTypes at = ics.reachingTypes(); for (Type bType : resolveToClasses(s)) { SootClass baseClass = ((RefType) bType).getSootClass(); Iterator<SootMethod> mIt = getPublicMethodIterator(baseClass, at); while (mIt.hasNext()) { SootMethod sm = mIt.next(); cm.addVirtualEdge(ics.container(), ics.stmt(), sm, Kind.REFL_INVOKE, null); } } }
/** * This constructor builds a complete call graph using the given PointsToAnalysis to resolve virtual calls. */ public CallGraphBuilder(PointsToAnalysis pa) { this.pa = pa; cg = Scene.v().internalMakeCallGraph(); Scene.v().setCallGraph(cg); reachables = Scene.v().getReachableMethods(); ContextManager cm = makeContextManager(cg); ofcgb = new OnFlyCallGraphBuilder(cm, reachables); }
/** Returns true iff the edge e is wanted. */ public boolean want(Edge e) { return e.isExplicit(); } }
public SideEffectAnalysis(PointsToAnalysis pa, CallGraph cg) { this(); this.pa = pa; this.cg = cg; this.tt = new TransitiveTargets(cg); }
public Edge next() { Edge ret = position; position = position.nextByTgt(); return ret; }
public Edge next() { Edge ret = position; position = position.nextByUnit(); return ret; }
public ClinitElimAnalysis(UnitGraph g) { super(g); this.g = g; doAnalysis(); }
@Override public SootMethod next() { SootMethod toRet = next; findNextMethod(); return toRet; }
public Iterator<MethodOrMethodContext> iterator(Unit u) { ArrayList<MethodOrMethodContext> methods = new ArrayList<MethodOrMethodContext>(); Iterator<Edge> it = cg.edgesOutOf(u); if (filter != null) { it = filter.wrap(it); } while (it.hasNext()) { Edge e = (Edge) it.next(); methods.add(e.getTgt()); } return iterator(methods.iterator()); }
public SideEffectAnalysis(PointsToAnalysis pa, CallGraph cg, Filter filter) { // This constructor allows customization of call graph edges to // consider via the use of a transitive targets filter. // For example, using the NonClinitEdgesPred, you can create a // SideEffectAnalysis that will ignore static initializers // - R. Halpert 2006-12-02 this(); this.pa = pa; this.cg = cg; this.tt = new TransitiveTargets(cg, filter); }