soot.jimple.spark.pag
Class PAG

java.lang.Object
  |
  +--soot.jimple.spark.pag.PAG

public class PAG
extends java.lang.Object
implements PointsToAnalysis

Pointer assignment graph.


Field Summary
protected  java.util.Map alloc
           
protected  java.util.Map allocInv
           
protected static Node[] EMPTY_NODE_ARRAY
           
protected  java.util.Map load
           
protected  java.util.Map loadInv
           
 int maxFinishNumber
           
protected  SparkOptions opts
           
protected  java.util.Map simple
           
protected  java.util.Map simpleInv
           
protected  java.util.Map store
           
protected  java.util.Map storeInv
           
 
Fields inherited from interface soot.PointsToAnalysis
ARRAY_ELEMENTS_NODE, CAST_NODE, DEFAULT_CLASS_LOADER, DEFAULT_CLASS_LOADER_LOCAL, EXCEPTION_NODE, 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, RETURN_NODE, RETURN_STRING_CONSTANT_NODE, STRING_ARRAY_NODE, STRING_ARRAY_NODE_LOCAL, STRING_NODE, STRING_NODE_LOCAL, THIS_NODE, THROW_NODE
 
Constructor Summary
PAG(SparkOptions opts)
           
 
Method Summary
 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.
protected  boolean addToMap(java.util.Map m, Node key, Node value)
           
 Node[] allocInvLookup(VarNode key)
           
 java.util.Set allocInvSources()
           
 Node[] allocLookup(AllocNode key)
           
 QueueReader allocNodeListener()
           
 java.util.Set allocSources()
           
 void cleanUpMerges()
           
 QueueReader edgeReader()
           
 AllocDotField findAllocDotField(AllocNode an, SparkField field)
          Finds the AllocDotField for base AllocNode an and field field, or returns null.
 FieldRefNode findFieldRefNode(java.lang.Object baseValue, SparkField field)
          Finds the FieldRefNode for base variable value and field field, or returns null.
 VarNode findVarNode(java.lang.Object value)
          Finds the VarNode for the variable value, or returns null.
 Numberer getAllocDotFieldNodeNumberer()
           
 Numberer getAllocNodeNumberer()
           
 java.util.List getDereferences()
          Returns list of dereferences variables.
 Numberer getFieldRefNodeNumberer()
           
 java.util.Map getNodeTags()
           
 int getNumAllocNodes()
           
 OnFlyCallGraph getOnFlyCallGraph()
           
 SparkOptions getOpts()
          Returns SparkOptions for this graph.
 P2SetFactory getSetFactory()
           
 TypeManager getTypeManager()
           
 Numberer getVarNodeNumberer()
           
 Node[] loadInvLookup(VarNode key)
           
 java.util.Set loadInvSources()
           
 Node[] loadLookup(FieldRefNode key)
           
 java.util.Set loadSources()
           
