org.jikesrvm.osr
Class VariableElement

java.lang.Object
  extended by org.jikesrvm.osr.VariableElement
All Implemented Interfaces:
ClassLoaderConstants, OSRConstants, SizeConstants

public class VariableElement
extends Object
implements OSRConstants

An instance of VariableElement represents a byte code variable (local or stack element). It is used to generate prologue to recover the runtime state. It refers to VM architecture.


Field Summary
private  boolean kind
          the kind of this element : LOCAL or STACK
private  char num
          the number of element, e.g., with kind we can know it is L0 or S1.
private  Object ref
          for reference type value
private  byte tcode
          type code, can only be INT, FLOAT, LONG, DOUBLE, RET_ADDR, WORD or REF
private  long value
          The value of this element.
 
Fields inherited from interface org.jikesrvm.osr.OSRConstants
ACONST, BCI_MASK, BCI_SHIFT, CLEANREFS, DOUBLE, FLOAT, GETREFAT, HIGH_64BIT, ICONST, IEI_MASK, IEI_SHIFT, INT, INVALID_BCI, INVALID_IEI, KIND_MASK, KIND_SHIFT, LCONST, LOCAL, LONG, NEXT_BIT, NO_OSR_ENTRY, NUM_MASK, NUM_SHIFT, OFFSET_MASK, OFFSET_SHIFT, OSRI_MASK, OSRI_SHIFT, PHYREG, PSEUDO_CheckCast, PSEUDO_InvokeCompiledMethod, PSEUDO_InvokeStatic, PSEUDO_LoadDoubleConst, PSEUDO_LoadFloatConst, PSEUDO_LoadIntConst, PSEUDO_LoadLongConst, PSEUDO_LoadRetAddrConst, PSEUDO_LoadWordConst, PSEUDO_ParamInitEnd, REF, RET_ADDR, ReturnAddressTypeCode, SPILL, STACK, TCODE_MASK, TCODE_SHIFT, VTYPE_MASK, VTYPE_SHIFT, WORD, WordTypeCode
 
Fields inherited from interface org.jikesrvm.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
Fields inherited from interface org.jikesrvm.classloader.ClassLoaderConstants
ACC_ABSTRACT, ACC_ANNOTATION, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VOLATILE, APPLICABLE_TO_CLASSES, APPLICABLE_TO_FIELDS, APPLICABLE_TO_METHODS, ArrayTypeCode, BooleanTypeCode, BRIDGE, ByteTypeCode, CharTypeCode, CLASS_INITIALIZED, CLASS_INITIALIZER_FAILED, CLASS_INITIALIZING, CLASS_INSTANTIATED, CLASS_LOADED, CLASS_RESOLVED, CLASS_VACANT, ClassTypeCode, CP_CLASS, CP_DOUBLE, CP_FLOAT, CP_INT, CP_LONG, CP_MEMBER, CP_STRING, CP_UTF, DoubleTypeCode, FloatTypeCode, IntTypeCode, LongTypeCode, ShortTypeCode, TAG_DOUBLE, TAG_FIELDREF, TAG_FLOAT, TAG_INT, TAG_INTERFACE_METHODREF, TAG_LONG, TAG_MEMBERNAME_AND_DESCRIPTOR, TAG_METHODREF, TAG_STRING, TAG_TYPEREF, TAG_UNUSED, TAG_UTF, VARARGS, VoidTypeCode
 
Constructor Summary
VariableElement(boolean what_kind, int which_num, byte type, int ibits)
          Constructor for 32-bit value
VariableElement(boolean what_kind, int which_num, byte type, long lbits)
          Constructor for 64-bit value
VariableElement(boolean what_kind, int which_num, byte type, Object ref)
          Constructor for reference type
VariableElement(boolean what_kind, int which_num, byte type, Word word)
          Constructor for word type
 
Method Summary
(package private)  int getIntBits()
           
(package private)  long getLongBits()
           
(package private)  char getNumber()
           
(package private)  Object getObject()
           
(package private)  byte getTypeCode()
          get type code
(package private)  Word getWord()
           
(package private) static boolean isIBitsType(int tcode)
           
(package private) static boolean isLBitsType(int tcode)
           
(package private)  boolean isLocal()
          local or stack element
(package private)  boolean isRefType()
          is reference type
(package private) static boolean isRefType(int tcode)
           
(package private)  boolean isWordType()
          is word type
(package private) static boolean isWordType(int tcode)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

private final boolean kind
the kind of this element : LOCAL or STACK


num

private final char num
the number of element, e.g., with kind we can know it is L0 or S1.


tcode

private final byte tcode
type code, can only be INT, FLOAT, LONG, DOUBLE, RET_ADDR, WORD or REF


value

private final long value
The value of this element. For type INT, FLOAT, RET_ADDR and WORD (32-bit), the lower 32 bits are valid. For type LONG and DOUBLE and WORD(64-bit), 64 bits are valid. For REF type, next field 'ref' is valid. For FLOAT, and DOUBLE, use Magic.intBitsAsFloat or Magic.longBitsAsDouble to convert bits to floating-point value.


ref

private final Object ref
for reference type value

Constructor Detail

VariableElement

public VariableElement(boolean what_kind,
                       int which_num,
                       byte type,
                       int ibits)
Constructor for 32-bit value


VariableElement

public VariableElement(boolean what_kind,
                       int which_num,
                       byte type,
                       long lbits)
Constructor for 64-bit value


VariableElement

public VariableElement(boolean what_kind,
                       int which_num,
                       byte type,
                       Object ref)
Constructor for reference type


VariableElement

public VariableElement(boolean what_kind,
                       int which_num,
                       byte type,
                       Word word)
Constructor for word type

Method Detail

isIBitsType

static boolean isIBitsType(int tcode)

isLBitsType

static boolean isLBitsType(int tcode)

isRefType

static boolean isRefType(int tcode)

isWordType

static boolean isWordType(int tcode)

isLocal

boolean isLocal()
local or stack element


getTypeCode

byte getTypeCode()
get type code


getNumber

char getNumber()

isRefType

boolean isRefType()
is reference type


getObject

Object getObject()

isWordType

boolean isWordType()
is word type


getWord

Word getWord()

getIntBits

int getIntBits()

getLongBits

long getLongBits()

toString

public String toString()
Overrides:
toString in class Object