harpoon.IR.Quads
Class METHOD

java.lang.Object
  extended by harpoon.IR.Quads.Quad
      extended by harpoon.IR.Quads.METHOD
All Implemented Interfaces:
HCodeElement, CFGraphable<Quad,Edge>, UseDefable, Graph.Node<Quad,Edge>, Serializable, Cloneable, Comparable<Quad>

public class METHOD
extends Quad

Quads.METHOD nodes encode method-specific information: the mapping of method formals to temporary variables, and links to the exception handlers for the method.

The 0-edge out of the Quads.METHOD quad points to the beginning of the executable code for the method. Other edges point to HANDLER quads defining execution handlers. The lowest-numbered HANDLER edge (ie, the 1-edge) is the innermost nested try-block.

Version:
$Id: METHOD.java,v 1.5 2002/04/11 04:00:34 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
HEADER, HANDLER, Serialized Form

Field Summary
protected  Temp[] params
          the temporary variables used for method formals.
 
Fields inherited from class harpoon.IR.Quads.Quad
arrayFactory
 
Constructor Summary
METHOD(QuadFactory qf, HCodeElement source, Temp[] params, int arity)
          Creates a Quads.METHOD quad.
 
Method Summary
<T> T
accept(QuadValueVisitor<T> v)
           
 void accept(QuadVisitor v)
          Accept a visitor.
 int arity()
          Returns the arity of this Quads.METHOD.
 Temp[] def()
          Returns the Temps defined by this Quad.
 boolean isStatic()
          Determines whether the parameters defined in this Quads.METHOD belong to a static method.
 int kind()
          Return an integer enumeration of the kind of this Quad.
 Temp[] params()
          Returns the params array which associates Temps with formal parameters of a method.
 Temp params(int i)
          Returns a specified member of the params array.
 int paramsLength()
          Returns the length of the params array.
 Quad rename(QuadFactory qqf, TempMap defMap, TempMap useMap)
          Create a new Quad identical to the receiver, but with all Temps renamed according to a mapping.
 String toString()
          Returns human-readable representation of this Quad.
 
Methods inherited from class harpoon.IR.Quads.Quad
addEdge, addEdges, addHandlers, clone, clone, clone, compareTo, defC, edgeC, edges, getFactory, getID, getLineNumber, getSourceFile, handlers, hashCode, isPred, isSucc, map, map, map, next, next, nextEdge, nextEdge, nextLength, pred, predC, prev, prev, prevEdge, prevEdge, prevLength, remove, removeHandlers, rename, replace, succ, succC, toLongString, transferHandlers, use, useC
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

params

protected Temp[] params
the temporary variables used for method formals.

Constructor Detail

METHOD

public METHOD(QuadFactory qf,
              HCodeElement source,
              Temp[] params,
              int arity)
Creates a Quads.METHOD quad.

Parameters:
params - the Temps in which the formal parameters of the method will be passed.
arity - the number of outgoing edges from this Quads.METHOD. Always at least one. The number of exception handlers for this method is (arity-1).
Method Detail

arity

public int arity()
Returns the arity of this Quads.METHOD.


params

public Temp[] params()
Returns the params array which associates Temps with formal parameters of a method.


params

public Temp params(int i)
Returns a specified member of the params array.


paramsLength

public int paramsLength()
Returns the length of the params array.


isStatic

public boolean isStatic()
Determines whether the parameters defined in this Quads.METHOD belong to a static method.


def

public Temp[] def()
Returns the Temps defined by this Quad.

Specified by:
def in interface UseDefable
Overrides:
def in class Quad

kind

public int kind()
Description copied from class: Quad
Return an integer enumeration of the kind of this Quad. The enumerated values are defined in QuadKind.

Specified by:
kind in class Quad

rename

public Quad rename(QuadFactory qqf,
                   TempMap defMap,
                   TempMap useMap)
Description copied from class: Quad
Create a new Quad identical to the receiver, but with all Temps renamed according to a mapping. The new Quad will have no edges.

The new Quad will come from the specified QuadFactory.

Specified by:
rename in class Quad

accept

public void accept(QuadVisitor v)
Description copied from class: Quad
Accept a visitor.

Specified by:
accept in class Quad

accept

public <T> T accept(QuadValueVisitor<T> v)
Specified by:
accept in class Quad

toString

public String toString()
Returns human-readable representation of this Quad.

Specified by:
toString in class Quad