public final class UnboxedType extends RVMType
Currently, unboxed types are restricted to be values that can fit in a single machines word.
Modifier and Type | Field and Description |
---|---|
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?
|
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, NOREFS_OFFSET_ARRAY, ObjectReferenceArrayType, ObjectReferenceType, OffsetArrayType, OffsetType, REFARRAY_OFFSET_ARRAY, referenceOffsets, ShortType, superclassIds, tibOffset, TIBType, typeRef, VoidType, WordArrayType, WordType
declaredAnnotationDatas
Modifier | Constructor and Description |
---|---|
private |
UnboxedType(TypeReference tr,
Class<?> classForType,
Atom name,
int stackWords,
int memoryBytes)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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() |
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() |
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
|
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() |
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()
Is this an instance of RVMArray?
|
boolean |
isClassType()
Is 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()
Is this a primitive type?
|
boolean |
isReferenceType()
Is this a reference type?
|
boolean |
isResolved()
Resolution status.
|
boolean |
isUnboxedType()
Is this an unboxed type?
|
void |
markAsBootImageClass()
Only intended to be used by the BootImageWriter
|
void |
resolve()
Cause resolution to take place.
|
String |
toString()
Name - something like "int".
|
asArray, asClass, asPrimitive, asUnboxedType, createClassForType, findVirtualMethod, getArrayTypeForElementType, getClassForType, getClassLoader, getDescriptor, getDesiredAssertionStatus, getDoesImplement, getId, getMMAllocator, getReferenceOffsets, 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, updateArrayMethods
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
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
private final int stackWords
private final int memoryBytes
private UnboxedType(TypeReference tr, Class<?> classForType, Atom name, int stackWords, int memoryBytes)
tr
- The canonical type reference for this primitiveclassForType
- The java.lang.Class representationname
- The name for this primitivestackWords
- The stack slots used by this primitivememoryBytes
- The bytes in memory used by this primitivestatic UnboxedType createUnboxedType(TypeReference tr)
UnboxedType
tr
- The canonical type reference for this primitivepublic int getTypeDepth()
RVMType
getTypeDepth
in class RVMType
public boolean isAcyclicReference()
RVMType
isAcyclicReference
in class RVMType
true
because unboxed types cannot contain any referencespublic int getDimensionality()
RVMType
getDimensionality
in class RVMType
public boolean isResolved()
RVMType
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".
isResolved
in class RVMType
true
because unboxed types are always considered
resolved"public boolean isInstantiated()
RVMType
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".
isInstantiated
in class RVMType
true
because unboxed types are always considered
"instantiated"public boolean isInitialized()
RVMType
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".
isInitialized
in class RVMType
true
because unboxed types are always considered
"initialized"public void markAsBootImageClass()
RVMType
markAsBootImageClass
in class RVMType
public boolean isInBootImage()
RVMType
isInBootImage
in class RVMType
true
. All unboxed types are included in the bootimage
because they are needed for starting Jikes RVM.public Offset getThinLockOffset()
getThinLockOffset
in class RVMType
Offset.max()
public boolean isClassType()
RVMType
isClassType
in class RVMType
false
public boolean isArrayType()
RVMType
isArrayType
in class RVMType
false
public boolean isPrimitiveType()
RVMType
isPrimitiveType
in class RVMType
false
public boolean isReferenceType()
RVMType
isReferenceType
in class RVMType
false
public boolean isUnboxedType()
RVMType
isUnboxedType
in class RVMType
true
public int getStackWords()
getStackWords
in class RVMType
public int getMemoryBytes()
getMemoryBytes
in class RVMType
public void resolve()
resolve
in class RVMType
isResolved()
public void allBootImageTypesResolved()
RVMType
RVMType.resolve()
has been called on all
bootimage types but before RVMType.instantiate()
has been called
on any bootimage type.
This provides a hook to compute various summaries that cannot be computed before types
are resolved.allBootImageTypesResolved
in class RVMType
public void instantiate()
instantiate
in class RVMType
isInstantiated()
public void initialize()
initialize
in class RVMType
isInitialized()
public boolean hasFinalizer()
hasFinalizer
in class RVMType
public RVMField[] getStaticFields()
getStaticFields
in class RVMType
public RVMField[] getInstanceFields()
getInstanceFields
in class RVMType
public RVMMethod[] getStaticMethods()
getStaticMethods
in class RVMType
public RVMMethod[] getVirtualMethods()
getVirtualMethods
in class RVMType
public TIB getTypeInformationBlock()
getTypeInformationBlock
in class RVMType