|
|||||||||||
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.RVMArray
public final class RVMArray
Description of a java "array" type.
This description is not read from a ".class" file, but rather is manufactured by the VM as execution proceeds.
RVMType
,
RVMClass
,
Primitive
,
UnboxedType
Field Summary | |
---|---|
private boolean |
acyclic
Reference Count GC: is this type acyclic? |
private int |
alignment
The desired alignment for instances of this type. |
static RVMArray |
BooleanArray
|
static RVMArray |
ByteArray
|
static RVMArray |
CharArray
|
static RVMArray |
DoubleArray
|
private RVMType |
elementType
The RVMType object for elements of this array type. |
static RVMArray |
FloatArray
|
private boolean |
inBootImage
Is this array type in the bootimage? |
private RVMType |
innermostElementType
The RVMType object for the innermost element of this array type. |
private int |
innermostElementTypeDimension
The dimension of the innermost element of this array type. |
static RVMArray |
IntArray
|
static RVMArray |
JavaLangObjectArray
|
private int |
logElementSize
The log of the element size for this array type. |
static RVMArray |
LongArray
|
static RVMArray |
ShortArray
|
private byte |
state
current class-loading stage (loaded, resolved or initialized) |
private TIB |
typeInformationBlock
The TIB for this type, created when the array is resolved. |
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 | |
---|---|
RVMArray(TypeReference typeRef,
RVMType elementType)
Constructor |
Method Summary | |
---|---|
void |
allBootImageTypesResolved()
This method is only called by the bootimage writer. |
static void |
arraycopy(boolean[] src,
int srcIdx,
boolean[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of booleans. |
static void |
arraycopy(byte[] src,
int srcIdx,
byte[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of bytes. |
static void |
arraycopy(char[] src,
int srcIdx,
char[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of chars. |
static void |
arraycopy(double[] src,
int srcIdx,
double[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of doubles. |
static void |
arraycopy(float[] src,
int srcIdx,
float[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of floats. |
static void |
arraycopy(int[] src,
int srcIdx,
int[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of ints. |
static void |
arraycopy(long[] src,
int srcIdx,
long[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of longs. |
static void |
arraycopy(Object[] src,
int srcIdx,
Object[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of objects. |
static void |
arraycopy(short[] src,
int srcIdx,
short[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of shorts. |
private static void |
arraycopyNoCheckcast(Object[] src,
int srcIdx,
Object[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of objects where the possibility of an ArrayStoreException being thrown does not exist. |
private static void |
arraycopyPiecemeal(boolean[] src,
int srcIdx,
boolean[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of booleans. |
private static void |
arraycopyPiecemeal(byte[] src,
int srcIdx,
byte[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of bytes. |
private static void |
arraycopyPiecemeal(char[] src,
int srcIdx,
char[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of chars. |
private static void |
arraycopyPiecemeal(double[] src,
int srcIdx,
double[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of doubles. |
private static void |
arraycopyPiecemeal(float[] src,
int srcIdx,
float[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of floats. |
private static void |
arraycopyPiecemeal(int[] src,
int srcIdx,
int[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of ints. |
private static void |
arraycopyPiecemeal(long[] src,
int srcIdx,
long[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of longs. |
private static void |
arraycopyPiecemeal(Object[] src,
int srcIdx,
Object[] dst,
int dstIdx,
int len)
Perform an array copy for arrays of objects where the possibility of an ArrayStoreException being thrown exists. |
private static void |
arraycopyPiecemeal(short[] src,
int srcIdx,
short[] dst,
int dstIdx,
int len)
Perform element-by-element arraycopy for array of shorts. |
private static void |
arraycopyPiecemealNoCheckcast(Object[] src,
Object[] dst,
int len,
Offset srcOffset,
Offset dstOffset,
int bytes)
Perform element-by-element arraycopy for array of objects without performing checkcast. |
private int |
computeLogElementSize()
Calculate the size, in bytes, of an array element, log base 2. |
private static void |
failWithIndexOutOfBoundsException()
|
int |
getAlignment()
|
int |
getDimensionality()
Number of [ in descriptor for arrays |
RVMType |
getElementType()
|
RVMType |
getInnermostElementType()
|
RVMField[] |
getInstanceFields()
Non-static fields of this array type. |
int |
getInstanceSize(int numelts)
Total size, in bytes, of an instance of this array type (including object header). |
int |
getLogElementSize()
Size, in bytes, of an array element, log base 2. |
int |
getMemoryBytes()
Number of bytes in memory required to represent the type |
static RVMArray |
getPrimitiveArrayType(int atype)
Get description of specified primitive array. |
int |
getStackWords()
Space required when this type is stored on the stack (or as a field), in words. |
RVMField[] |
getStaticFields()
Static fields of this array type. |
RVMMethod[] |
getStaticMethods()
Statically dispatched methods of this 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 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 array type. |
RVMMethod[] |
getVirtualMethods()
Virtually dispatched methods of this array type. |
boolean |
hasFinalizer()
Does this type override java.lang.Object.finalize()? |
void |
initialize()
Initialization is a no-op (arrays have no |
void |
instantiate()
Instantiate an array. |
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 |
private void |
publishResolved(TIB allocatedTib,
short[] superclassIds,
int[] doesImplement)
Atomically initialize the important parts of the TIB and let the world know this type is resolved. |
void |
resolve()
Resolve an array. |
String |
toString()
Name - something like "[I" or "[Ljava.lang.String;" |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RVMArray BooleanArray
public static final RVMArray ByteArray
public static final RVMArray CharArray
public static final RVMArray ShortArray
public static final RVMArray IntArray
public static final RVMArray LongArray
public static final RVMArray FloatArray
public static final RVMArray DoubleArray
public static final RVMArray JavaLangObjectArray
private final RVMType elementType
private final int logElementSize
private final RVMType innermostElementType
private final int innermostElementTypeDimension
private final int alignment
private final boolean acyclic
private TIB typeInformationBlock
private byte state
private boolean inBootImage
Constructor Detail |
---|
RVMArray(TypeReference typeRef, RVMType elementType)
typeRef
- elementType
- Method Detail |
---|
public String toString()
toString
in class Object
public int getStackWords()
RVMType
getStackWords
in class RVMType
public int getMemoryBytes()
RVMType
getMemoryBytes
in class RVMType
public RVMType getElementType()
public RVMType getInnermostElementType()
public int getAlignment()
public int getLogElementSize()
private int computeLogElementSize()
public int getInstanceSize(int numelts)
numelts
- number of array elements in the instance
public boolean hasFinalizer()
RVMType
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
public int getTypeDepth()
RVMType
getTypeDepth
in class RVMType
public boolean isAcyclicReference()
RVMType
isAcyclicReference
in class RVMType
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
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
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
public void markAsBootImageClass()
RVMType
markAsBootImageClass
in class RVMType
public boolean isInBootImage()
RVMType
isInBootImage
in class RVMType
public Offset getThinLockOffset()
getThinLockOffset
in class RVMType
public boolean isClassType()
RVMType
isClassType
in class RVMType
false
public boolean isArrayType()
RVMType
isArrayType
in class RVMType
true
public boolean isPrimitiveType()
RVMType
isPrimitiveType
in class RVMType
false
public boolean isReferenceType()
RVMType
isReferenceType
in class RVMType
true
public boolean isUnboxedType()
RVMType
isUnboxedType
in class RVMType
false
public void resolve()
resolve
in class RVMType
private void publishResolved(TIB allocatedTib, short[] superclassIds, int[] doesImplement)
allocatedTib
- The TIB that has been allocated for this typesuperclassIds
- The calculated superclass ids arraydoesImplement
- The calculated does implement arraypublic 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
public void initialize()
initialize
in class RVMType
public static RVMArray getPrimitiveArrayType(int atype)
atype
- array type number (see "newarray" bytecode description in Java VM Specification)
public static void arraycopy(byte[] src, int srcIdx, byte[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(byte[] src, int srcIdx, byte[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(boolean[] src, int srcIdx, boolean[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(boolean[] src, int srcIdx, boolean[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(short[] src, int srcIdx, short[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(short[] src, int srcIdx, short[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(char[] src, int srcIdx, char[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(char[] src, int srcIdx, char[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(int[] src, int srcIdx, int[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(int[] src, int srcIdx, int[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(float[] src, int srcIdx, float[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(float[] src, int srcIdx, float[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(long[] src, int srcIdx, long[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(long[] src, int srcIdx, long[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(double[] src, int srcIdx, double[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemeal(double[] src, int srcIdx, double[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedpublic static void arraycopy(Object[] src, int srcIdx, Object[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void arraycopyNoCheckcast(Object[] src, int srcIdx, Object[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting source indexlen
- The number of array elements to be copiedprivate static void arraycopyPiecemealNoCheckcast(Object[] src, Object[] dst, int len, Offset srcOffset, Offset dstOffset, int bytes)
src
- The source arraydst
- The destination arraylen
- The number of array elements to be copiedsrcOffset
- The starting offset in the source arraydstOffset
- The starting offset in the destination array.bytes
- the number of bytes to copyprivate static void arraycopyPiecemeal(Object[] src, int srcIdx, Object[] dst, int dstIdx, int len)
src
- The source arraysrcIdx
- The starting source indexdst
- The destination arraydstIdx
- The starting destination indexlen
- The number of array elements to be copiedprivate static void failWithIndexOutOfBoundsException()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |