harpoon.Analysis.PointerAnalysis
Class NodeRepository

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

public class NodeRepository
extends Object
implements Serializable

NodeRepository

Version:
$Id: NodeRepository.java,v 1.10 2004/02/08 03:20:02 cananian Exp $
Author:
Alexandru SALCIANU <salcianu@retezat.lcs.mit.edu>
See Also:
Serialized Form

Field Summary
static PANode LOST_SUMMARY
           
static PANode NULL_NODE
           
 
Constructor Summary
NodeRepository(Linker linker)
          Creates a NodeRepository.
 
Method Summary
 void addParamNodes(MetaMethod mmethod, int param_number)
          Creates all the parameter nodes associated with mmethod.
static HClass getAllocatedType(HCodeElement hce)
           
 PANode[] getAllParams(MetaMethod mmethod)
          Returns all the parameter nodes associated with the formal parameters of mmethod.
 PANode getCodeNode(HCodeElement hce, int type)
           
 PANode getCodeNode(HCodeElement hce, int type, boolean make)
           
 PANode getCodeNode(HCodeElement hce, int type, GenType[] gts)
          Returns a code node: a node associated with the instruction hce: a load node (associated with a GET quad), a return node (associated with a CALL) or an inside node (thread or not) associated with a NEW).
 PANode getCodeNode(HCodeElement hce, int type, GenType[] gts, boolean make)
          Returns a code node: a node associated with an instruction.
 PANode getConstNode(Object value)
          Returns the node that models the constant object value.
 HClass getInsideNodeType(PANode node)
          Gets the type of an inside node.
 PANode getLoadNodeSpecial(HCodeElement hce, String f)
          Special function for load instructions that read multiple fields in the same time (the motivating example is that of "clone()") For such an instruction, a load node is generated for each field that is read (f in the parameter list).
 PANode getParamNode(MetaMethod mmethod, int count)
          Returns the parameter node associated with the countth formal parameter of mmethod.
 PANode getStaticNode(String class_name)
          Returns the static node associated with the class class_name.
 HCodeElement node2Code(PANode node)
          Returns the instruction that created node.
 void print_stats()
          Prints some statistics.
 void show_specializations()
          Nice looking info for debug purposes.
 String toString()
          Pretty-printer for debug purposes.
 void updateNode2Code(PANode node, HCodeElement hce)
          Modify the node2code mapping such that now node is associated with hce.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_NODE

public static final PANode NULL_NODE

LOST_SUMMARY

public static final PANode LOST_SUMMARY
Constructor Detail

NodeRepository

public NodeRepository(Linker linker)
Creates a NodeRepository.

Method Detail

getConstNode

public final PANode getConstNode(Object value)
Returns the node that models the constant object value. Currently, all constant objects are modelled by a single node.


getStaticNode

public final PANode getStaticNode(String class_name)
Returns the static node associated with the class class_name. The node is automatically created if it doesn't exist yet. class_name MUST be the full (and hence unique) name of the class


addParamNodes

public final void addParamNodes(MetaMethod mmethod,
                                int param_number)
Creates all the parameter nodes associated with mmethod. param_number must contain the number of formal parameters of the meta-method.


getParamNode

public final PANode getParamNode(MetaMethod mmethod,
                                 int count)
Returns the parameter node associated with the countth formal parameter of mmethod. The parameter nodes for mmethod should be created in advance, using addParamNodes.


getAllParams

public final PANode[] getAllParams(MetaMethod mmethod)
Returns all the parameter nodes associated with the formal parameters of mmethod. The parameter nodes for mmethod should be created in advance, using addParamNodes.


getLoadNodeSpecial

public final PANode getLoadNodeSpecial(HCodeElement hce,
                                       String f)
Special function for load instructions that read multiple fields in the same time (the motivating example is that of "clone()") For such an instruction, a load node is generated for each field that is read (f in the parameter list).


getCodeNode

public final PANode getCodeNode(HCodeElement hce,
                                int type)

getCodeNode

public final PANode getCodeNode(HCodeElement hce,
                                int type,
                                boolean make)

getCodeNode

public final PANode getCodeNode(HCodeElement hce,
                                int type,
                                GenType[] gts)
Returns a code node: a node associated with the instruction hce: a load node (associated with a GET quad), a return node (associated with a CALL) or an inside node (thread or not) associated with a NEW). The node is automatically created if it doesn't exist yet. The type of the node should be passed in the type argument.


getCodeNode

public final PANode getCodeNode(HCodeElement hce,
                                int type,
                                GenType[] gts,
                                boolean make)
Returns a code node: a node associated with an instruction. The boolean parameter make controls the generation of such a node in case it doesn't exist yet.


node2Code

public final HCodeElement node2Code(PANode node)
Returns the instruction that created node.


getInsideNodeType

public final HClass getInsideNodeType(PANode node)
Gets the type of an inside node.


getAllocatedType

public static HClass getAllocatedType(HCodeElement hce)

updateNode2Code

public final void updateNode2Code(PANode node,
                                  HCodeElement hce)
Modify the node2code mapping such that now node is associated with hce.


toString

public final String toString()
Pretty-printer for debug purposes.

Overrides:
toString in class Object

print_stats

public void print_stats()
Prints some statistics.


show_specializations

public void show_specializations()
Nice looking info for debug purposes.