public static int countCallEdgesForCallsite(Stmt callsite, boolean stopForMutiple) { CallGraph cg = Scene.v().getCallGraph(); int count = 0; for (Iterator<Edge> it = cg.edgesOutOf(callsite); it.hasNext();) { it.next(); ++count; if (stopForMutiple && count > 1) { break; } } return count; }
public LocalObjectsAnalysis(InfoFlowAnalysis dfa) { this.dfa = dfa; this.uf = new UseFinder(); this.cg = Scene.v().getCallGraph(); classToClassLocalObjectsAnalysis = new HashMap<SootClass, ClassLocalObjectsAnalysis>(); mloaCache = new HashMap<SootMethod, SmartMethodLocalObjectsAnalysis>(); }
protected void initializationStuff(String phaseName) { G.v().Union_factory = new UnionFactory() { // ReallyCheapRasUnion ru = new ReallyCheapRasUnion(); // public Union newUnion() { return new RasUnion(); } public Union newUnion() { return new MemoryEfficientRasUnion(); } }; if (startTime == null) { startTime = new Date(); } cg = Scene.v().getCallGraph(); }
public ReachableMethods getReachableMethods() { if (reachableMethods == null) { reachableMethods = new ReachableMethods(getCallGraph(), new ArrayList<MethodOrMethodContext>(getEntryPoints())); } reachableMethods.update(); return reachableMethods; }
public JimpleBasedInterproceduralCFG(boolean enableExceptions, boolean includeReflectiveCalls) { super(enableExceptions); this.includeReflectiveCalls = includeReflectiveCalls; cg = Scene.v().getCallGraph(); initializeUnitToOwner(); }
protected void initializationStuff(String phaseName) { if (G.v().Union_factory == null) { G.v().Union_factory = new UnionFactory() { public Union newUnion() { return FullObjectSet.v(); } }; } if (startTime == null) { startTime = new Date(); } cg = Scene.v().getCallGraph(); }
@Override protected void internalTransform(String phaseName, Map<String, String> options) { PurityOptions opts = new PurityOptions(options); logger.debug("[AM] Analysing purity"); CallGraph cg = Scene.v().getCallGraph(); // launch the analysis new PurityInterproceduralAnalysis(cg, Scene.v().getEntryPoints().iterator(), opts); } }
private void byMCalledS0(PegCallGraph pcg) { Iterator it = pcg.iterator(); while (it.hasNext()) { SootMethod sm = (SootMethod) it.next(); UnitGraph graph = new CompleteUnitGraph(sm.getActiveBody()); CallGraph callGraph = Scene.v().getCallGraph(); MultiRunStatementsFinder finder = new MultiRunStatementsFinder(graph, sm, multiCalledMethods, callGraph); FlowSet fs = finder.getMultiRunStatements(); } }
protected void flowThrough(Object inVal, Object stmt, Object outVal) { FlowSet in = (FlowSet) inVal; FlowSet out = (FlowSet) outVal; Stmt s = (Stmt) stmt; in.copy(out); CallGraph cg = Scene.v().getCallGraph(); Iterator edges = cg.edgesOutOf(s); while (edges.hasNext()) { Edge e = (Edge) edges.next(); if (e.isClinit()) { out.add(e.tgt()); } } }
/** * Retrieves the active side-effect analysis */ public SideEffectAnalysis getSideEffectAnalysis() { if (!hasSideEffectAnalysis()) { setSideEffectAnalysis(new SideEffectAnalysis(getPointsToAnalysis(), getCallGraph())); } return activeSideEffectAnalysis; }
protected Object newInitialFlow() { ArraySparseSet set = new ArraySparseSet(); CallGraph cg = Scene.v().getCallGraph(); Iterator mIt = cg.edgesOutOf(g.getBody().getMethod()); while (mIt.hasNext()) { Edge edge = (Edge) mIt.next(); if (edge.isClinit()) { set.add(edge.tgt()); } } return set; } }
CallGraph cg = Scene.v().getCallGraph(); TransitiveTargets tt = new TransitiveTargets(cg); statement: for (Iterator sIt = body.getUnits().iterator(); sIt.hasNext();) {
protected void internalTransform(String phaseName, Map options) { CGGOptions opts = new CGGOptions(options); if (opts.show_lib_meths()) { setShowLibMeths(true); } cg = Scene.v().getCallGraph(); if (Options.v().interactive_mode()) { reset(); } }
public DeadlockDetector(boolean optionPrintDebug, boolean optionRepairDeadlock, boolean optionAllowSelfEdges, List<CriticalSection> criticalSections) { this.optionPrintDebug = optionPrintDebug; this.optionRepairDeadlock = optionRepairDeadlock; this.optionAllowSelfEdges = optionAllowSelfEdges && !optionRepairDeadlock; // can only do this if not repairing this.criticalSections = criticalSections; this.tt = new TransitiveTargets(Scene.v().getCallGraph(), new Filter(new CriticalSectionVisibleEdgesPred(null))); }
CallGraph cg = Scene.v().getCallGraph(); ReachableMethods reachableMethods = new ReachableMethods(cg, Collections.<MethodOrMethodContext>singletonList(container));
protected void internalTransform(Body b, String phaseName, Map options) { CallGraph cg = Scene.v().getCallGraph(); if (methodToContexts == null) { methodToContexts = new MethodToContexts(Scene.v().getReachableMethods().listener());
protected void internalTransform(Body b, String phaseName, Map options) { ClinitElimAnalysis a = new ClinitElimAnalysis(new BriefUnitGraph(b)); CallGraph cg = Scene.v().getCallGraph(); SootMethod m = b.getMethod(); Iterator edgeIt = cg.edgesOutOf(m); while (edgeIt.hasNext()) { Edge e = (Edge) edgeIt.next(); if (e.srcStmt() == null) { continue; } if (!e.isClinit()) { continue; } FlowSet methods = (FlowSet) a.getFlowBefore(e.srcStmt()); if (methods.contains(e.tgt())) { cg.removeEdge(e); } } } }
tasea = new CriticalSectionAwareSideEffectAnalysis(Scene.v().getPointsToAnalysis(), Scene.v().getCallGraph(), null, tlo);
private void analyzeMethod(SootMethod sm) { CallGraph cg = Scene.v().getCallGraph();
CallGraph cg = Scene.v().getCallGraph(); for (Iterator<Edge> edges = cg.edgesOutOf(is); edges.hasNext();) { Edge e = edges.next();