harpoon.IR.Quads
Class ARRAYINIT

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

public class ARRAYINIT
extends Quad

ARRAYINIT represents an array initialization operation.

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

Field Summary
protected  Temp objectref
          The array reference to initialize.
protected  int offset
          The starting index for the initializers.
protected  HClass type
          The component type.
protected  Object[] value
          The array initializers.
 
Fields inherited from class harpoon.IR.Quads.Quad
arrayFactory
 
Constructor Summary
ARRAYINIT(QuadFactory qf, HCodeElement source, Temp objectref, int offset, HClass type, Object[] value)
          Creates a ARRAYINIT representing an array initializer.
 
Method Summary
<T> T
accept(QuadValueVisitor<T> v)
           
 void accept(QuadVisitor v)
          Accept a visitor.
 int kind()
          Return an integer enumeration of the kind of this Quad.
 Temp objectref()
          Returns the Temp referencing the array to be initialized.
 int offset()
          Returns the starting offset of the initializers.
 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.
 HClass type()
          Returns the component type of the array to be initialized.
 Temp[] use()
          Returns the Temp used by this Quad.
 Object[] value()
          Returns the array initializers.
 
Methods inherited from class harpoon.IR.Quads.Quad
addEdge, addEdges, addHandlers, clone, clone, clone, compareTo, def, 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, useC
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

objectref

protected Temp objectref
The array reference to initialize.


type

protected HClass type
The component type.


offset

protected int offset
The starting index for the initializers.


value

protected Object[] value
The array initializers. Elements must be instances of the type wrapper.

Constructor Detail

ARRAYINIT

public ARRAYINIT(QuadFactory qf,
                 HCodeElement source,
                 Temp objectref,
                 int offset,
                 HClass type,
                 Object[] value)
Creates a ARRAYINIT representing an array initializer. The values in the value array are stored in sequential elements of the array referenced by objectref starting at element 0.

Parameters:
objectref - the array to initialize.
offset - the starting index for the initializers.
type - the component type of the array.
value - the values to store in the array.
Method Detail

objectref

public Temp objectref()
Returns the Temp referencing the array to be initialized.


type

public HClass type()
Returns the component type of the array to be initialized.


offset

public int offset()
Returns the starting offset of the initializers.


value

public Object[] value()
Returns the array initializers.


use

public Temp[] use()
Returns the Temp used by this Quad.

Specified by:
use in interface UseDefable
Overrides:
use in class Quad
Returns:
the objectref field.

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