protected  Node[] lookup(java.util.Map m, java.lang.Object key)
           
 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(java.lang.String s)
           
 FieldRefNode makeFieldRefNode(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.
 FieldRefNode makeFieldRefNode(VarNode base, SparkField field)
          Finds or creates the FieldRefNode for base variable base and field field, of type type.
 AllocNode makeStringConstantNode(java.lang.String s)
           
 VarNode makeVarNode(java.lang.Object value, Type type, SootMethod method)
          Finds or creates the VarNode for the variable value, of type type.
 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.
 void setOnFlyCallGraph(OnFlyCallGraph ofcg)
           
 Node[] simpleInvLookup(VarNode key)
           
 java.util.Set simpleInvSources()
           
 Node[] simpleLookup(VarNode key)
           
 java.util.Set simpleSources()
           
 Node[] storeInvLookup(FieldRefNode key)
           
 java.util.Set storeInvSources()
           
 Node[] storeLookup(VarNode key)
           
 java.util.Set storeSources()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opts

protected SparkOptions opts

simple

protected java.util.Map simple

load

protected java.util.Map load

store

protected java.util.Map store

alloc

protected java.util.Map alloc

simpleInv

protected java.util.Map simpleInv

loadInv

protected java.util.Map loadInv

storeInv

protected java.util.Map storeInv

allocInv

protected java.util.Map allocInv

EMPTY_NODE_ARRAY

protected static final Node[] EMPTY_NODE_ARRAY

maxFinishNumber

public int maxFinishNumber
Constructor Detail

PAG

public PAG(SparkOptions opts)
Method Detail

reachingObjects

public PointsToSet reachingObjects(Local l)
Returns the set of objects pointed to by variable l.
Specified by:
reachingObjects in interface PointsToAnalysis

reachingObjects

public PointsToSet reachingObjects(SootField f)
Returns the set of objects pointed to by static field f.
Specified by:
reachingObjects in interface PointsToAnalysis

reachingObjects

public PointsToSet reachingObjects(PointsToSet s,
                                   SootField f)
Returns the set of objects pointed to by instance field f of the objects in the PointsToSet s.
Specified by:
reachingObjects in interface PointsToAnalysis

reachingObjects

public PointsToSet reachingObjects(Local l,
                                   SootField f)
Returns the set of objects pointed to by instance field f of the objects pointed to by l.
Specified by:
reachingObjects in interface PointsToAnalysis

getOpts

public SparkOptions getOpts()
Returns SparkOptions for this graph.

makeAllocNode

public AllocNode makeAllocNode(java.lang.Object newExpr,
                               Type type,
                               SootMethod m)

makeStringConstantNode

public AllocNode makeStringConstantNode(java.lang.String s)

makeClassConstantNode

public AllocNode makeClassConstantNode(java.lang.String s)

allocNodeListener

public QueueReader allocNodeListener()

findVarNode

public VarNode findVarNode(java.lang.Object value)
Finds the VarNode for the variable value, or returns null.

makeVarNode

public VarNode makeVarNode(java.lang.Object value,
                           Type type,
                           SootMethod method)
Finds or creates the VarNode for the variable value, of type type.

findFieldRefNode

public FieldRefNode findFieldRefNode(java.lang.Object baseValue,
                                     SparkField field)
Finds the FieldRefNode for base variable value and field field, or returns null.

makeFieldRefNode

public FieldRefNode makeFieldRefNode(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.

makeFieldRefNode

public FieldRefNode makeFieldRefNode(VarNode base,
                                     SparkField field)
Finds or creates the FieldRefNode for base variable base and field field, of type type.

findAllocDotField

public AllocDotField findAllocDotField(AllocNode an,
                                       SparkField field)
Finds the AllocDotField for base AllocNode an and field field, or returns null.

makeAllocDotField

public AllocDotField makeAllocDotField(AllocNode an,
                                       SparkField field)
Finds or creates the AllocDotField for base variable baseValue and field field, of type t.

addEdge

public boolean addEdge(Node from,
                       Node to)
Adds an edge to the graph, returning false if it was already there.

edgeReader

public QueueReader edgeReader()

simpleLookup

public Node[] simpleLookup(VarNode key)

simpleInvLookup

public Node[] simpleInvLookup(VarNode key)

loadLookup

public Node[] loadLookup(FieldRefNode key)

loadInvLookup

public Node[] loadInvLookup(VarNode key)

storeLookup

public Node[] storeLookup(VarNode key)

storeInvLookup

public Node[] storeInvLookup(FieldRefNode key)

allocLookup

public Node[] allocLookup(AllocNode key)

allocInvLookup

public Node[] allocInvLookup(VarNode key)

simpleSources

public java.util.Set simpleSources()

allocSources

public java.util.Set allocSources()

storeSources

public java.util.Set storeSources()

loadSources

public java.util.Set loadSources()

simpleInvSources

public java.util.Set simpleInvSources()

allocInvSources

public java.util.Set allocInvSources()

storeInvSources

public java.util.Set storeInvSources()

loadInvSources

public java.util.Set loadInvSources()

getSetFactory

public P2SetFactory getSetFactory()

getNumAllocNodes

public int getNumAllocNodes()

getTypeManager

public TypeManager getTypeManager()

setOnFlyCallGraph

public void setOnFlyCallGraph(OnFlyCallGraph ofcg)

getOnFlyCallGraph

public OnFlyCallGraph getOnFlyCallGraph()

cleanUpMerges

public void cleanUpMerges()

addDereference

public void addDereference(VarNode base)
Adds the base of a dereference to the list of dereferenced variables.

getDereferences

public java.util.List getDereferences()
Returns list of dereferences variables.

getNodeTags

public java.util.Map getNodeTags()

getAllocNodeNumberer

public Numberer getAllocNodeNumberer()

getVarNodeNumberer

public Numberer getVarNodeNumberer()

getFieldRefNodeNumberer

public Numberer getFieldRefNodeNumberer()

getAllocDotFieldNodeNumberer

public Numberer getAllocDotFieldNodeNumberer()

addToMap

protected boolean addToMap(java.util.Map m,
                           Node key,
                           Node value)

lookup

protected Node[] lookup(java.util.Map m,
                        java.lang.Object key)