public CriticalSectionInterferenceGraph(List<CriticalSection> criticalSections, MhpTester mhp, boolean optionOneGlobalLock, boolean optionLeaveOriginalLocks, boolean optionIncludeEmptyPossibleEdges) { this.criticalSections = criticalSections; this.mhp = mhp; this.pta = Scene.v().getPointsToAnalysis(); this.optionOneGlobalLock = optionOneGlobalLock; this.optionLeaveOriginalLocks = optionLeaveOriginalLocks; this.optionIncludeEmptyPossibleEdges = optionIncludeEmptyPossibleEdges; calculateGroups(); }
@Override public void injectPts() { final GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis(); pt_objs = new HashMap<AllocNode, PtInsIntervalManager>(); me.getP2Set().forall(new P2SetVisitor() { @Override public void visit(Node n) { if (geomPTA.isValidGeometricNode(n)) { pt_objs.put((AllocNode) n, (PtInsIntervalManager) stubManager); } } }); new_pts = null; }
@Override public void injectPts() { final GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis(); pt_objs = new HashMap<AllocNode, HeapInsIntervalManager>(); me.getP2Set().forall(new P2SetVisitor() { @Override public void visit(Node n) { if (geomPTA.isValidGeometricNode(n)) { pt_objs.put((AllocNode) n, (HeapInsIntervalManager) stubManager); } } }); new_pts = null; }
/** * {@inheritDoc} */ public boolean mayNotAlias(InstanceKey otherKey) { if (owner.equals(otherKey.owner) && stmtAfterAssignStmt != null && otherKey.stmtAfterAssignStmt != null) { if (lnma.notMayAlias(assignedLocal, stmtAfterAssignStmt, otherKey.assignedLocal, otherKey.stmtAfterAssignStmt)) { return true; } } // different methods or local not-may-alias was not successful: get points-to info PointsToAnalysis pta = Scene.v().getPointsToAnalysis(); if (pta == null) { return false; // no info; hence don't know for sure } // may not alias if we have an empty intersection return !pts.hasNonEmptyIntersection(otherKey.pts); }
public static DemandCSPointsTo makeWithBudget(int maxTraversal, int maxPasses, boolean lazy) { PAG pag = (PAG) Scene.v().getPointsToAnalysis(); ContextSensitiveInfo csInfo = new ContextSensitiveInfo(pag); return new DemandCSPointsTo(csInfo, pag, maxTraversal, maxPasses, lazy); }
/** * We transfer the SPARK results to current pointer if this pointer is not involved in the geometric analysis. Note that, * the unreachable objects will not be inserted. */ @Override public void injectPts() { final GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis(); pt_objs = new HashMap<AllocNode, GeometricManager>(); me.getP2Set().forall(new P2SetVisitor() { @Override public void visit(Node n) { if (geomPTA.isValidGeometricNode(n)) { pt_objs.put((AllocNode) n, (GeometricManager) stubManager); } } }); new_pts = null; }
public boolean addFieldRef(PointsToSet otherBase, Object field) { boolean ret = false; if (fields == null) { fields = new HashMap(); } // Get our points-to set, merge with other PointsToSet base = getBaseForField(field); if (base instanceof FullObjectSet) { return false; } if (otherBase instanceof FullObjectSet) { fields.put(field, otherBase); return true; } if (otherBase.equals(base)) { return false; } if (base == null) { // NOTE: this line makes unsafe assumptions about the PTA PointsToSetInternal newpti = new HashPointsToSet(((PointsToSetInternal) otherBase).getType(), (PAG) Scene.v().getPointsToAnalysis()); base = newpti; fields.put(field, base); } ret = ((PointsToSetInternal) base).addAll((PointsToSetInternal) otherBase, null) | ret; return ret; } }
protected void internalTransform(Body b, String phaseName, Map options) { PointsToAnalysis pa = Scene.v().getPointsToAnalysis(); Set<IdentityStmt> parms = new HashSet<IdentityStmt>(); for (Iterator sIt = b.getUnits().iterator(); sIt.hasNext();) { final Stmt s = (Stmt) sIt.next(); if (!(s instanceof IdentityStmt)) { continue; } IdentityStmt is = (IdentityStmt) s; ValueBox vb = is.getRightOpBox(); if (!(vb.getValue() instanceof ParameterRef)) { continue; } ParameterRef pr = (ParameterRef) vb.getValue(); if (!(pr.getType() instanceof RefLikeType)) { continue; } parms.add(is); } int colour = 0; while (!parms.isEmpty()) { fill(parms, parms.iterator().next(), colour++, pa); } }
/** * Retrieves the active side-effect analysis */ public SideEffectAnalysis getSideEffectAnalysis() { if (!hasSideEffectAnalysis()) { setSideEffectAnalysis(new SideEffectAnalysis(getPointsToAnalysis(), getCallGraph())); } return activeSideEffectAnalysis; }
final PointsToSetInternal pti1 = (PointsToSetInternal) pts1; final PointsToSetInternal pti2 = (PointsToSetInternal) pts2; final PointsToSetInternal newpti = new HashPointsToSet(pti1.getType(), (PAG) Scene.v().getPointsToAnalysis());
/** * Creates a new instance key representing the value stored in local, just before stmt. The identity of the key is defined * via lmaa, and its must-not-alias relationship to other keys via lmna. * * @param local * the local variable whose value this key represents * @param stmt * the statement at which this key represents the value * @param owner * the method containing local * @param lmaa * a {@link LocalMustAliasAnalysis} * @param lmna * a {@link LocalMustNotAliasAnalysis} */ public InstanceKey(Local local, Stmt stmt, SootMethod owner, LocalMustAliasAnalysis lmaa, LocalMustNotAliasAnalysis lmna) { this.assignedLocal = local; this.owner = owner; this.stmtAfterAssignStmt = stmt; this.lmaa = lmaa; this.lnma = lmna; PointsToAnalysis pta = Scene.v().getPointsToAnalysis(); this.pts = new PointsToSetEqualsWrapper((EqualsSupportingPointsToSet) pta.reachingObjects(local)); this.hashCode = computeHashCode(); }
GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
lockToLockNum.put(dae, daeNum); PointsToSetInternal dummyLockPT = new HashPointsToSet(lock1.getType(), (PAG) Scene.v().getPointsToAnalysis()); lockPTSets.add(dummyLockPT);
GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
public void run() { SootMethod mainMethod = Scene.v().getMainClass().getMethodByName("main"); PointsToAnalysis pta = Scene.v().getPointsToAnalysis(); if (pta instanceof DemandCSPointsTo) { DemandCSPointsTo demandCSPointsTo = (DemandCSPointsTo) pta;
if (optionDoMHP && Scene.v().getPointsToAnalysis() instanceof PAG) { logger.debug("[wjtp.tn] *** Build May-Happen-in-Parallel Info *** " + (new Date())); mhp = new SynchObliviousMhpAnalysis(); PointsToAnalysis pta = Scene.v().getPointsToAnalysis(); CriticalSectionAwareSideEffectAnalysis tasea = null; tasea = new CriticalSectionAwareSideEffectAnalysis(pta, Scene.v().getCallGraph(),
tasea = new CriticalSectionAwareSideEffectAnalysis(Scene.v().getPointsToAnalysis(), Scene.v().getCallGraph(), null, tlo);
/** Retrieves the active side-effect analysis */ public SideEffectAnalysis getSideEffectAnalysis() { if(!hasSideEffectAnalysis()) { setSideEffectAnalysis( new SideEffectAnalysis( getPointsToAnalysis(), getCallGraph() ) ); } return activeSideEffectAnalysis; }
/** Retrieves the active side-effect analysis */ public SideEffectAnalysis getSideEffectAnalysis() { if(!hasSideEffectAnalysis()) { setSideEffectAnalysis( new SideEffectAnalysis( getPointsToAnalysis(), getCallGraph() ) ); } return activeSideEffectAnalysis; }