|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.classloader.AnnotatedElement org.jikesrvm.classloader.RVMType org.jikesrvm.classloader.Primitive
public final class Primitive
Description of a java "primitive" type (int, float, etc.)
This description is not read from a ".class" file, but rather is manufactured by the VM before execution begins.
Note that instances of primitives are not objects:
RVMType
,
RVMClass
,
RVMArray
,
UnboxedType
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 primitive. |
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.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.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 | |
---|---|
private |
Primitive(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 Primitive |
createPrimitive(TypeReference tr)
Create an instance of a Primitive |
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()
Number of bytes in memory required to represent the type |
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()
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". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final Atom name
private final int stackWords
private final int memoryBytes
Constructor Detail |
---|
private Primitive(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 primitiveMethod Detail |
---|
public String toString()
toString
in class Object
static Primitive createPrimitive(TypeReference tr)
Primitive
tr
- The canonical type reference for this primitivepublic int getTypeDepth()
getTypeDepth
in class RVMType
public boolean isAcyclicReference()
RVMType
isAcyclicReference
in class RVMType
true
public int getDimensionality()
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 primitives 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 primitives 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 primitives are always considered
"initialized"public void markAsBootImageClass()
RVMType
markAsBootImageClass
in class RVMType
public boolean isInBootImage()
RVMType
isInBootImage
in class RVMType
true
because primitives are needed to start
Jikes RVMpublic Offset getThinLockOffset()
RVMType
getThinLockOffset
in class RVMType
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
true
public boolean isReferenceType()
RVMType
isReferenceType
in class RVMType
false
public boolean isUnboxedType()
RVMType
isUnboxedType
in class RVMType
false
public int getStackWords()
getStackWords
in class RVMType
public int getMemoryBytes()
RVMType
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()
RVMType
hasFinalizer
in class RVMType
false
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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |