public SideEffectAnalysis(PointsToAnalysis pa, CallGraph cg) { this(); this.pa = pa; this.cg = cg; this.tt = new TransitiveTargets(cg); }
public Iterator<MethodOrMethodContext> iterator(Iterator<? extends MethodOrMethodContext> methods) { Set<MethodOrMethodContext> s = new HashSet<MethodOrMethodContext>(); ArrayList<MethodOrMethodContext> worklist = new ArrayList<MethodOrMethodContext>(); while (methods.hasNext()) { MethodOrMethodContext method = methods.next(); if (s.add(method)) { worklist.add(method); } } return iterator(s, worklist); }
TransitiveTargets tt = new TransitiveTargets(cg); statement: for (Iterator sIt = body.getUnits().iterator(); sIt.hasNext();) { final Stmt s = (Stmt) sIt.next(); HashSet read = new HashSet(); HashSet write = new HashSet(); Iterator<MethodOrMethodContext> it = tt.iterator(s); while (it.hasNext()) { SootMethod target = (SootMethod) it.next();
TransitiveTargets runMethodTargets = new TransitiveTargets(callGraph, new Filter(new RunMethodsPred())); Iterator<MethodOrMethodContext> mayRunIt = runMethodTargets.iterator(start); // fails for some call graphs while (mayRunIt.hasNext()) { SootMethod runMethod = (SootMethod) mayRunIt.next();
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 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); }
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()); }
this.cg = cg; this.tve = new CriticalSectionVisibleEdgesPred(criticalSections); this.tt = new TransitiveTargets(cg, new Filter(tve)); this.normaltt = new TransitiveTargets(cg, null); this.normalsea = new SideEffectAnalysis(pa, cg); this.criticalSections = criticalSections;
tn1.transitiveTargets = new HashSet<MethodOrMethodContext>(); for (Unit tn1Invoke : tn1.invokes) { Iterator<MethodOrMethodContext> targetIt = tt.iterator(tn1Invoke); while (targetIt.hasNext()) { tn1.transitiveTargets.add(targetIt.next());
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))); }
tn1.transitiveTargets = new HashSet<MethodOrMethodContext>(); for (Unit tn1Invoke : tn1.invokes) { Iterator<MethodOrMethodContext> targetIt = tt.iterator(tn1Invoke); while (targetIt.hasNext()) { tn1.transitiveTargets.add(targetIt.next());
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.pa = pa; this.cg = cg; this.tt = new TransitiveTargets( cg, filter ); }
public RWSet writeSet(SootMethod method, Stmt stmt) { RWSet ret = null; Iterator<MethodOrMethodContext> targets = tt.iterator(stmt); while (targets.hasNext()) { SootMethod target = (SootMethod) targets.next(); if (target.isNative()) { if (ret == null) { ret = new SiteRWSet(); } ret.setCallsNative(); } else if (target.isConcrete()) { RWSet ntw = nonTransitiveWriteSet(target); if (ntw != null) { if (ret == null) { ret = new SiteRWSet(); } ret.union(ntw); } } } if (ret == null) { return ntWriteSet(method, stmt); } ret.union(ntWriteSet(method, stmt)); return ret; }
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.pa = pa; this.cg = cg; this.tt = new TransitiveTargets( cg, filter ); }
public RWSet readSet(SootMethod method, Stmt stmt) { RWSet ret = null; Iterator<MethodOrMethodContext> targets = tt.iterator(stmt); while (targets.hasNext()) { SootMethod target = (SootMethod) targets.next(); if (target.isNative()) { if (ret == null) { ret = new SiteRWSet(); } ret.setCallsNative(); } else if (target.isConcrete()) { RWSet ntr = nonTransitiveReadSet(target); if (ntr != null) { if (ret == null) { ret = new SiteRWSet(); } ret.union(ntr); } } } if (ret == null) { return ntReadSet(method, stmt); } ret.union(ntReadSet(method, stmt)); return ret; }
public SideEffectAnalysis( PointsToAnalysis pa, CallGraph cg ) { this.pa = pa; this.cg = cg; this.tt = new TransitiveTargets( cg ); }
RWSet ret = new CodeBlockRWSet(); tve.setExemptTransaction(tn); Iterator<MethodOrMethodContext> targets = tt.iterator(stmt); while (!ignore && targets.hasNext()) { SootMethod target = (SootMethod) targets.next();
public SideEffectAnalysis( PointsToAnalysis pa, CallGraph cg ) { this.pa = pa; this.cg = cg; this.tt = new TransitiveTargets( cg ); }
RWSet ret = new CodeBlockRWSet(); tve.setExemptTransaction(tn); Iterator<MethodOrMethodContext> targets = tt.iterator(stmt); while (!ignore && targets.hasNext()) { SootMethod target = (SootMethod) targets.next();
public Iterator<MethodOrMethodContext> iterator( Iterator<MethodOrMethodContext> methods ) { Set<MethodOrMethodContext> s = new HashSet<MethodOrMethodContext>(); ArrayList<MethodOrMethodContext> worklist = new ArrayList<MethodOrMethodContext>(); while( methods.hasNext() ) { MethodOrMethodContext method = methods.next(); if( s.add( method ) ) worklist.add( method ); } return iterator( s, worklist ); } private Iterator<MethodOrMethodContext> iterator( Set<MethodOrMethodContext> s, ArrayList<MethodOrMethodContext> worklist ) {