harpoon.Analysis.PointerAnalysis
Class ParIntGraph

java.lang.Object
  extended by harpoon.Analysis.PointerAnalysis.ParIntGraph
All Implemented Interfaces:
Serializable, Cloneable

public class ParIntGraph
extends Object
implements Serializable, Cloneable

ParIntGraph models a Parallel Interaction Graph data structure. Most of its fields retain the original name from the paper of Martin and John Whaley.

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

Field Summary
static boolean AGGRESSIVE_SHRINKING
          Activates the aggressive shrinking.
 ActionRepository ar
          Maintains the actions executed by the analysed code and the parallel action relation.
static boolean DEBUG
           
static boolean DEBUG_AS
          Debug for the aggressive shrinking.
static boolean DEBUG2
           
static ParIntGraph EMPTY_GRAPH
          Default (empty) graph.
 EdgeOrdering eo
          Maintains the (conservative) ordering relations between the inside and the outside edges.
 PointsToGraph G
          Points-to escape graph that summarizes the points-to and escape information for the current thread.
static boolean MEASURE_AS
          Display the gains due to AGGRESSIVE_SHRINKING.
 PersistentSet mutated
          Contains mutated fields.
static boolean SHOW_ACTIONS
           
 PAThreadMap tau
          The paralel thread map; it attaches to each thread node nT, an integer from the set {0,1,2} where 2 signifies the possibility that multiple instances of nT execute in parallel with the current thread.
 
Constructor Summary
ParIntGraph()
          Creates a ParIntGraph.
 
Method Summary
 Set allNodes()
          Returns the set of all nodes that appear in this parallel interaction graph.
 Object clone()
          clone produces a copy of the this Parallel Interaction Graph.
 ParIntGraph compressLostNodes(Set lost)
           
 boolean equals(Object obj)
          Check the equality of two ParIntGraphs.
 void forAllNodes(PANodeVisitor visitor)
          Visits all the nodes that appear in this graph.
static boolean identical(ParIntGraph pig1, ParIntGraph pig2)
          Checks whether two ParIntGraphs are equal or not.
 void join(ParIntGraph pig2)
          join combines two ParIntGraphs in \ a control-flow join point.
 ParIntGraph keepTheEssential(PANode[] params, boolean is_main)
          Produces a ParIntGraph containing only the nodes that could be reached from the outside.
 ParIntGraph keepTheEssential(PANode[] params, boolean is_main, Set lost_nodes)
           
 void remove(Set nodes)
          Removes the nodes from nodes from this graph.
 void removeEmptyLoads()
          Simplify this parallel interaction graph by removing the loads that don't escape anywhere (and hence, don't represent any object).
 String toString()
          Pretty-print function for debug purposes.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

DEBUG2

public static boolean DEBUG2

DEBUG_AS

public static boolean DEBUG_AS
Debug for the aggressive shrinking.


MEASURE_AS

public static boolean MEASURE_AS
Display the gains due to AGGRESSIVE_SHRINKING.


AGGRESSIVE_SHRINKING

public static boolean AGGRESSIVE_SHRINKING
Activates the aggressive shrinking. Buggy for the moment ...


EMPTY_GRAPH

public static final ParIntGraph EMPTY_GRAPH
Default (empty) graph. It doesn't contain any information.


G

public PointsToGraph G
Points-to escape graph that summarizes the points-to and escape information for the current thread.


tau

public PAThreadMap tau
The paralel thread map; it attaches to each thread node nT, an integer from the set {0,1,2} where 2 signifies the possibility that multiple instances of nT execute in parallel with the current thread.


ar

public ActionRepository ar
Maintains the actions executed by the analysed code and the parallel action relation. alpha and pi from the original paper have been merged into this single field for efficiency reasons.


eo

public EdgeOrdering eo
Maintains the (conservative) ordering relations between the inside and the outside edges. before(ei,eo) is true if the inside edge ei might be created before the ouside edge eo was read.


mutated

public PersistentSet mutated
Contains mutated fields.


SHOW_ACTIONS

public static boolean SHOW_ACTIONS
Constructor Detail

ParIntGraph

public ParIntGraph()
Creates a ParIntGraph.

Method Detail

join

public void join(ParIntGraph pig2)
join combines two ParIntGraphs in \ a control-flow join point.


equals

public boolean equals(Object obj)
Check the equality of two ParIntGraphs.

Overrides:
equals in class Object

clone

public Object clone()
clone produces a copy of the this Parallel Interaction Graph.

Overrides:
clone in class Object

keepTheEssential

public ParIntGraph keepTheEssential(PANode[] params,
                                    boolean is_main)
Produces a ParIntGraph containing only the nodes that could be reached from the outside. (i.e. via parameters, class nodes, normally or exceptionally returned nodes or the started thread nodes)


keepTheEssential

public ParIntGraph keepTheEssential(PANode[] params,
                                    boolean is_main,
                                    Set lost_nodes)

compressLostNodes

public ParIntGraph compressLostNodes(Set lost)

forAllNodes

public void forAllNodes(PANodeVisitor visitor)
Visits all the nodes that appear in this graph.


allNodes

public Set allNodes()
Returns the set of all nodes that appear in this parallel interaction graph.


remove

public void remove(Set nodes)
Removes the nodes from nodes from this graph.


removeEmptyLoads

public void removeEmptyLoads()
Simplify this parallel interaction graph by removing the loads that don't escape anywhere (and hence, don't represent any object). In addition, the <<n1,f>,n2> ouside (load) edges where n1 is an unescaped node are removed too.


toString

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

Overrides:
toString in class Object

identical

public static boolean identical(ParIntGraph pig1,
                                ParIntGraph pig2)
Checks whether two ParIntGraphs are equal or not. In addition to the equals method, this handles the comparisom of null objects.