|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vasco.callgraph.PointsToGraph
public class PointsToGraph
A data flow value representation for points-to analysis using allocation sites.
The points-to graph contains two types of edges: (1) from root variables
(Local
) to objects represented by allocation
sites (AnyNewExpr
),
and (2) from objects to objects along fields (SootField
).
Special artificial locals are used for string constants, class constants, return values, etc. and artificial sites are used for summary nodes. For arrays an artificial field is used to represent element access.
Field Summary | |
---|---|
static SootField |
ARRAY_FIELD
|
static Constant |
CLASS_CONST
|
static NewExpr |
CLASS_SITE
|
static Local |
GLOBAL_LOCAL
|
static NewExpr |
GLOBAL_SITE
|
protected Map<AnyNewExpr,Map<SootField,Set<AnyNewExpr>>> |
heap
|
static Local |
RETURN_LOCAL
|
protected Map<Local,Set<AnyNewExpr>> |
roots
|
static Local |
STICKY_LOCAL
|
static Constant |
STRING_CONST
|
static NewExpr |
STRING_SITE
|
static NewExpr |
SUMMARY_NODE
|
Constructor Summary | |
---|---|
PointsToGraph()
Constructs a new empty points-to graph. |
|
PointsToGraph(PointsToGraph other)
Constructs a copy of the given points-to graph. |
Method Summary | |
---|---|
void |
assign(Local lhs,
Local rhs)
Assigns a root variable to a root variable. |
void |
assignConstant(Local lhs,
Constant rhs)
Assigns a constant to a root variable. |
void |
assignNew(Local lhs,
AnyNewExpr allocSite)
Assigns a root variable to a new object at a given allocation site. |
void |
assignSticky(Local sticky,
Local parameter)
Assigns the sticky local to a parameter. |
void |
assignSummary(Local lhs)
Assigns a root variable to the summary node. |
static boolean |
canCast(SootClass fromClass,
SootClass toClass)
Determines whether an object of one class can be cast to another class. |
boolean |
containsEdge(Local var,
AnyNewExpr node)
Returns true only if there is an edge from the given root variable to the given heap node. |
boolean |
equals(Object obj)
|
void |
gc()
Removes all unreachable nodes from the edge sets. |
void |
getField(Local lhs,
Local rhs,
SootField field)
Loads a field of an object into a root variable. |
Set<AnyNewExpr> |
getTargets(Local local)
Returns the points-to set of a root variable. |
int |
hashCode()
|
void |
kill(Local v)
Removes all out-edges of the given variable |
void |
killWithoutGC(Local local)
|
void |
setField(Local lhs,
SootField field,
Local rhs)
Stores values pointed-to by one root variable into a field of objects pointed-to by another root variable. |
void |
setFieldConstant(Local lhs,
SootField field,
Constant rhs)
Stores a constant into a field of objects pointed-to by a root variable. |
void |
setFieldNew(Local lhs,
SootField field,
AnyNewExpr allocSite)
Stores a new object into a field of objects pointed-to by a root variable. |
void |
setFieldSummary(Local lhs,
SootField field)
Stores the summary node into a field of objects pointed-to by a root variable. |
void |
subtractHeap(PointsToGraph other)
Removes nodes contained in the argument. |
void |
summarizeTargetFields(Local lhs)
|
String |
toString()
|
void |
union(PointsToGraph p,
PointsToGraph q)
Sets this graph to the union of the given arguments. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SootField ARRAY_FIELD
public static final Local GLOBAL_LOCAL
public static final Local RETURN_LOCAL
public static final Local STICKY_LOCAL
public static final Constant STRING_CONST
public static final Constant CLASS_CONST
public static final NewExpr STRING_SITE
public static final NewExpr CLASS_SITE
public static final NewExpr SUMMARY_NODE
public static final NewExpr GLOBAL_SITE
protected Map<Local,Set<AnyNewExpr>> roots
protected Map<AnyNewExpr,Map<SootField,Set<AnyNewExpr>>> heap
Constructor Detail |
---|
public PointsToGraph()
public PointsToGraph(PointsToGraph other)
other
- the points-to graph to copyMethod Detail |
---|
public boolean containsEdge(Local var, AnyNewExpr node)
public void assign(Local lhs, Local rhs)
public void assignConstant(Local lhs, Constant rhs)
public void assignSticky(Local sticky, Local parameter)
public void assignNew(Local lhs, AnyNewExpr allocSite)
public void assignSummary(Local lhs)
public static boolean canCast(SootClass fromClass, SootClass toClass)
fromClass
- the source typetoClass
- the target type
public boolean equals(Object obj)
equals
in class Object
public void gc()
public void getField(Local lhs, Local rhs, SootField field)
public Set<AnyNewExpr> getTargets(Local local)
public int hashCode()
hashCode
in class Object
public void kill(Local v)
public void setField(Local lhs, SootField field, Local rhs)
public void setFieldConstant(Local lhs, SootField field, Constant rhs)
public void setFieldNew(Local lhs, SootField field, AnyNewExpr allocSite)
public void setFieldSummary(Local lhs, SootField field)
public void subtractHeap(PointsToGraph other)
public void summarizeTargetFields(Local lhs)
public String toString()
toString
in class Object
public void union(PointsToGraph p, PointsToGraph q)
public void killWithoutGC(Local local)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |