org.jikesrvm.classloader
Class UnboxedType

java.lang.Object
  extended by org.jikesrvm.classloader.AnnotatedElement
      extended by org.jikesrvm.classloader.RVMType
          extended by org.jikesrvm.classloader.UnboxedType
All Implemented Interfaces:
AnnotatedElement, ClassLoaderConstants, Constants, HeapLayoutConstants, ThinLockConstants, TIBLayoutConstants, SizeConstants

public final class UnboxedType
extends RVMType
implements Constants, ClassLoaderConstants

Description of an Unboxed Magic type. Currently, unboxed types are restricted to be values that can fit in a single machines word.

See Also:
RVMType, RVMClass, RVMArray, Primitive

Field Summary
private  int memoryBytes
          How many bytes in memory does it take to hold a value of this primitive type?
private  Atom name
          The pretty (external) name for this Unboxed type.
private  int stackWords
          How many slots in the Java Expression Stack does it take to hold a value of this primitive type?
 
Fields inherited from class org.jikesrvm.classloader.RVMType
AddressArrayType, AddressType, BooleanType, ByteType, CharType, CodeArrayType, CodeType, depth, dimension, doesImplement, DoubleType, emptyVMClass, emptyVMField, emptyVMMethod, ExtentArrayType, ExtentType, FloatType, FunctionTableType, id, IMTType, IntType, ITableArrayType, ITableType, JavaIoSerializableType, JavaLangClassType, JavaLangCloneableType, JavaLangObjectArrayType, JavaLangObjectType, JavaLangRefReferenceReferenceField, JavaLangRefReferenceType, JavaLangStringType, JavaLangThrowableType, LinkageTripletTableType, LongType, MagicType, ObjectReferenceArrayType, ObjectReferenceType, OffsetArrayType, OffsetType, ShortType, superclassIds, tibOffset, TIBType, typeRef, VoidType, WordArrayType, WordType
 
Fields inherited from class org.jikesrvm.classloader.AnnotatedElement
declaredAnnotationDatas
 
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
 
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
private UnboxedType(TypeReference tr, Class<?> classForType, Atom name, int stackWords, int memoryBytes)
          Constructor
 
Method Summary
 void allBootImageTypesResolved()
          This method is only called by the bootimage writer.
