harpoon.Analysis.PointerAnalysis
Class PANode

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

public final class PANode
extends Object
implements Serializable

PANode class models a node for the Pointer Analysis algorithm.

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

Field Summary
static int CONST
          Possible type: constant objects (e.g., Strings)
static int EXCEPT
          Possible type: Exception node.
static int INSIDE
          Possible type: Inside node
static int INSIDE2
          Possible type: node returned by java.lang.Object.clone
static int LOAD
          Possible type: Load node
static int LOST
          Possible type: lost objects (i.e., objects reachable from unanalyzed parts of the program).
static int NULL
          Possible type: null pointers.
static int PARAM
          Possible type: Parameter node
static int RETURN
          Possible type: Return node.
static int STATIC
          Possible type: Static node.
 int type
          The type of the node
 
Constructor Summary
PANode()
           
PANode(int type)
          Constructor using the default null value for node_class.
PANode(int type, GenType[] node_class)
          Creates a PANode of type type.
 
Method Summary
 PANode csSpecialize(CALL call_site)
          Returns the specialized node of this node for call_site.
 String details()
          Returns a detailed description of this node for debug purposes.
 Set getAllCSSpecializations()
          Returns the set of nodes that were obtained by specializing this one function of some call sites.
 Set getAllCSSpecs()
          Returns all the call site specializations of this node.
 Set getAllTSpecs()
          Returns all the thread specializations of this node.
 PANode getBarVersion()
          Returns the bar version of this node.
 PANode getBottom()
          Returns the bottom field: the last specialization.
 int getCallChainDepth()
          Returns the specialization depth of this node.
 PANode getCSParent()
          Returns the parent of this node, on the call site specialization brach.
 PANode getGenuine()
           
 GenType[] getPossibleClasses()
          Returns an array of GenTypes describing all the possible types (ie HClasses) this node can have.
 PANode getRoot()
          Returns the root of this node.
 PANode getTSParent()
          Returns the parent of this node, on the thread specialization branch.
 PANode getWTSpec()
          Returns the weak thread specialization of this node.
 boolean inside()
          Checks if this node is an inside one.
 boolean isBottom()
          Tests whether this is the bottom of some specialization chain, i.e.
 boolean isCSSpec()
          Checks whether this node is a call site specialization of another node.
 boolean isGenuine()
          Checks whether this node is a genuine one.
 boolean isPrimitive()
          Checks whether this node is an unspecialized one (a root node in the chain of specialization).
 boolean isSpecialized()
          Checks whether this node is a specialization of some other node.
 boolean isTSpec()
          Checks whether this node is a thread specialization of some other node.
 String toString()
          Pretty-print function for debug purposes
 PANode tSpecialize(MetaMethod run)
          Returns the specialized node of this node for the thread body (ie the run() method) run.
 int type()
          Returns the type of the node.
 PANode wtSpecialize()
          Returns the thread specialization of this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSIDE

public static final int INSIDE
Possible type: Inside node

See Also:
Constant Field Values

LOAD

public static final int LOAD
Possible type: Load node

See Also:
Constant Field Values

PARAM

public static final int PARAM
Possible type: Parameter node

See Also:
Constant Field Values

RETURN

public static final int RETURN
Possible type: Return node. Nodes of this type are used to represent the objects normally (i.e. not through a throw) returned by an unanalyzed method.

See Also:
Constant Field Values

EXCEPT

public static final int EXCEPT
Possible type: Exception node. Nodes of this type are used to represent the objects returned as exceptions from an unalyzed method.

See Also:
Constant Field Values

STATIC

public static final int STATIC
Possible type: Static node. The class nodes from the original algorithm have been renamed STATIC now (just for confusion :-))

See Also:
Constant Field Values

NULL

public static final int NULL
Possible type: null pointers.

See Also:
Constant Field Values

CONST

public static final int CONST
Possible type: constant objects (e.g., Strings)

See Also:
Constant Field Values

LOST

public static final int LOST
Possible type: lost objects (i.e., objects reachable from unanalyzed parts of the program).

See Also:
Constant Field Values

INSIDE2

public static final int INSIDE2
Possible type: node returned by java.lang.Object.clone

See Also:
Constant Field Values

type

public int type
The type of the node

Constructor Detail

