public class PAG extends Object implements PointsToAnalysis
ARRAY_ELEMENTS_NODE, CANONICAL_PATH, CANONICAL_PATH_LOCAL, CAST_NODE, DEFAULT_CLASS_LOADER, DEFAULT_CLASS_LOADER_LOCAL, EXCEPTION_NODE, FINALIZE_QUEUE, MAIN_CLASS_NAME_STRING, MAIN_CLASS_NAME_STRING_LOCAL, MAIN_THREAD_GROUP_NODE, MAIN_THREAD_GROUP_NODE_LOCAL, MAIN_THREAD_NODE, MAIN_THREAD_NODE_LOCAL, PHI_NODE, PRIVILEGED_ACTION_EXCEPTION, PRIVILEGED_ACTION_EXCEPTION_LOCAL, RETURN_NODE, RETURN_STRING_CONSTANT_NODE, STRING_ARRAY_NODE, STRING_ARRAY_NODE_LOCAL, STRING_NODE, STRING_NODE_LOCAL, THIS_NODE, THROW_NODE
Constructor and Description |
---|
PAG(SparkOptions opts) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAllocEdge(AllocNode from,
VarNode to) |
boolean |
addAssignInstanceEdge(NewInstanceNode from,
VarNode to) |
void |
addCallTarget(Edge e) |
void |
addCallTarget(MethodPAG srcmpag,
MethodPAG tgtmpag,
Stmt s,
Context srcContext,
Context tgtContext,
Edge e)
Adds method target as a possible target of the invoke expression in s.
|
void |
addDereference(VarNode base)
Adds the base of a dereference to the list of dereferenced variables.
|
boolean |
addEdge(Node from,
Node to)
Adds an edge to the graph, returning false if it was already there.
|
Pair<Node,Node> |
addInterproceduralAssignment(Node from,
Node to,
Edge e) |
boolean |
addLoadEdge(FieldRefNode from,
VarNode to) |
boolean |
addNewInstanceEdge(VarNode from,
NewInstanceNode to) |
boolean |
addSimpleEdge(VarNode from,
VarNode to) |
boolean |
addStoreEdge(VarNode from,
FieldRefNode to) |
protected <K extends Node> |
addToMap(Map<K,Object> m,
K key,
Node value) |
Node[] |
allocInvLookup(VarNode key) |
Set<VarNode> |
allocInvSources() |
Iterator<VarNode> |
allocInvSourcesIterator() |
Node[] |
allocLookup(AllocNode key) |
QueueReader<AllocNode> |
allocNodeListener() |
Set<AllocNode> |
allocSources() |
Iterator<AllocNode> |
allocSourcesIterator() |
Node[] |
assignInstanceLookup(NewInstanceNode key) |
Set<NewInstanceNode> |
assignInstanceSources() |
void |
cleanPAG()
Delete all the assignment edges.
|
void |
cleanUpMerges() |
boolean |
doAddAllocEdge(AllocNode from,
VarNode to) |
boolean |
doAddAssignInstanceEdge(NewInstanceNode from,
VarNode to) |
boolean |
doAddLoadEdge(FieldRefNode from,
VarNode to) |
boolean |
doAddNewInstanceEdge(VarNode from,
NewInstanceNode to) |
boolean |
doAddSimpleEdge(VarNode from,
VarNode to) |
boolean |
doAddStoreEdge(VarNode from,
FieldRefNode to) |
QueueReader<Node> |
edgeReader() |
AllocDotField |
findAllocDotField(AllocNode an,
SparkField field)
Finds the AllocDotField for base AllocNode an and field field, or returns
null.
|
ContextVarNode |
findContextVarNode(Object baseValue,
Context context)
Finds the ContextVarNode for base variable value and context context, or
returns null.
|
FieldRefNode |
findGlobalFieldRefNode(Object baseValue,
SparkField field)
Finds the FieldRefNode for base variable value and field field, or
returns null.
|
GlobalVarNode |
findGlobalVarNode(Object value)
Finds the GlobalVarNode for the variable value, or returns null.
|
FieldRefNode |
findLocalFieldRefNode(Object baseValue,
SparkField field)
Finds the FieldRefNode for base variable value and field field, or
returns null.
|
LocalVarNode |
findLocalVarNode(Object value)
Finds the LocalVarNode for the variable value, or returns null.
|
ArrayNumberer<AllocDotField> |
getAllocDotFieldNodeNumberer() |
ArrayNumberer<AllocNode> |
getAllocNodeNumberer() |
CGOptions |
getCGOpts()
Returns CGOptions for this graph.
|
List<VarNode> |
getDereferences()
Returns list of dereferences variables.
|
ArrayNumberer<FieldRefNode> |
getFieldRefNodeNumberer() |
Map<Node,Tag> |
getNodeTags() |
int |
getNumAllocNodes() |
OnFlyCallGraph |
getOnFlyCallGraph() |
SparkOptions |
getOpts()
Returns SparkOptions for this graph.
|
P2SetFactory |
getSetFactory() |
TypeManager |
getTypeManager() |
ArrayNumberer<VarNode> |
getVarNodeNumberer() |
Node[] |
loadInvLookup(VarNode key) |
Set<VarNode> |
loadInvSources() |
Iterator<VarNode> |
loadInvSourcesIterator() |
Node[] |
loadLookup(FieldRefNode key) |
Set<FieldRefNode> |
loadSources() |
Iterator<FieldRefNode> |
loadSourcesIterator() |
protected <K extends Node> |
lookup(Map<K,Object> m,
K key) |
Set<Edge> |
lookupEdgesForAssignment(Pair<Node,Node> val) |
AllocDotField |
makeAllocDotField(AllocNode an,
SparkField field)
Finds or creates the AllocDotField for base variable baseValue and field
field, of type t.
|
AllocNode |
makeAllocNode(Object newExpr,
Type type,
SootMethod m) |
AllocNode |
makeClassConstantNode(ClassConstant cc) |
ContextVarNode |
makeContextVarNode(LocalVarNode base,
Context context)
Finds or creates the ContextVarNode for base variable base and context
context, of type type.
|
ContextVarNode |
makeContextVarNode(Object baseValue,
Type baseType,
Context context,
SootMethod method)
Finds or creates the ContextVarNode for base variable baseValue and
context context, of type type.
|
FieldRefNode |
makeFieldRefNode(VarNode base,
SparkField field)
Finds or creates the FieldRefNode for base variable base and field field,
of type type.
|
FieldRefNode |
makeGlobalFieldRefNode(Object baseValue,
Type baseType,
SparkField field)
Finds or creates the FieldRefNode for base variable baseValue and field
field, of type type.
|
GlobalVarNode |
makeGlobalVarNode(Object value,
Type type)
Finds or creates the GlobalVarNode for the variable value, of type type.
|
FieldRefNode |
makeLocalFieldRefNode(Object baseValue,
Type baseType,
SparkField field,
SootMethod method)
Finds or creates the FieldRefNode for base variable baseValue and field
field, of type type.
|
LocalVarNode |
makeLocalVarNode(Object value,
Type type,
SootMethod method)
Finds or creates the LocalVarNode for the variable value, of type type.
|
NewInstanceNode |
makeNewInstanceNode(Value value,
Type type,
SootMethod method) |
AllocNode |
makeStringConstantNode(String s) |
Node[] |
newInstanceLookup(VarNode key) |
Set<VarNode> |
newInstanceSources() |
GlobalNodeFactory |
nodeFactory() |
OnFlyCallGraph |
ofcg() |
PointsToSet |
reachingObjects(Context c,
Local l)
Returns the set of objects pointed to by variable l in context c.
|
PointsToSet |
reachingObjects(Context c,
Local l,
SootField f)
Returns the set of objects pointed to by instance field f of the objects
pointed to by l in context c.
|
PointsToSet |
reachingObjects(Local l)
Returns the set of objects pointed to by variable l.
|
PointsToSet |
reachingObjects(Local l,
SootField f)
Returns the set of objects pointed to by instance field f of the objects
pointed to by l.
|
PointsToSet |
reachingObjects(PointsToSet s,
SootField f)
Returns the set of objects pointed to by instance field f of the objects
in the PointsToSet s.
|
PointsToSet |
reachingObjects(SootField f)
Returns the set of objects pointed to by static field f.
|
PointsToSet |
reachingObjectsOfArrayElement(PointsToSet s)
Returns the set of objects pointed to by elements of the arrays in the
PointsToSet s.
|
void |
setOnFlyCallGraph(OnFlyCallGraph ofcg) |
Node[] |
simpleInvLookup(VarNode key) |
Set<VarNode> |
simpleInvSources() |
Iterator<VarNode> |
simpleInvSourcesIterator() |
Node[] |
simpleLookup(VarNode key) |
Set<VarNode> |
simpleSources() |
Iterator<VarNode> |
simpleSourcesIterator() |
Node[] |
storeInvLookup(FieldRefNode key) |
Set<FieldRefNode> |
storeInvSources() |
Iterator<FieldRefNode> |
storeInvSourcesIterator() |
Node[] |
storeLookup(VarNode key) |
Set<VarNode> |
storeSources() |
Iterator<VarNode> |
storeSourcesIterator() |
protected static final Node[] EMPTY_NODE_ARRAY
protected P2SetFactory setFactory
protected boolean somethingMerged
protected ChunkedQueue<Node> edgeQueue
protected SparkOptions opts
protected CGOptions cgOpts
protected ClientAccessibilityOracle accessibilityOracle
protected Map<FieldRefNode,Object> load
protected Map<NewInstanceNode,Object> assignInstance
protected Map<FieldRefNode,Object> storeInv
protected Map<NewInstanceNode,Object> newInstanceInv
protected TypeManager typeManager
public int maxFinishNumber
public NativeMethodDriver nativeMethodDriver
public HashMultiMap<InvokeExpr,Pair<Node,Node>> callAssigns
public Map<InvokeExpr,SootMethod> callToMethod
public Map<InvokeExpr,Node> virtualCallsToReceivers
public PAG(SparkOptions opts)
public PointsToSet reachingObjects(Local l)
reachingObjects
in interface PointsToAnalysis
public PointsToSet reachingObjects(Context c, Local l)
reachingObjects
in interface PointsToAnalysis
public PointsToSet reachingObjects(SootField f)
reachingObjects
in interface PointsToAnalysis
public PointsToSet reachingObjects(PointsToSet s, SootField f)
reachingObjects
in interface PointsToAnalysis
public PointsToSet reachingObjectsOfArrayElement(PointsToSet s)
reachingObjectsOfArrayElement
in interface PointsToAnalysis
public P2SetFactory getSetFactory()
public void cleanUpMerges()
public boolean doAddStoreEdge(VarNode from, FieldRefNode to)
public boolean doAddLoadEdge(FieldRefNode from, VarNode to)
public boolean doAddNewInstanceEdge(VarNode from, NewInstanceNode to)
public boolean doAddAssignInstanceEdge(NewInstanceNode from, VarNode to)
public Node[] loadLookup(FieldRefNode key)
public Node[] assignInstanceLookup(NewInstanceNode key)
public Node[] storeInvLookup(FieldRefNode key)
public Set<FieldRefNode> loadSources()
public Set<NewInstanceNode> assignInstanceSources()
public Set<FieldRefNode> storeInvSources()
public Iterator<FieldRefNode> loadSourcesIterator()
public Iterator<FieldRefNode> storeInvSourcesIterator()
public PointsToSet reachingObjects(Local l, SootField f)
reachingObjects
in interface PointsToAnalysis
public PointsToSet reachingObjects(Context c, Local l, SootField f)
reachingObjects
in interface PointsToAnalysis
public AllocNode makeAllocNode(Object newExpr, Type type, SootMethod m)
public AllocNode makeClassConstantNode(ClassConstant cc)
public QueueReader<AllocNode> allocNodeListener()
public GlobalVarNode findGlobalVarNode(Object value)
public LocalVarNode findLocalVarNode(Object value)
public GlobalVarNode makeGlobalVarNode(Object value, Type type)
public LocalVarNode makeLocalVarNode(Object value, Type type, SootMethod method)
public NewInstanceNode makeNewInstanceNode(Value value, Type type, SootMethod method)
public ContextVarNode findContextVarNode(Object baseValue, Context context)
public ContextVarNode makeContextVarNode(Object baseValue, Type baseType, Context context, SootMethod method)
public ContextVarNode makeContextVarNode(LocalVarNode base, Context context)
public FieldRefNode findLocalFieldRefNode(Object baseValue, SparkField field)
public FieldRefNode findGlobalFieldRefNode(Object baseValue, SparkField field)
public FieldRefNode makeLocalFieldRefNode(Object baseValue, Type baseType, SparkField field, SootMethod method)
public FieldRefNode makeGlobalFieldRefNode(Object baseValue, Type baseType, SparkField field)
public FieldRefNode makeFieldRefNode(VarNode base, SparkField field)
public AllocDotField findAllocDotField(AllocNode an, SparkField field)
public AllocDotField makeAllocDotField(AllocNode an, SparkField field)
public boolean addStoreEdge(VarNode from, FieldRefNode to)
public boolean addLoadEdge(FieldRefNode from, VarNode to)
public boolean addNewInstanceEdge(VarNode from, NewInstanceNode to)
public boolean addAssignInstanceEdge(NewInstanceNode from, VarNode to)
public final boolean addEdge(Node from, Node to)
public QueueReader<Node> edgeReader()
public int getNumAllocNodes()
public TypeManager getTypeManager()
public void setOnFlyCallGraph(OnFlyCallGraph ofcg)
public OnFlyCallGraph getOnFlyCallGraph()
public OnFlyCallGraph ofcg()
public void addDereference(VarNode base)
public ArrayNumberer<AllocNode> getAllocNodeNumberer()
public ArrayNumberer<VarNode> getVarNodeNumberer()
public ArrayNumberer<FieldRefNode> getFieldRefNodeNumberer()
public ArrayNumberer<AllocDotField> getAllocDotFieldNodeNumberer()
public SparkOptions getOpts()
public CGOptions getCGOpts()
public Pair<Node,Node> addInterproceduralAssignment(Node from, Node to, Edge e)
public final void addCallTarget(Edge e)
public final void addCallTarget(MethodPAG srcmpag, MethodPAG tgtmpag, Stmt s, Context srcContext, Context tgtContext, Edge e)
public void cleanPAG()
public GlobalNodeFactory nodeFactory()