(package private) static UnboxedType createUnboxedType(TypeReference tr)
          Create an instance of a UnboxedType
 int getDimensionality()
          Number of [ in descriptor for arrays; -1 for primitives; 0 for classes
 RVMField[] getInstanceFields()
          Non-static fields of this class/array type (composed with supertypes, if any).
 int getMemoryBytes()
          Space required in memory in bytes.
 int getStackWords()
          Stack space requirement in words.
 RVMField[] getStaticFields()
          Static fields of this class/array type.
 RVMMethod[] getStaticMethods()
          Statically dispatched methods of this class/array type.
 Offset getThinLockOffset()
          Get the offset in instances of this type assigned to the thin lock word.
 int getTypeDepth()
          get number of superclasses to Object
 TIB getTypeInformationBlock()
          Runtime type information for this class/array type.
 RVMMethod[] getVirtualMethods()
          Virtually dispatched methods of this class/array type (composed with supertypes, if any).
 boolean hasFinalizer()
          Does this type override java.lang.Object.finalize()?
 void initialize()
          Cause initialization to take place.
 void instantiate()
          Cause instantiation to take place.
 boolean isAcyclicReference()
          Reference Count GC: Is a reference of this type contained in another object inherently acyclic (without cycles) ?
 boolean isArrayType()
          Whether or not this is an instance of RVMArray?
 boolean isClassType()
          Whether or not this is an instance of RVMClass?
 boolean isInBootImage()
          Is this class part of the virtual machine's boot image?
 boolean isInitialized()
          Initialization status.
 boolean isInstantiated()
          Instantiation status.
 boolean isPrimitiveType()
          Whether or not this is a primitive type
 boolean isReferenceType()
           
 boolean isResolved()
          Resolution status.
 boolean isUnboxedType()
           
 void markAsBootImageClass()
          Only intended to be used by the BootImageWriter
 void resolve()
          Cause resolution to take place.
 String toString()
          Name - something like "int".
 
Methods inherited from class org.jikesrvm.classloader.RVMType
asArray, asClass, asPrimitive, asUnboxedType, createClassForType, findVirtualMethod, getArrayTypeForElementType, getClassForType, getClassLoader, getDescriptor, getDesiredAssertionStatus, getDoesImplement, getId, getMMAllocator, getResolvedClassForType, getSuperclassIds, getTIBMethodAtSlot, getTibOffset, getType, getTypeRef, hashCode, isAssignableFrom, isBooleanType, isByteType, isCharType, isDoubleType, isFloatType, isIntLikeType, isIntType, isJavaLangObjectType, isJavaLangStringType, isJavaLangThrowableType, isLongType, isNonMoving, isShortType, isVoidType, numTypes, setMMAllocator, setSpecializedMethod
 
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, wait, wait, wait
 

Field Detail

name

private final Atom name
The pretty (external) name for this Unboxed type.


stackWords

private final int stackWords
How many slots in the Java Expression Stack does it take to hold a value of this primitive type?


memoryBytes

private final int memoryBytes
How many bytes in memory does it take to hold a value of this primitive type?

Constructor Detail

UnboxedType

private UnboxedType(TypeReference tr,
                    Class<?> classForType,
                    Atom name,
                    int stackWords,
                    int memoryBytes)
Constructor

Parameters:
tr - The canonical type reference for this primitive
classForType - The java.lang.Class representation
name - The name for this primitive
stackWords - The stack slots used by this primitive
memoryBytes - The bytes in memory used by this primitive
Method Detail

toString

public String toString()
Name - something like "int".

Overrides:
toString in class Object

createUnboxedType

static UnboxedType createUnboxedType(TypeReference tr)
Create an instance of a UnboxedType

Parameters:
tr - The canonical type reference for this primitive

getTypeDepth

public int getTypeDepth()
get number of superclasses to Object

Specified by:
getTypeDepth in class RVMType
Returns:
0

isAcyclicReference

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

Specified by:
isAcyclicReference in class RVMType
Returns:
true

getDimensionality

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

Specified by:
getDimensionality in class RVMType
Returns:
-1;

isResolved

public boolean isResolved()
Resolution status.

Specified by:
isResolved in class RVMType
Returns:
true

isInstantiated

public boolean isInstantiated()
Instantiation status.

Specified by:
isInstantiated in class RVMType
Returns:
true

isInitialized

public boolean isInitialized()
Initialization status.

Specified by:
isInitialized in class RVMType
Returns:
true

markAsBootImageClass

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

Specified by:
markAsBootImageClass in class RVMType

isInBootImage

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

Specified by:
isInBootImage in class RVMType

getThinLockOffset

public 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.

Specified by:
getThinLockOffset in class RVMType
Returns:
Offset.max();

isClassType

public boolean isClassType()
Whether or not this is an instance of RVMClass?

Specified by:
isClassType in class RVMType
Returns:
false

isArrayType

public boolean isArrayType()
Whether or not this is an instance of RVMArray?

Specified by:
isArrayType in class RVMType
Returns:
false

isPrimitiveType

public boolean isPrimitiveType()
Whether or not this is a primitive type

Specified by:
isPrimitiveType in class RVMType
Returns:
true

isReferenceType

public boolean isReferenceType()
Specified by:
isReferenceType in class RVMType
Returns:
whether or not this is a reference (ie non-primitive) type.

isUnboxedType

public boolean isUnboxedType()
Specified by:
isUnboxedType in class RVMType
Returns:
whether or not this is an unboxed type

getStackWords

public int getStackWords()
Stack space requirement in words.

Specified by:
getStackWords in class RVMType

getMemoryBytes

public int getMemoryBytes()
Space required in memory in bytes.

Specified by:
getMemoryBytes in class RVMType

resolve

public void resolve()
Cause resolution to take place.

Specified by:
resolve in class RVMType

allBootImageTypesResolved

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

Specified by:
allBootImageTypesResolved in class RVMType

instantiate

public void instantiate()
Cause instantiation to take place.

Specified by:
instantiate in class RVMType

initialize

public void initialize()
Cause initialization to take place.

Specified by:
initialize in class RVMType

hasFinalizer

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

Specified by:
hasFinalizer in class RVMType

getStaticFields

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

Specified by:
getStaticFields in class RVMType
Returns:
zero length array

getInstanceFields

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

Specified by:
getInstanceFields in class RVMType
Returns:
zero length array

getStaticMethods

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

Specified by:
getStaticMethods in class RVMType
Returns:
zero length array

getVirtualMethods

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

Specified by:
getVirtualMethods in class RVMType
Returns:
zero length array

getTypeInformationBlock

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

Specified by:
getTypeInformationBlock in class RVMType