use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class PropIter method handleStores.
protected final boolean handleStores(VarNode src) {
boolean ret = false;
final PointsToSetInternal srcSet = src.getP2Set();
if (srcSet.isEmpty())
return false;
Node[] storeTargets = pag.storeLookup(src);
for (Node element : storeTargets) {
final FieldRefNode fr = (FieldRefNode) element;
final SparkField f = fr.getField();
ret = fr.getBase().getP2Set().forall(new P2SetVisitor() {
public final void visit(Node n) {
AllocDotField nDotF = pag.makeAllocDotField((AllocNode) n, f);
if (nDotF.makeP2Set().addAll(srcSet, null)) {
returnValue = true;
}
}
}) | ret;
}
return ret;
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class PropIter method handleLoads.
protected final boolean handleLoads(FieldRefNode src) {
boolean ret = false;
final Node[] loadTargets = pag.loadLookup(src);
final SparkField f = src.getField();
ret = src.getBase().getP2Set().forall(new P2SetVisitor() {
public final void visit(Node n) {
AllocDotField nDotF = ((AllocNode) n).dot(f);
if (nDotF == null)
return;
PointsToSetInternal set = nDotF.getP2Set();
if (set.isEmpty())
return;
for (Node element : loadTargets) {
VarNode target = (VarNode) element;
if (target.makeP2Set().addAll(set, null)) {
returnValue = true;
}
}
}
}) | ret;
return ret;
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class PropWorklist method handleAllocNode.
/* End of public methods. */
/* End of package methods. */
/**
* Propagates new points-to information of node src to all its successors.
*/
protected final boolean handleAllocNode(AllocNode src) {
boolean ret = false;
Node[] targets = pag.allocLookup(src);
for (Node element : targets) {
if (element.makeP2Set().add(src)) {
varNodeWorkList.add((VarNode) element);
ret = true;
}
}
return ret;
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class MergeChecker method handleStores.
protected void handleStores(final VarNode src) {
final PointsToSetInternal srcSet = src.getP2Set();
if (srcSet.isEmpty())
return;
Node[] storeTargets = pag.storeLookup(src);
for (Node element : storeTargets) {
final FieldRefNode fr = (FieldRefNode) element;
checkAll(fr, srcSet, src);
}
}
use of soot.jimple.spark.pag.VarNode in project soot by Sable.
the class OfflineProcessor method defaultFeedPtsRoutines.
public void defaultFeedPtsRoutines() {
switch(Parameters.seedPts) {
case Constants.seedPts_allUser:
setAllUserCodeVariablesUseful();
break;
case Constants.seedPts_all:
// All pointers will be processed
for (int i = 0; i < n_var; ++i) {
IVarAbstraction pn = int2var.get(i);
if (pn != null && pn.getRepresentative() == pn)
pn.willUpdate = true;
}
return;
}
// We always refine the callsites that have multiple call targets
Set<Node> multiBaseptrs = new HashSet<Node>();
for (Stmt callsite : geomPTA.multiCallsites) {
InstanceInvokeExpr iie = (InstanceInvokeExpr) callsite.getInvokeExpr();
VarNode vn = geomPTA.findLocalVarNode(iie.getBase());
multiBaseptrs.add(vn);
}
addUserDefPts(multiBaseptrs);
}
Aggregations