Package soot.jimple.spark.geom.dataMgr
Class PtSensVisitor<VarType extends ContextVar>
- java.lang.Object
-
- soot.jimple.spark.geom.dataMgr.PtSensVisitor<VarType>
-
- Direct Known Subclasses:
Obj_full_extractor
public abstract class PtSensVisitor<VarType extends ContextVar> extends Object
A container for storing context sensitive querying result of geomPTA. Similar to the class PointsToSetInternal for SPARK. This class maintains two views for the results: 1. Table view: every object has a separate list of its context sensitive versions; 2. List view: all context sensitive objects are put in a single list.- Author:
- xiao
-
-
Field Summary
Fields Modifier and Type Field Description List<VarType>outListprotected GeomPointsToptsProviderprotected booleanreadyToUseprotected Map<Node,List<VarType>>tableView
-
Constructor Summary
Constructors Constructor Description PtSensVisitor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddebugPrint()Print the objects.voidfinish()Called after each round of collection.List<VarType>getCSList(Node var)Obtain the list of context sensitive objects pointed to by var.booleangetUsageState()The visitor contains valid information only when this function returns true.booleanhasNonEmptyIntersection(PtSensVisitor<VarType> other)Tests if two containers have contain same things.intnumOfDiffObjects()Return the number of different points-to targets.voidprepare()Called before each round of collection.PointsToSettoSparkCompatiableResult(VarNode vn)Transform the result to SPARK style context insensitive points-to set.abstract booleanvisit(Node var, long L, long R, int sm_int)We use visitor pattern to collect contexts.
-
-
-
Field Detail
-
readyToUse
protected boolean readyToUse
-
ptsProvider
protected GeomPointsTo ptsProvider
-
outList
public List<VarType extends ContextVar> outList
-
tableView
protected Map<Node,List<VarType extends ContextVar>> tableView
-
-
Method Detail
-
prepare
public void prepare()
Called before each round of collection.
-
finish
public void finish()
Called after each round of collection.
-
getUsageState
public boolean getUsageState()
The visitor contains valid information only when this function returns true.- Returns:
-
numOfDiffObjects
public int numOfDiffObjects()
Return the number of different points-to targets.
-
hasNonEmptyIntersection
public boolean hasNonEmptyIntersection(PtSensVisitor<VarType> other)
Tests if two containers have contain same things. Can be used to answer the alias query.
-
getCSList
public List<VarType> getCSList(Node var)
Obtain the list of context sensitive objects pointed to by var.- Parameters:
var-- Returns:
-
toSparkCompatiableResult
public PointsToSet toSparkCompatiableResult(VarNode vn)
Transform the result to SPARK style context insensitive points-to set. The transformed result is stored in the points-to set of the querying pointer.- Parameters:
vn- : the querying pointer- Returns:
-
debugPrint
public void debugPrint()
Print the objects.
-
visit
public abstract boolean visit(Node var, long L, long R, int sm_int)
We use visitor pattern to collect contexts. Derived classes decide how to deal with the variable with the contexts [L, R). Returning false means this interval [L, R) is covered by other intervals.- Parameters:
var-L-R-sm_int- : the integer ID of the SootMethod
-
-