org.jikesrvm.classloader
Class RVMType

java.lang.Object
  extended by org.jikesrvm.classloader.AnnotatedElement
      extended by org.jikesrvm.classloader.RVMType
All Implemented Interfaces:
AnnotatedElement, ClassLoaderConstants, Constants, HeapLayoutConstants, ThinLockConstants, TIBLayoutConstants, SizeConstants
Direct Known Subclasses:
Primitive, RVMArray, RVMClass, UnboxedType

public abstract class RVMType
extends AnnotatedElement
implements ClassLoaderConstants, SizeConstants, Constants

A description of a java type.

This class is the base of the java type system. To the three kinds of java objects (class-instances, array-instances, primitive-instances) there are three corresponding subclasses of RVMType: RVMClass, RVMArray, Primitive.

A RVMClass is constructed in four phases:

RVMArray's are constructed in a similar fashion. Primitive's are constructed ab initio. Their "resolution", "instantiation", and "initialization" phases are no-ops.


Field Summary
static RVMArray AddressArrayType
           
static UnboxedType AddressType
           
static Primitive BooleanType
           
static Primitive ByteType
           
private  RVMArray cachedElementType
          cached RVMArray that corresponds to arrays of this type.
static Primitive CharType
           
private  Class<?> classForType
          instance of java.lang.Class corresponding to this type
static RVMArray CodeArrayType
           
static UnboxedType CodeType
           
protected  int depth
          Number of superclasses to Object.