PANode

public PANode(int type,
              GenType[] node_class)
Creates a PANode of type type. type must be one of PANode.INSIDE, PANode.LOAD etc.


PANode

public PANode(int type)
Constructor using the default null value for node_class.


PANode

public PANode()
Method Detail

getBarVersion

public PANode getBarVersion()
Returns the bar version of this node. Each node has two versions: To avoid fake mappings, in the caller/callee and the starter/startee interaction, we work with the "bar" version of the callee/startee parallel interaction graph. After we determine the mapping, we go back to the "genuine" nodes.
This versions are different for (and only for) LOAD nodes. This makes sense because any non-trivial mappings are for LOAD nodes.


getGenuine

public PANode getGenuine()

isGenuine

public boolean isGenuine()
Checks whether this node is a genuine one.


type

public final int type()
Returns the type of the node.


inside

public final boolean inside()
Checks if this node is an inside one.


getPossibleClasses

public final GenType[] getPossibleClasses()
Returns an array of GenTypes describing all the possible types (ie HClasses) this node can have. If we were unable to determine these types, null is returned instead; it stands for any type.


csSpecialize

public final PANode csSpecialize(CALL call_site)
Returns the specialized node of this node for call_site. This method is guarranteed to return the same node if it's called on the same node, with the same argument.
This method makes sense iff PointerAnalysis.CALL_CONTEXT_SENSITIVE is on.


getAllCSSpecs

public final Set getAllCSSpecs()
Returns all the call site specializations of this node. It returns a set of Map.Entrys, each element consisting of a mapping from a CALL quad (the call site) to the specialized node.
This method makes sense iff PointerAnalysis.CALL_CONTEXT_SENSITIVE is on.


isCSSpec

public final boolean isCSSpec()
Checks whether this node is a call site specialization of another node.


getCSParent

public final PANode getCSParent()
Returns the parent of this node, on the call site specialization brach.


getBottom

public final PANode getBottom()
Returns the bottom field: the last specialization.


getCallChainDepth

public final int getCallChainDepth()
Returns the specialization depth of this node.


tSpecialize

public final PANode tSpecialize(MetaMethod run)
Returns the specialized node of this node for the thread body (ie the run() method) run. This method is guarranteed to return the same node if it's called on the same node, with the same argument.
This method makes sense iff PointerAnalysis.THREAD_SENSITIVE is on.


getAllTSpecs

public final Set getAllTSpecs()
Returns all the thread specializations of this node. It returns a set of Map.Entrys, each element consisting of a mapping from a MetaMethod (the body of a thread) to the specialized node.
This method makes sense iff PointerAnalysis.THREAD_SENSITIVE is on.


wtSpecialize

public final PANode wtSpecialize()
Returns the thread specialization of this node.
This method makes sense iff PointerAnalysis.WEAKLY_THREAD_SENSITIVE is on.


getWTSpec

public final PANode getWTSpec()
Returns the weak thread specialization of this node. (returns null if none).
This method makes sense iff PointerAnalysis.WEAKLY_THREAD_SENSITIVE is on.


isTSpec

public final boolean isTSpec()
Checks whether this node is a thread specialization of some other node.


getTSParent

public final PANode getTSParent()
Returns the parent of this node, on the thread specialization branch.


getAllCSSpecializations

public Set getAllCSSpecializations()
Returns the set of nodes that were obtained by specializing this one function of some call sites.


isSpecialized

public final boolean isSpecialized()
Checks whether this node is a specialization of some other node. Relevant only if the PointerAnalysis.CALL_CONTEXT_SENSITIVE flag is on.


isPrimitive

public final boolean isPrimitive()
Checks whether this node is an unspecialized one (a root node in the chain of specialization). Relevant only if the PointerAnalysis.CALL_CONTEXT_SENSITIVE flag is on.


getRoot

public final PANode getRoot()
Returns the root of this node. This is the root of the specialization chain which produced this node.


isBottom

public boolean isBottom()
Tests whether this is the bottom of some specialization chain, i.e. call_chain_depth == PointerAnalysis.MAX_SPEC_DEPTH.


toString

public final String toString()
Pretty-print function for debug purposes

Overrides:
toString in class Object

details

public final String details()
Returns a detailed description of this node for debug purposes.