harpoon.Analysis.PointerAnalysis
Class MethodHole

java.lang.Object
  |
  +--harpoon.Analysis.PointerAnalysis.MethodHole
All Implemented Interfaces:
Serializable

public class MethodHole
extends Object
implements Serializable

MetHolSet contains the information corresponding to method holes in a Parallel Interaction Graph.

Version:
$Id: MethodHole.java,v 1.3 2002/02/26 22:41:18 cananian Exp $
Author:
Frederic VIVIEN <vivien@lcs.mit.edu>
See Also:
Serialized Form

Constructor Summary
MethodHole(CALL q, Set params, MetaMethod[] maybecalled, Set[] ungroupedparams, PANode ret, PANode exc, int rk, int dpth)
          Creates a MethodHole.
MethodHole(MethodHole ref, Map nodemap)
          Creates a MethodHole which is a copy of the one given as argument, except that the parameters are mapped using the second argument.
MethodHole(MethodHole ref, Set[] ungroupedparams)
          Creates a MethodHole which is a copy of the one given as argument, except for the parameters.
MethodHole(MethodHole ref, Set[] ungroupedparams, int incr, LinkedList ranks)
          Creates a MethodHole which is a copy of the one given as argument, except for the parameters.
 
Method Summary
 Set arguments()
          Return a set containing all the possible parameters, and the formal return and exception nodes.
 MetaMethod[] callees()
          Return the array of callees MetaMethods.
 CALL callsite()
          Return the call site.
 LinkedList callsitehistory()
          Return the history of call sites.
 Object clone()
          Clone a MethodHole.
 boolean contains(HMethod hm)
          Check whether hm is the method called at the unanalyzed call site.
 boolean contains(PANode node)
          Check whether node is a parameter node for the unanalyzed method.
 boolean containsnode(Set nodes)
          Check whether at least one of the nodes is a parameter node for the unanalyzed method.
 int depth()
          Return the depth.
static Relation DuplicateHistory(Relation org_hist, Map conversion)
          Create a new MethodHole history relation from an old one and a MethodHole conversion map.
static Relation DuplicateLocks(Relation org_locks, Map conversion)
          Create a new lock relation from an old one and a MethodHole conversion map.
static Set DuplicateSet(Set org_holes, Map conversion)
          Dummy function which creates a set of MethodHole which is a copy of the old one, while building an identity mapping other these MethodHoles.
static Set DuplicateSet(Set org_holes, Map conversion, Map node_conversion)
          Create a new set of MethodHole from an old one and a PANode conversion table.
 PANode exc()
          Return the exception node.
 int Id()
          Read the value of the field id.
 int IsInAs(MethodHole[] holeArray, int size)
          Check whether the array of MethodHole contains a hole with the same content than the calling hole.
 MethodHole IsInAs(Set holeset)
          Check whether the set of MethodHole contains a hole with the same content than the calling hole and, if this is the case, return such a copy.
 HMethod method()
          Return the HMethod corresponding to the call site.
 Set parameters()
          Return a set containing all the possible parameters.
 int rank()
          Return the rank.
static void reset(Set holes1, Set holes2)
          Reset the global mapup flag, and the id and mapup fields of the MethodHoles given in argument.
 PANode ret()
          Return the result node.
 void setId(int IntID)
          Set the value of the field id.
 boolean strongEquals(MethodHole mh)
          Check the equality of the content of two MethodHole, field by field.
 String toString()
          Pretty-print function for debug purposes.
 Set[] ungroupedparameters()
          Return an array of set of possible actual parameters, each set corresponding to a formal parameter.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodHole

public MethodHole(CALL q,
                  Set params,
                  MetaMethod[] maybecalled,
                  Set[] ungroupedparams,
                  PANode ret,
                  PANode exc,
                  int rk,
                  int dpth)
Creates a MethodHole.


MethodHole

public MethodHole(MethodHole ref,
                  Set[] ungroupedparams)
Creates a MethodHole which is a copy of the one given as argument, except for the parameters.


MethodHole

public MethodHole(MethodHole ref,
                  Map nodemap)
Creates a MethodHole which is a copy of the one given as argument, except that the parameters are mapped using the second argument.


MethodHole

public MethodHole(MethodHole ref,
                  Set[] ungroupedparams,
                  int incr,
                  LinkedList ranks)
Creates a MethodHole which is a copy of the one given as argument, except for the parameters.

Method Detail

parameters

public Set parameters()
Return a set containing all the possible parameters.


arguments

public Set arguments()
Return a set containing all the possible parameters, and the formal return and exception nodes.


ungroupedparameters

public Set[] ungroupedparameters()
Return an array of set of possible actual parameters, each set corresponding to a formal parameter.


callsite

public CALL callsite()
Return the call site.


callsitehistory

public LinkedList callsitehistory()
Return the history of call sites.


rank

public int rank()
Return the rank.


depth

public int depth()
Return the depth.


callees

public MetaMethod[] callees()
Return the array of callees MetaMethods.


method

public HMethod method()
Return the HMethod corresponding to the call site.


ret

public PANode ret()
Return the result node.


exc

public PANode exc()
Return the exception node.


contains

public boolean contains(PANode node)
Check whether node is a parameter node for the unanalyzed method.


containsnode

public boolean containsnode(Set nodes)
Check whether at least one of the nodes is a parameter node for the unanalyzed method.


contains

public boolean contains(HMethod hm)
Check whether hm is the method called at the unanalyzed call site.


setId

public void setId(int IntID)
Set the value of the field id.


Id

public int Id()
Read the value of the field id.


reset

public static void reset(Set holes1,
                         Set holes2)
Reset the global mapup flag, and the id and mapup fields of the MethodHoles given in argument.


toString

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

Overrides:
toString in class Object

clone

public Object clone()
Clone a MethodHole.

Overrides:
clone in class Object

DuplicateSet

public static Set DuplicateSet(Set org_holes,
                               Map conversion)
Dummy function which creates a set of MethodHole which is a copy of the old one, while building an identity mapping other these MethodHoles.


DuplicateSet

public static Set DuplicateSet(Set org_holes,
                               Map conversion,
                               Map node_conversion)
Create a new set of MethodHole from an old one and a PANode conversion table. This method outputs the new set and produces a conversion map from the old MethodHoles to the new ones.


DuplicateHistory

public static Relation DuplicateHistory(Relation org_hist,
                                        Map conversion)
Create a new MethodHole history relation from an old one and a MethodHole conversion map.


DuplicateLocks

public static Relation DuplicateLocks(Relation org_locks,
                                      Map conversion)
Create a new lock relation from an old one and a MethodHole conversion map.


IsInAs

public MethodHole IsInAs(Set holeset)
Check whether the set of MethodHole contains a hole with the same content than the calling hole and, if this is the case, return such a copy.


IsInAs

public int IsInAs(MethodHole[] holeArray,
                  int size)
Check whether the array of MethodHole contains a hole with the same content than the calling hole. In this case, the method returns the index of such a copy.


strongEquals

public boolean strongEquals(MethodHole mh)
Check the equality of the content of two MethodHole, field by field.