protected  int dimension
          Number of [ in descriptor for arrays; -1 for primitives; 0 for classes.
protected  int[] doesImplement
          The interface implementation array for this type.
static Primitive DoubleType
           
protected static RVMClass[] emptyVMClass
          Canonical representation of no VM classes
protected static RVMField[] emptyVMField
          Canonical representation of no fields
protected static RVMMethod[] emptyVMMethod
          Canonical representation of no methods
static RVMArray ExtentArrayType
           
static UnboxedType ExtentType
           
static Primitive FloatType
           
static RVMClass FunctionTableType
           
protected  int id
          Type id -- used to index into typechecking datastructures
static RVMClass IMTType
           
static Primitive IntType
           
static RVMClass ITableArrayType
           
static RVMClass ITableType
           
static RVMClass JavaIoSerializableType
           
static RVMClass JavaLangClassType
           
static RVMClass JavaLangCloneableType
           
static RVMArray JavaLangObjectArrayType
           
static RVMClass JavaLangObjectType
           
static RVMField JavaLangRefReferenceReferenceField
           
static RVMClass JavaLangRefReferenceType
           
static RVMClass JavaLangStringType
           
static RVMClass JavaLangThrowableType
           
static RVMClass LinkageTripletTableType
           
private static int LOG_ROW_SIZE
          2^LOG_ROW_SIZE is the number of elements per row
static Primitive LongType
           
static RVMClass MagicType
           
private  int mmAllocator
          The memory manager's allocator id for this type.
private static int nextId
          Next space in the the type array
protected static int[] NOREFS_OFFSET_ARRAY
          A zero-length array, used as GC metadata for primitive arrays.
static RVMArray ObjectReferenceArrayType
           
static RVMClass ObjectReferenceType
           
static RVMArray OffsetArrayType
           
static UnboxedType OffsetType
           
static int[] REFARRAY_OFFSET_ARRAY
          Alias null for clarity
protected  int[] referenceOffsets
          GC metadata for this type.
private static int ROW_MASK
          Mask to ascertain row from id number
static Primitive ShortType
           
protected  short[] superclassIds
          The superclass ids for this type.
protected  int tibOffset
          index of JTOC slot that has type information block for this RVMType
static RVMClass TIBType
           
protected  TypeReference typeRef
          Canonical type reference for this RVMType instance
private static RVMType[][] types
          All types
static Primitive VoidType
           
static RVMArray WordArrayType
           
static UnboxedType WordType
           
 
Fields inherited from class org.jikesrvm.classloader.AnnotatedElement
declaredAnnotationDatas
 
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
 
Fields inherited from interface org.jikesrvm.Constants
NOT_REACHED, REFLECTION_FPRS_BITS, REFLECTION_FPRS_MASK, REFLECTION_GPRS_BITS, REFLECTION_GPRS_MASK
 
Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK
 
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.objectmodel.TIBLayoutConstants
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX
 
Fields inherited from interface org.jikesrvm.HeapLayoutConstants
BAD_MAP_COMPRESSION, BOOT_IMAGE_CODE_END, BOOT_IMAGE_CODE_SIZE, BOOT_IMAGE_CODE_START, BOOT_IMAGE_DATA_END, BOOT_IMAGE_DATA_SIZE, BOOT_IMAGE_DATA_START, BOOT_IMAGE_END, BOOT_IMAGE_RMAP_END, BOOT_IMAGE_RMAP_START, MAX_BOOT_IMAGE_RMAP_SIZE, MAXIMUM_MAPPABLE
 
Constructor Summary
protected RVMType(TypeReference typeRef, Class<?> classForType, int dimension, RVMAnnotation[] annotations)
          Create an instance of a RVMType
protected RVMType(TypeReference typeRef, int dimension, RVMAnnotation[] annotations)
          Create an instance of a RVMType
 
Method Summary
abstract  void allBootImageTypesResolved()
          This method is only called by the bootimage writer.
 RVMArray asArray()
           
 RVMClass asClass()
           
 Primitive asPrimitive()
           
 UnboxedType asUnboxedType()
           
protected static Class<?> createClassForType(RVMType type, TypeReference typeRef)
          Utility to create a java.lang.Class for the given type using the given type reference
 RVMMethod findVirtualMethod(Atom memberName, Atom memberDescriptor)
          Find specified virtual method description.
 RVMArray getArrayTypeForElementType()
          Get array type corresponding to "this" array element type.
 Class<?> getClassForType()
          Instance of java.lang.Class corresponding to this type.
 ClassLoader getClassLoader()
          Get the class loader for this type
 Atom getDescriptor()
          Descriptor for this type.
 boolean getDesiredAssertionStatus()
          Should assertions be enabled on this type?
abstract  int getDimensionality()
          Number of [ in descriptor for arrays; -1 for primitives; 0 for classes
 int[] getDoesImplement()
          get doesImplement vector (@see DynamicTypeCheck)
 int getId()
          Get the numeric identifier for this type
abstract  RVMField[] getInstanceFields()
          Non-static fields of this class/array type (composed with supertypes, if any).
abstract  int getMemoryBytes()
          Number of bytes in memory required to represent the type
 int getMMAllocator()
          This returns the allocator id as supplied by the memory manager.
 int[] getReferenceOffsets()
          Offsets of reference-containing instance fields of this class type.
 Class<?> getResolvedClassForType()
          Instance of java.lang.Class corresponding to this type.
abstract  int getStackWords()
          Space required when this type is stored on the stack (or as a field), in words.
abstract  RVMField[] getStaticFields()
          Static fields of this class/array type.
abstract  RVMMethod[] getStaticMethods()
          Statically dispatched methods of this class/array type.
 short[] getSuperclassIds()
          get superclass id vector (@see DynamicTypeCheck)
abstract  Offset getThinLockOffset()
          Get the offset in instances of this type assigned to the thin lock word.
 RVMMethod getTIBMethodAtSlot(int slot)
          Return the method at the given TIB slot
 Offset getTibOffset()
          Get offset of tib slot from start of jtoc, in bytes.
static RVMType getType(int id)
          Get the type for the given id
abstract  int getTypeDepth()
          get number of superclasses to Object 0 java.lang.Object, Primitive, and Classes that are interfaces 1 for RVMArrays and classes that extend Object directly
abstract  TIB getTypeInformationBlock()
          Runtime type information for this class/array type.
 TypeReference getTypeRef()
          Canonical type reference for this type.
abstract  RVMMethod[] getVirtualMethods()
          Virtually dispatched methods of this class/array type (composed with supertypes, if any).
abstract  boolean hasFinalizer()
          Does this type override java.lang.Object.finalize()?
 int hashCode()
          Define hashCode(), to allow use of consistent hash codes during bootImage writing and run-time
abstract  void initialize()
          Cause initialization to take place.
abstract  void instantiate()
          Cause instantiation to take place.
abstract  boolean isAcyclicReference()
          Reference Count GC: Is a reference of this type contained in another object inherently acyclic (without cycles)?
abstract  boolean isArrayType()
          Is this an instance of RVMArray?
 boolean isAssignableFrom(RVMType type)
           
 boolean isBooleanType()
           
 boolean isByteType()
           
 boolean isCharType()
           
abstract  boolean isClassType()
          Is this is an instance of RVMClass?
 boolean isDoubleType()
           
 boolean isFloatType()
           
abstract  boolean isInBootImage()
          Is this class part of the virtual machine's boot image?
abstract  boolean isInitialized()
          Initialization status.
abstract  boolean isInstantiated()
          Instantiation status.
 boolean isIntLikeType()
           
 boolean isIntType()
           
 boolean isJavaLangObjectType()
           
 boolean isJavaLangStringType()
           
 boolean isJavaLangThrowableType()
           
 boolean isLongType()
           
 boolean isNonMoving()
          Is this field a type that must never move?
abstract  boolean isPrimitiveType()
          Is this a primitive type?
abstract  boolean isReferenceType()
          Is this a reference type?
abstract  boolean isResolved()
          Resolution status.
 boolean isShortType()
           
abstract  boolean isUnboxedType()
          Is this an unboxed type?
 boolean isVoidType()
           
abstract  void markAsBootImageClass()
          Only intended to be used by the BootImageWriter
private static int nextId(RVMType it)
          Allocate entry in types array and add it (NB resize array if it's not long enough)
static int numTypes()
          How many types have been created?
abstract  void resolve()
          Cause resolution to take place.
 void setMMAllocator(int allocator)
          Record the allocator information the memory manager holds about this type.
 void setSpecializedMethod(int id, ArchitectureSpecific.CodeArray code)
          Set the specialized method for a class or array.
 
Methods inherited from class org.jikesrvm.classloader.AnnotatedElement
getAnnotation, getAnnotations, getAnnotationsInternal, getDeclaredAnnotations, getDeclaredAnnotationsInternal, hasAnnotations, hasBaselineNoRegistersAnnotation, hasBaselineSaveLSRegistersAnnotation, hasInlineAnnotation, hasInterruptibleAnnotation, hasLogicallyUninterruptibleAnnotation, hasNoBoundsCheckAnnotation, hasNoCheckStoreAnnotation, hasNoEscapesAnnotation, hasNoInlineAnnotation, hasNonMovingAllocationAnnotation, hasNonMovingAnnotation, hasNoNullCheckAnnotation, hasNoOptCompileAnnotation, hasPreemptibleAnnotation, hasPureAnnotation, hasRuntimeFinalAnnotation, hasRuntimePureAnnotation, hasUninterruptibleAnnotation, hasUninterruptibleNoWarnAnnotation, hasUnpreemptibleAnnotation, hasUnpreemptibleNoWarnAnnotation, hasUntracedAnnotation, isAnnotationDeclared, isAnnotationPresent, readAnnotations, toAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOREFS_OFFSET_ARRAY

protected static final int[] NOREFS_OFFSET_ARRAY
A zero-length array, used as GC metadata for primitive arrays.


REFARRAY_OFFSET_ARRAY

public static final int[] REFARRAY_OFFSET_ARRAY
Alias null for clarity


nextId

private static int nextId
Next space in the the type array


LOG_ROW_SIZE

private static final int LOG_ROW_SIZE
2^LOG_ROW_SIZE is the number of elements per row

See Also:
Constant Field Values

ROW_MASK

private static final int ROW_MASK
Mask to ascertain row from id number

See Also:
Constant Field Values

types

private static RVMType[][] types
All types


emptyVMField

protected static final RVMField[] emptyVMField
Canonical representation of no fields


emptyVMMethod

protected static final RVMMethod[] emptyVMMethod
Canonical representation of no methods


emptyVMClass

protected static final RVMClass[] emptyVMClass
Canonical representation of no VM classes


VoidType

public static final Primitive VoidType

BooleanType

public static final Primitive BooleanType

ByteType

public static final Primitive ByteType

ShortType

public static final Primitive ShortType

IntType

public static final Primitive IntType

LongType

public static final Primitive LongType

FloatType

public static final Primitive FloatType

DoubleType

public static final Primitive DoubleType

CharType

public static final Primitive CharType

JavaLangObjectType

public static final RVMClass JavaLangObjectType

JavaLangObjectArrayType

public static final RVMArray JavaLangObjectArrayType

JavaLangClassType

public static final RVMClass JavaLangClassType

JavaLangThrowableType

public static final RVMClass JavaLangThrowableType

JavaLangStringType

public static final RVMClass JavaLangStringType

JavaLangCloneableType

public static final RVMClass JavaLangCloneableType

JavaIoSerializableType

public static final RVMClass JavaIoSerializableType

JavaLangRefReferenceType

public static final RVMClass JavaLangRefReferenceType

JavaLangRefReferenceReferenceField

public static final RVMField JavaLangRefReferenceReferenceField

MagicType

public static final RVMClass MagicType

WordType

public static final UnboxedType WordType

WordArrayType

public static final RVMArray WordArrayType

AddressType

public static final UnboxedType AddressType

AddressArrayType

public static final RVMArray AddressArrayType

ObjectReferenceType

public static final RVMClass ObjectReferenceType

ObjectReferenceArrayType

public static final RVMArray ObjectReferenceArrayType

OffsetType

public static final UnboxedType OffsetType

OffsetArrayType

public static final RVMArray OffsetArrayType

ExtentType

public static final UnboxedType ExtentType

ExtentArrayType

public static final RVMArray ExtentArrayType

CodeType

public static final UnboxedType CodeType

CodeArrayType

public static final RVMArray CodeArrayType

TIBType

public static final RVMClass TIBType

ITableType

public static final RVMClass ITableType

ITableArrayType

public static final RVMClass ITableArrayType

IMTType

public static final RVMClass IMTType

FunctionTableType

public static final RVMClass FunctionTableType

LinkageTripletTableType

public static final RVMClass LinkageTripletTableType

typeRef

protected final TypeReference typeRef
Canonical type reference for this RVMType instance


id

protected final int id
Type id -- used to index into typechecking datastructures


tibOffset

protected final int tibOffset
index of JTOC slot that has type information block for this RVMType


classForType

private final Class<?> classForType
instance of java.lang.Class corresponding to this type


dimension

protected final int dimension
Number of [ in descriptor for arrays; -1 for primitives; 0 for classes. NB this field must appear in all Types for fast type checks (See DynamicTypeCheckExpansion).


depth

protected int depth
Number of superclasses to Object. Known immediately for primitives and arrays, but only after resolving for classes. NB this field must appear in all Types for fast object array store checks (See DynamicTypeCheckExpansion).


cachedElementType

private RVMArray cachedElementType
cached RVMArray that corresponds to arrays of this type. (null ->> not created yet).


superclassIds

protected short[] superclassIds
The superclass ids for this type.


doesImplement

protected int[] doesImplement
The interface implementation array for this type.


mmAllocator

private int mmAllocator
The memory manager's allocator id for this type.


referenceOffsets

protected int[] referenceOffsets
GC metadata for this type. In a primitive array this field points to a zero-length array. In a reference array this field is null. In a class with pointers, it contains the offsets of reference-containing instance fields

Constructor Detail

RVMType

protected RVMType(TypeReference typeRef,
                  Class<?> classForType,
                  int dimension,
                  RVMAnnotation[] annotations)
Create an instance of a RVMType

Parameters:
typeRef - The canonical type reference for this type.
classForType - The java.lang.Class representation
dimension - The dimensionality
annotations - array of runtime visible annotations

RVMType

protected RVMType(TypeReference typeRef,
                  int dimension,
                  RVMAnnotation[] annotations)
Create an instance of a RVMType

Parameters:
typeRef - The canonical type reference for this type.
dimension - The dimensionality
annotations - array of runtime visible annotations
Method Detail

getTypeRef

public final TypeReference getTypeRef()
Canonical type reference for this type.


getId

public final int getId()
Get the numeric identifier for this type


getClassForType

public final Class<?> getClassForType()
Instance of java.lang.Class corresponding to this type. This is commonly used for reflection.


getResolvedClassForType

public final Class<?> getResolvedClassForType()
Instance of java.lang.Class corresponding to this type. This is commonly used for reflection.


getTibOffset

public final Offset getTibOffset()
Get offset of tib slot from start of jtoc, in bytes.


getClassLoader

public final ClassLoader getClassLoader()
Get the class loader for this type


getDesiredAssertionStatus

public boolean getDesiredAssertionStatus()
Should assertions be enabled on this type?

Returns:
false

getDescriptor

public final Atom getDescriptor()
Descriptor for this type.


hashCode

public final int hashCode()
Define hashCode(), to allow use of consistent hash codes during bootImage writing and run-time

Overrides:
hashCode in class Object

getTypeDepth

public abstract int getTypeDepth()
get number of superclasses to Object


isAcyclicReference

public abstract boolean isAcyclicReference()
Reference Count GC: Is a reference of this type contained in another object inherently acyclic (without cycles)?


getDimensionality

public abstract int getDimensionality()
Number of [ in descriptor for arrays; -1 for primitives; 0 for classes


asClass

public final RVMClass asClass()
Returns:
this cast to a RVMClass

asArray

public final RVMArray asArray()
Returns:
this cast to a RVMArray

asPrimitive

public final Primitive asPrimitive()
Returns:
this cast to a Primitive

asUnboxedType

public final UnboxedType asUnboxedType()
Returns:
this cast to a UnboxedType

isVoidType

public final boolean isVoidType()
Returns:
is this type void?

isBooleanType

public final boolean isBooleanType()
Returns:
is this type the primitive boolean?

isByteType

public final boolean isByteType()
Returns:
is this type the primitive byte?

isShortType

public final boolean isShortType()
Returns:
is this type the primitive short?

isIntType

public final boolean isIntType()
Returns:
is this type the primitive int?

isLongType

public final boolean isLongType()
Returns:
is this type the primitive long?

isFloatType

public final boolean isFloatType()
Returns:
is this type the primitive float?

isDoubleType

public final boolean isDoubleType()
Returns:
is this type the primitive double?

isCharType

public final boolean isCharType()
Returns:
is this type the primitive char?

isIntLikeType

public final boolean isIntLikeType()
Returns:
is this type the primitive int like? ie is it held as an int on the JVM stack

isJavaLangObjectType

public final boolean isJavaLangObjectType()
Returns:
is this type the class Object?

isJavaLangThrowableType

public final boolean isJavaLangThrowableType()
Returns:
is this type the class Throwable?

isJavaLangStringType

public final boolean isJavaLangStringType()
Returns:
is this type the class String?

getArrayTypeForElementType

public final RVMArray getArrayTypeForElementType()
Get array type corresponding to "this" array element type.


getSuperclassIds

public final short[] getSuperclassIds()
get superclass id vector (@see DynamicTypeCheck)


getDoesImplement

public final int[] getDoesImplement()
get doesImplement vector (@see DynamicTypeCheck)


nextId

private static int nextId(RVMType it)
Allocate entry in types array and add it (NB resize array if it's not long enough)


numTypes

public static int numTypes()
How many types have been created? Only intended to be used by the bootimage writer!


getType

public static RVMType getType(int id)
Get the type for the given id


createClassForType

protected static Class<?> createClassForType(RVMType type,
                                             TypeReference typeRef)
Utility to create a java.lang.Class for the given type using the given type reference


findVirtualMethod

public final RVMMethod findVirtualMethod(Atom memberName,
                                         Atom memberDescriptor)
Find specified virtual method description.

Parameters:
memberName - method name - something like "foo"
memberDescriptor - method descriptor - something like "I" or "()I"
Returns:
method description (null --> not found)

getTIBMethodAtSlot

public final RVMMethod getTIBMethodAtSlot(int slot)
Return the method at the given TIB slot

Parameters:
slot - the slot that contains the method
Returns:
the method at that slot

isResolved

public abstract boolean isResolved()
Resolution status.

If the class/array has been "resolved", then size and offset information is available by which the compiler can generate code to access this class/array's fields/methods via direct loads/stores/calls (rather than generating code to access fields/methods symbolically, via dynamic linking stubs).

Primitives are always treated as "resolved".


isInstantiated

public abstract boolean isInstantiated()
Instantiation status.

If the class/array has been "instantiated", then all its methods have been compiled and its type information block has been placed in the JTOC.

Primitives are always treated as "instantiated".


isInitialized

public abstract boolean isInitialized()
Initialization status.

If the class has been "initialized", then its <clinit> method has been executed. Arrays have no <clinit> methods so they become "initialized" immediately upon "instantiation".

Primitives are always treated as "initialized".


markAsBootImageClass

public abstract void markAsBootImageClass()
Only intended to be used by the BootImageWriter


isInBootImage

public abstract boolean isInBootImage()
Is this class part of the virtual machine's boot image?


getThinLockOffset

public abstract Offset getThinLockOffset()
Get the offset in instances of this type assigned to the thin lock word. Offset.max() if instances of this type do not have thin lock words.


isClassType

public abstract boolean isClassType()
Is this is an instance of RVMClass?

Returns:
whether or not this is an instance of RVMClass?

isArrayType

public abstract boolean isArrayType()
Is this an instance of RVMArray?

Returns:
whether or not this is an instance of RVMArray?

isPrimitiveType

public abstract boolean isPrimitiveType()
Is this a primitive type?

Returns:
whether or not this is a primitive type

isUnboxedType

public abstract boolean isUnboxedType()
Is this an unboxed type?

Returns:
whether or not this is an unboxed type

isReferenceType

public abstract boolean isReferenceType()
Is this a reference type?

Returns:
whether or not this is a reference (ie non-primitive) type.

isAssignableFrom

public boolean isAssignableFrom(RVMType type)
Returns:
whether type can be assigned to things of this RVMType

getStackWords

public abstract int getStackWords()
Space required when this type is stored on the stack (or as a field), in words. Ie. 0, 1, or 2 words:


getMemoryBytes

public abstract int getMemoryBytes()
Number of bytes in memory required to represent the type


resolve

public abstract void resolve()
Cause resolution to take place. This will cause slots to be allocated in the JTOC.


allBootImageTypesResolved

public abstract void allBootImageTypesResolved()
This method is only called by the bootimage writer. It is called after resolve() has been called on all bootimage types but before instantiate() has been called on any bootimage type. This provides a hook to compute various summaries that cannot be computed before types are resolved.


instantiate

public abstract void instantiate()
Cause instantiation to take place. This will cause the class's methods to be compiled and slots in the JTOC to be filled-in.


initialize

public abstract void initialize()
Cause initialization to take place. This will cause the class's <clinit> method to be executed.


hasFinalizer

public abstract boolean hasFinalizer()
Does this type override java.lang.Object.finalize()?


getStaticFields

public abstract RVMField[] getStaticFields()
Static fields of this class/array type.


getInstanceFields

public abstract RVMField[] getInstanceFields()
Non-static fields of this class/array type (composed with supertypes, if any).


getStaticMethods

public abstract RVMMethod[] getStaticMethods()
Statically dispatched methods of this class/array type.


getVirtualMethods

public abstract RVMMethod[] getVirtualMethods()
Virtually dispatched methods of this class/array type (composed with supertypes, if any).


getTypeInformationBlock

public abstract TIB getTypeInformationBlock()
Runtime type information for this class/array type.


setSpecializedMethod

public final void setSpecializedMethod(int id,
                                       ArchitectureSpecific.CodeArray code)
Set the specialized method for a class or array.


setMMAllocator

public final void setMMAllocator(int allocator)
Record the allocator information the memory manager holds about this type.

Parameters:
allocator - the allocator to record

getMMAllocator

public final int getMMAllocator()
This returns the allocator id as supplied by the memory manager. The method is located here as this is the only common superclass of RVMArray and RVMClass, and due to performance reasons this needs to be a non-abstract method. For Primitive this field is unused.

Returns:
the allocator id previously recorded.

isNonMoving

public boolean isNonMoving()
Is this field a type that must never move?


getReferenceOffsets

public int[] getReferenceOffsets()
Offsets of reference-containing instance fields of this class type. Offsets are with respect to object pointer -- see RVMField.getOffset().