org.jikesrvm.compilers.opt.ssa
Class HeapVariable<T>

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ssa.HeapVariable<T>

public class HeapVariable<T>
extends Object

An HeapVariable represents a heap variable for heap array SSA form.


Field Summary
private  BitVector definedIn
          a bit vector representing the basic blocks that write to this variable
private  int number
          a unique identifier for this heap variable among all heap variables with this type.
private  T type
          The type of this heap variable.
 
Constructor Summary
HeapVariable(T type, int number, IR ir)
          Create a new Heap variable of a given type, with a given number.
 
Method Summary
 BitVector getDefBlocks()
          Return a bit vector that represents the basic blocks that define this heap variable.
 T getHeapType()
          Return the type representing this heap object.
 int getNumber()
          Return a number that uniquely identifies this heap variable, among all the heap variables with the same type.
 boolean isExceptionHeapType()
          Is the this the exception heap type?
 boolean isExposedOnEntry()
          Is this heap variable exposed on procedure entry?
 void registerDef(BasicBlock b)
          Note that this heap variable is defined in a given basic block.
 String toString()
          Return a String representation of this variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

number

private final int number
a unique identifier for this heap variable among all heap variables with this type.


definedIn

private final BitVector definedIn
a bit vector representing the basic blocks that write to this variable


type

private final T type
The type of this heap variable. Must be either a TypeReference, FieldReference, RVMField or a String

Constructor Detail

HeapVariable

public HeapVariable(T type,
                    int number,
                    IR ir)
Create a new Heap variable of a given type, with a given number.

Parameters:
type - a FieldReference or TypeReference object, naming the type of this heap
number - second part of the name of this heap variable
ir - the governing IR
Method Detail

getNumber

public int getNumber()
Return a number that uniquely identifies this heap variable, among all the heap variables with the same type.

Returns:
the number

getHeapType

public T getHeapType()
Return the type representing this heap object.

Returns:
either a TypeReference, FieldReference, RVMField or String object

isExceptionHeapType

public boolean isExceptionHeapType()
Is the this the exception heap type?

Returns:
true if the heap represents exceptions

getDefBlocks

public BitVector getDefBlocks()
Return a bit vector that represents the basic blocks that define this heap variable.

Returns:
a bit vector that represents the basic blocks that define this heap variable.

registerDef

public void registerDef(BasicBlock b)
Note that this heap variable is defined in a given basic block.

Parameters:
b - a basic block that defines this heap variable

toString

public String toString()
Return a String representation of this variable

Overrides:
toString in class Object
Returns:
a String representation of this variable

isExposedOnEntry

public boolean isExposedOnEntry()
Is this heap variable exposed on procedure entry?

Equivalently: is the number = zero?

Returns:
true or false