|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.PointerAnalysis.PointsToGraph
public class PointsToGraph
PointsToGraph
models the memory, as specified by the
abstraction of the object creation sites. Each "node" in our
abstraction models one or moree objects and the graph of concrete objects
is modelled as a graph of nodes. In addition, we preserve some escape
information.
Look into one of Martin and John Whaley papers for the complete definition.
Field Summary | |
---|---|
static boolean |
DEBUG
|
PAEscapeFunc |
e
The escape function. |
Set |
excp
The set of objects which are returned as exception |
PAEdgeSet |
I
The set of the inside edges. |
PAEdgeSet |
O
The set of the outside edges. |
Set |
r
The set of normally returned objects |
Set |
reachable_from_excp
|
Constructor Summary | |
---|---|
PointsToGraph()
Creates a PointsToGraph . |
Method Summary | |
---|---|
boolean |
captured(PANode node)
Tests whether node node is captured. |
Object |
clone()
Deep copy of a PointsToGraph . |
boolean |
equals(Object o)
Checks the equality of two PointsToGraph s. |
boolean |
escaped(PANode node)
Tests whether node node is an escaped node. |
void |
flushCaches()
Flushes the internal caches in this PointsToGraph . |
Set |
getReachableFromExcp()
Returns the set of nodes reachable from the exceptionally returned nodes (including the exceptionally returned nodes). |
Set |
getReachableFromR()
Returns the set of nodes reachable from the returned nodes (including the returned nodes). |
void |
insert_edges(PAEdgeSet O2,
PAEdgeSet I2,
Relation mu)
|
void |
insert(PointsToGraph G2,
Relation mu,
boolean principal,
Set noholes)
Inserts the image of G2 points-to graph through
the mu node mapping into this
object. |
void |
join(PointsToGraph G2)
join is called in the control-flow join points. |
PointsToGraph |
keepTheEssential(PANode[] params,
Set remaining_nodes,
boolean is_main)
Produces a PointsToGraph containing just the nodes
that are reachable from root nodes: the nodes that could be
reached from outside
code (e.g. the caller): the parameter nodes (received in
the params ) and the returned nodes (found
in this.r ). |
void |
propagate()
Convenient function that recomputes all the escape info. |
void |
propagate(Collection escaped)
Propagates the escape information along the edges. |
Set |
reachableNodes(Set roots)
Computes the set of nodes reachable from nodes in roots
through paths that use inside and outside edges. |
void |
remove(Set set)
Remove all the PANode s that appear in set
from this points-to graph. |
PointsToGraph |
specialize(Map map)
|
String |
toString()
Pretty-print function for debug purposes. |
boolean |
willEscape(PANode node)
Checks whether node node will escape because
it is returned or because it is reachable from a returned node. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean DEBUG
public PAEdgeSet O
public PAEdgeSet I
public PAEscapeFunc e
public Set r
public Set excp
public Set reachable_from_excp
Constructor Detail |
---|
public PointsToGraph()
PointsToGraph
.
Method Detail |
---|
public void flushCaches()
PointsToGraph
.
public final Set reachableNodes(Set roots)
roots
through paths that use inside and outside edges. The argument must
be a set of PANode
s. The roots
set is
included in the returned set (i.e. 0-length paths are considered).
public Set getReachableFromR()
public Set getReachableFromExcp()
public boolean willEscape(PANode node)
node
will escape because
it is returned or because it is reachable from a returned node.
Both kinds of returns - return
and throw
-
are considered.
public boolean escaped(PANode node)
node
is an escaped node.
An escaped node is a node which has escaped through some node
or method hole or is reachable (possibly through a 0-length path)
from a node which is returned as a normal result or as an exception,
from the method.
public boolean captured(PANode node)
node
is captured.
This method is simply the negation of escaped
.
public void join(PointsToGraph G2)
join
is called in the control-flow join points.
public void remove(Set set)
PANode
s that appear in set
from this
points-to graph.
public void insert(PointsToGraph G2, Relation mu, boolean principal, Set noholes)
G2
points-to graph through
the mu
node mapping into this
object. This method is designed to be called - indirectly
through ParIntGraph.insertAllButArEo
- at the end
of the caller/callee or starter/startee interaction. principal
controls whether the return and
exception set are inserted.
public void insert_edges(PAEdgeSet O2, PAEdgeSet I2, Relation mu)
public PointsToGraph specialize(Map map)
public void propagate(Collection escaped)
public void propagate()
propagate(e.escapedNodes())
.
public boolean equals(Object o)
PointsToGraph
s.
equals
in class Object
public Object clone()
PointsToGraph
.
clone
in class Object
public PointsToGraph keepTheEssential(PANode[] params, Set remaining_nodes, boolean is_main)
PointsToGraph
containing just the nodes
that are reachable from root nodes: the nodes that could be
reached from outside
code (e.g. the caller): the parameter nodes (received in
the params
) and the returned nodes (found
in this.r
).
The static nodes are implicitly considered roots
for all the methods except "main"
(is_main=true
).remaining_nodes
public String toString()
PointsToGraph
s are guaranteed to have the same
string representation.
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |