harpoon.Analysis.PointerAnalysis
Class PAEscapeFunc

java.lang.Object
  extended by harpoon.Analysis.PointerAnalysis.PAEscapeFunc
All Implemented Interfaces:
Serializable

public class PAEscapeFunc
extends Object
implements Serializable

PAEscapeFunc models the escape information. For each PANode node, it maintains all the nodes node escapes through (e.g. parameter nodes). Also, it records whether node escapes into a method hole or not.

Version:
$Id: PAEscapeFunc.java,v 1.7 2005/08/17 23:34:01 salcianu Exp $
Author:
Alexandru SALCIANU <salcianu@retezat.lcs.mit.edu>
See Also:
Serialized Form

Constructor Summary
PAEscapeFunc()
          Creates a EscapeFunc.
 
Method Summary
 boolean addMethodHole(PANode node, HMethod hm)
          Records the fact that node escaped into a method hole.
 boolean addMethodHoles(PANode node, Set mholes)
          Records the fact that node escaped into a set of method holes.
 boolean addNodeHole(PANode node, PANode n_hole)
          Records the fact that node can escape through the node n_hole.
 boolean addNodeHoles(PANode node, Set n_holes)
          Records the fact that node can escape through the node n_holes.
 Object clone()
          clone does a deep copy of this object.
 boolean equals(Object obj)
          Checks the equality of two PAEscapeFunc objects.
 Set escapedNodes()
          Returns the set of escaped nodes.
 boolean escapesOnlyInCaller(PANode node)
          Checks whether node escapes at most in the caller.
 Set getEscapedIntoMH()
          Returns the set of nodes which escape into a method hole.
 boolean hasEscaped(PANode node)
          Checks if node has escaped in some hole, ie if node could be accessed by unanalyzed code.
 boolean hasEscapedIntoAMethod(PANode node)
          Checks whether node escapes into a method hole or not.
 boolean hasEscapedIntoANode(PANode node)
          Checks whether node escapes through a node or not.
 void insert(PAEscapeFunc e2, Relation mu, Set noholes, Set ppgRoots)
          Inserts the image of e2 through the mu mapping into this PAEscapeFunc.
 Set methodHolesSet(PANode node)
          Returns the set of methods that node escapes into.
 Set nodeHolesSet(PANode node)
          Returns the set of all the node "holes" node escapes through.
 void remove(Set set)
          Remove all the PANodes that appear in set from this object.
 void removeMethodHole(PANode node, HMethod hm)
          The dual of addMethodHole
 void removeMethodHoles(Set good_holes)
          The methods from the set good_holes are unharmful to the specific application that uses the pointer analysis.
 void removeNodeHole(PANode node, PANode n_hole)
          The dual of addNodeHole
 void removeNodeHoleFromAll(PANode n_hole)
          Removes a node hole from all the nodes: esc(n) = esc(n) - {n_hole} for all n.
 PAEscapeFunc select(Set remaining_nodes)
          Returns a PAEscapeFunc containing escape information only about the nodes from the set remaining_nodes.
 PAEscapeFunc specialize(Map map)
           
 String toString()
          Pretty-print debug function.
 void union(PAEscapeFunc e2)
           
 void union(PAEscapeFunc e2, Set ppgRoots)
          Computes the union of this PAEscapeFunc with e2.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PAEscapeFunc

public PAEscapeFunc()
Creates a EscapeFunc.

Method Detail

addNodeHole

public final boolean addNodeHole(PANode node,
                                 PANode n_hole)
Records the fact that node can escape through the node n_hole. Returns true if new information has been gained


addNodeHoles

public final boolean addNodeHoles(PANode node,
                                  Set n_holes)
Records the fact that node can escape through the node n_holes. Returns true if new information has been gained


removeNodeHole

public final void removeNodeHole(PANode node,
                                 PANode n_hole)
The dual of addNodeHole


removeNodeHoleFromAll

public void removeNodeHoleFromAll(PANode n_hole)
Removes a node hole from all the nodes: esc(n) = esc(n) - {n_hole} for all n.


nodeHolesSet

public Set nodeHolesSet(PANode node)
Returns the set of all the node "holes" node escapes through.


hasEscapedIntoANode

public boolean hasEscapedIntoANode(PANode node)
Checks whether node escapes through a node or not.


addMethodHole

public boolean addMethodHole(PANode node,
                             HMethod hm)
Records the fact that node escaped into a method hole. Returns true if this was a new information.


addMethodHoles

public boolean addMethodHoles(PANode node,
                              Set mholes)
Records the fact that node escaped into a set of method holes. Returns true if this was a new information.


removeMethodHole

public final void removeMethodHole(PANode node,
                                   HMethod hm)
The dual of addMethodHole


removeMethodHoles

public void removeMethodHoles(Set good_holes)
The methods from the set good_holes are unharmful to the specific application that uses the pointer analysis. So, they can be erased from the set of method holes into which a specific node escapes.


methodHolesSet

public Set methodHolesSet(PANode node)
Returns the set of methods that node escapes into.


getEscapedIntoMH

public Set getEscapedIntoMH()
Returns the set of nodes which escape into a method hole.


hasEscapedIntoAMethod

public boolean hasEscapedIntoAMethod(PANode node)
Checks whether node escapes into a method hole or not.


hasEscaped

public boolean hasEscaped(PANode node)
Checks if node has escaped in some hole, ie if node could be accessed by unanalyzed code.


escapesOnlyInCaller

public boolean escapesOnlyInCaller(PANode node)
Checks whether node escapes at most in the caller. ie it doesn't escape in an unanalyzed method, a thread or a static field.


remove

public void remove(Set set)
Remove all the PANodes that appear in set from this object.


union

public void union(PAEscapeFunc e2)

union

public void union(PAEscapeFunc e2,
                  Set ppgRoots)
Computes the union of this PAEscapeFunc with e2. This function is called in the control flow join points.


insert

public void insert(PAEscapeFunc e2,
                   Relation mu,
                   Set noholes,
                   Set ppgRoots)
Inserts the image of e2 through the mu mapping into this PAEscapeFunc.


specialize

public PAEscapeFunc specialize(Map map)

equals

public boolean equals(Object obj)
Checks the equality of two PAEscapeFunc objects.

Overrides:
equals in class Object

escapedNodes

public Set escapedNodes()
Returns the set of escaped nodes.


select

public PAEscapeFunc select(Set remaining_nodes)
Returns a PAEscapeFunc containing escape information only about the nodes from the set remaining_nodes.


clone

public Object clone()
clone does a deep copy of this object.

Overrides:
clone in class Object

toString

public String toString()
Pretty-print debug function. Two equal PAEscapeFuncs are guaranteed to have the same string representation.

Overrides:
toString in class Object