public class PAG extends java.lang.Object implements PointsToAnalysis
Modifier and Type | Field and Description |
---|---|
protected ClientAccessibilityOracle |
accessibilityOracle |
protected java.util.Map<AllocNode,java.lang.Object> |
alloc |
protected java.util.Map<VarNode,java.lang.Object> |
allocInv |
protected MultiMap<Pair<Node,Node>,Edge> |
assign2edges |
protected java.util.Map<NewInstanceNode,java.lang.Object> |
assignInstance |
protected java.util.Map<VarNode,java.lang.Object> |
assignInstanceInv |
HashMultiMap<InvokeExpr,Pair<Node,Node>> |
callAssigns |
java.util.Map<InvokeExpr,SootMethod> |
callToMethod |
protected CGOptions |
cgOpts |
protected ChunkedQueue<Node> |
edgeQueue |
protected static Node[] |
EMPTY_NODE_ARRAY |
protected java.util.Map<FieldRefNode,java.lang.Object> |
load |
protected java.util.Map<VarNode,java.lang.Object> |
loadInv |
int |
maxFinishNumber |
NativeMethodDriver |
nativeMethodDriver |
protected java.util.Map<VarNode,java.lang.Object> |
newInstance |
protected java.util.Map<NewInstanceNode,java.lang.Object> |
newInstanceInv |
protected SparkOptions |
opts |
protected P2SetFactory |
setFactory |
protected java.util.Map<VarNode,java.lang.Object> |
simple |
protected java.util.Map<VarNode,java.lang.Object> |
simpleInv |
protected boolean |
somethingMerged |
protected java.util.Map<VarNode,java.lang.Object> |
store |
protected java.util.Map<FieldRefNode,java.lang.Object> |
storeInv |
protected TypeManager |
typeManager |
java.util.Map<InvokeExpr,Node> |
virtualCallsToReceivers |
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(java.util.Map<K,java.lang.Object> m,
K key,
Node value) |
Node[] |
allocInvLookup(VarNode key) |
java.util.Set<VarNode> |
allocInvSources() |
java.util.Iterator<VarNode> |
allocInvSourcesIterator() |
Node[] |
allocLookup(AllocNode key) |
QueueReader<AllocNode> |
allocNodeListener() |
java.util.Set<AllocNode> |
allocSources() |
java.util.Iterator<AllocNode> |
allocSourcesIterator() |
Node[] |
assignInstanceLookup(NewInstanceNode key) |
java.util.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(java.lang.Object baseValue,
Context context)
Finds the ContextVarNode for base variable value and context context, or
returns null.
|
FieldRefNode |
findGlobalFieldRefNode(java.lang.Object baseValue,
SparkField field)
Finds the FieldRefNode for base variable value and field field, or returns
null.
|
GlobalVarNode |
findGlobalVarNode(java.lang.Object value)
Finds the GlobalVarNode for the variable value, or returns null.
|
FieldRefNode |
findLocalFieldRefNode(java.lang.Object baseValue,
SparkField field)
Finds the FieldRefNode for base variable value and field field, or returns
null.
|
LocalVarNode |
findLocalVarNode(java.lang.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.
|
java.util.List<VarNode> |
getDereferences()
Returns list of dereferences variables.
|
ArrayNumberer<FieldRefNode> |
getFieldRefNodeNumberer() |
java.util.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) |
java.util.Set<VarNode> |
loadInvSources() |
java.util.Iterator<VarNode> |
loadInvSourcesIterator() |
Node[] |
loadLookup(FieldRefNode key) |
java.util.Set<FieldRefNode> |
loadSources() |
java.util.Iterator<FieldRefNode> |
loadSourcesIterator() |
protected <K extends Node> |
lookup(java.util.Map<K,java.lang.Object> m,
K key) |
java.util.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(java.lang.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(java.lang.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(java.lang.Object baseValue,
Type baseType,
SparkField field)
Finds or creates the FieldRefNode for base variable baseValue and field
field, of type type.
|
GlobalVarNode |
makeGlobalVarNode(java.lang.Object value,
Type type)
Finds or creates the GlobalVarNode for the variable value, of type type.
|
FieldRefNode |
makeLocalFieldRefNode(java.lang.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(java.lang.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(java.lang.String s) |
Node[] |
newInstanceLookup(VarNode key) |
java.util.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) |
java.util.Set<VarNode> |
simpleInvSources() |
java.util.Iterator<VarNode> |
simpleInvSourcesIterator() |
Node[] |
simpleLookup(VarNode key) |
java.util.Set<VarNode> |
simpleSources() |
java.util.Iterator<VarNode> |
simpleSourcesIterator() |
Node[] |
storeInvLookup(FieldRefNode key) |
java.util.Set<FieldRefNode> |
storeInvSources() |
java.util.Iterator<FieldRefNode> |
storeInvSourcesIterator() |
Node[] |
storeLookup(VarNode key) |
java.util.Set<VarNode> |
storeSources() |
java.util.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 java.util.Map<VarNode,java.lang.Object> simple
protected java.util.Map<FieldRefNode,java.lang.Object> load
protected java.util.Map<VarNode,java.lang.Object> store
protected java.util.Map<AllocNode,java.lang.Object> alloc
protected java.util.Map<VarNode,java.lang.Object> newInstance
protected java.util.Map<NewInstanceNode,java.lang.Object> assignInstance
protected java.util.Map<VarNode,java.lang.Object> simpleInv
protected java.util.Map<VarNode,java.lang.Object> loadInv
protected java.util.Map<FieldRefNode,java.lang.Object> storeInv
protected java.util.Map<VarNode,java.lang.Object> allocInv
protected java.util.Map<NewInstanceNode,java.lang.Object> newInstanceInv
protected java.util.Map<VarNode,java.lang.Object> assignInstanceInv
protected TypeManager typeManager
public int maxFinishNumber
public NativeMethodDriver nativeMethodDriver
public HashMultiMap<InvokeExpr,Pair<Node,Node>> callAssigns
public java.util.Map<InvokeExpr,SootMethod> callToMethod
public java.util.Map<InvokeExpr,Node> virtualCallsToReceivers
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 java.util.Set<VarNode> simpleSources()
public java.util.Set<AllocNode> allocSources()
public java.util.Set<VarNode> storeSources()
public java.util.Set<FieldRefNode> loadSources()
public java.util.Set<VarNode> newInstanceSources()
public java.util.Set<NewInstanceNode> assignInstanceSources()
public java.util.Set<VarNode> simpleInvSources()
public java.util.Set<VarNode> allocInvSources()
public java.util.Set<FieldRefNode> storeInvSources()
public java.util.Set<VarNode> loadInvSources()
public java.util.Iterator<VarNode> simpleSourcesIterator()
public java.util.Iterator<AllocNode> allocSourcesIterator()
public java.util.Iterator<VarNode> storeSourcesIterator()
public java.util.Iterator<FieldRefNode> loadSourcesIterator()
public java.util.Iterator<VarNode> simpleInvSourcesIterator()
public java.util.Iterator<VarNode> allocInvSourcesIterator()
public java.util.Iterator<FieldRefNode> storeInvSourcesIterator()
public java.util.Iterator<VarNode> loadInvSourcesIterator()
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(java.lang.Object newExpr, Type type, SootMethod m)
public AllocNode makeStringConstantNode(java.lang.String s)
public AllocNode makeClassConstantNode(ClassConstant cc)
public QueueReader<AllocNode> allocNodeListener()
public GlobalVarNode findGlobalVarNode(java.lang.Object value)
public LocalVarNode findLocalVarNode(java.lang.Object value)
public GlobalVarNode makeGlobalVarNode(java.lang.Object value, Type type)
public LocalVarNode makeLocalVarNode(java.lang.Object value, Type type, SootMethod method)
public NewInstanceNode makeNewInstanceNode(Value value, Type type, SootMethod method)
public ContextVarNode findContextVarNode(java.lang.Object baseValue, Context context)
public ContextVarNode makeContextVarNode(java.lang.Object baseValue, Type baseType, Context context, SootMethod method)
public ContextVarNode makeContextVarNode(LocalVarNode base, Context context)
public FieldRefNode findLocalFieldRefNode(java.lang.Object baseValue, SparkField field)
public FieldRefNode findGlobalFieldRefNode(java.lang.Object baseValue, SparkField field)
public FieldRefNode makeLocalFieldRefNode(java.lang.Object baseValue, Type baseType, SparkField field, SootMethod method)
public FieldRefNode makeGlobalFieldRefNode(java.lang.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 java.util.List<VarNode> getDereferences()
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()
protected <K extends Node> boolean addToMap(java.util.Map<K,java.lang.Object> m, K key, Node value)
public GlobalNodeFactory nodeFactory()