org.jikesrvm.classloader
Class RVMArray

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

public final class RVMArray
extends RVMType
implements Constants, ClassLoaderConstants

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.

See Also:
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.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, NOREFS_OFFSET_ARRAY, ObjectReferenceArrayType, ObjectReferenceType, OffsetArrayType, OffsetType, REFARRAY_OFFSET_ARRAY, referenceOffsets, 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
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 method).
 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 org.jikesrvm.classloader.RVMType
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
 
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

BooleanArray

public static final RVMArray BooleanArray

ByteArray

public static final RVMArray ByteArray

CharArray

public static final RVMArray CharArray

ShortArray

public static final RVMArray ShortArray

IntArray

public static final RVMArray IntArray

LongArray

public static final RVMArray LongArray

FloatArray

public static final RVMArray FloatArray

DoubleArray

public static final RVMArray DoubleArray

JavaLangObjectArray

public static final RVMArray JavaLangObjectArray

elementType

private final RVMType elementType
The RVMType object for elements of this array type.


logElementSize

private final int logElementSize
The log of the element size for this array type.


innermostElementType

private final RVMType innermostElementType
The RVMType object for the innermost element of this array type.


innermostElementTypeDimension

private final int innermostElementTypeDimension
The dimension of the innermost element of this array type.


alignment

private final int alignment
The desired alignment for instances of this type. Cached rather than computed because this is a frequently asked question


acyclic

private final boolean acyclic
Reference Count GC: is this type acyclic?


typeInformationBlock

private TIB typeInformationBlock
The TIB for this type, created when the array is resolved.


state

private byte state
current class-loading stage (loaded, resolved or initialized)


inBootImage

private boolean inBootImage
Is this array type in the bootimage?

Constructor Detail

RVMArray

RVMArray(TypeReference typeRef,
         RVMType elementType)
Constructor

Parameters:
typeRef -
elementType -
Method Detail

toString

public String toString()
Name - something like "[I" or "[Ljava.lang.String;"

Overrides:
toString in class Object

getStackWords

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

Specified by:
getStackWords in class RVMType
Returns:
1

getMemoryBytes

public int getMemoryBytes()
Description copied from class: RVMType
Number of bytes in memory required to represent the type

Specified by:
getMemoryBytes in class RVMType

getElementType

public RVMType getElementType()
Returns:
element type.

getInnermostElementType

public RVMType getInnermostElementType()
Returns:
innermost element type

getAlignment

public int getAlignment()
Returns:
alignment for instances of this array type

getLogElementSize

public int getLogElementSize()
Size, in bytes, of an array element, log base 2.

Returns:
log base 2 of array element size

computeLogElementSize

private int computeLogElementSize()
Calculate the size, in bytes, of an array element, log base 2.

Returns:
log base 2 of array element size

getInstanceSize

public int getInstanceSize(int numelts)
Total size, in bytes, of an instance of this array type (including object header).

Parameters:
numelts - number of array elements in the instance
Returns:
size in bytes

hasFinalizer

public boolean hasFinalizer()
Description copied from class: RVMType
Does this type override java.lang.Object.finalize()?

Specified by:
hasFinalizer in class RVMType
Returns:
false

getStaticFields

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

Specified by:
getStaticFields in class RVMType

getInstanceFields

public RVMField[] getInstanceFields()
Non-static fields of this array type.

Specified by:
getInstanceFields in class RVMType

getStaticMethods

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

Specified by:
getStaticMethods in class RVMType

getVirtualMethods

public RVMMethod[] getVirtualMethods()
Virtually dispatched methods of this array type.

Specified by:
getVirtualMethods in class RVMType

getTypeInformationBlock

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

Specified by:
getTypeInformationBlock in class RVMType

getTypeDepth

public int getTypeDepth()
Description copied from class: RVMType
get number of superclasses to Object

Specified by:
getTypeDepth in class RVMType
Returns:
1

isAcyclicReference

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

Specified by:
isAcyclicReference in class RVMType

getDimensionality

public int getDimensionality()
Number of [ in descriptor for arrays

Specified by:
getDimensionality in class RVMType

isResolved

public boolean isResolved()
Description copied from class: RVMType
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".

Specified by:
isResolved in class RVMType

isInstantiated

public boolean isInstantiated()
Description copied from class: RVMType
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".

Specified by:
isInstantiated in class RVMType

isInitialized

public boolean isInitialized()
Description copied from class: RVMType
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".

Specified by:
isInitialized in class RVMType

markAsBootImageClass

public void markAsBootImageClass()
Description copied from class: RVMType
Only intended to be used by the BootImageWriter

Specified by:
markAsBootImageClass in class RVMType

isInBootImage

public boolean isInBootImage()
Description copied from class: RVMType
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.

Specified by:
getThinLockOffset in class RVMType

isClassType

public boolean isClassType()
Description copied from class: RVMType
Is this is an instance of RVMClass?

Specified by:
isClassType in class RVMType
Returns:
false

isArrayType

public boolean isArrayType()
Description copied from class: RVMType
Is this an instance of RVMArray?

Specified by:
isArrayType in class RVMType
Returns:
true

isPrimitiveType

public boolean isPrimitiveType()
Description copied from class: RVMType
Is this a primitive type?

Specified by:
isPrimitiveType in class RVMType
Returns:
false

isReferenceType

public boolean isReferenceType()
Description copied from class: RVMType
Is this a reference type?

Specified by:
isReferenceType in class RVMType
Returns:
true

isUnboxedType

public boolean isUnboxedType()
Description copied from class: RVMType
Is this an unboxed type?

Specified by:
isUnboxedType in class RVMType
Returns:
false

resolve

public void resolve()
Resolve an array. Also forces the resolution of the element type.

Specified by:
resolve in class RVMType

publishResolved

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.

Parameters:
allocatedTib - The TIB that has been allocated for this type
superclassIds - The calculated superclass ids array
doesImplement - The calculated does implement array

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

Specified by:
allBootImageTypesResolved in class RVMType

instantiate

public void instantiate()
Instantiate an array. Main result is to copy the virtual methods from JavaLangObject's TIB.

Specified by:
instantiate in class RVMType

initialize

public void initialize()
Initialization is a no-op (arrays have no method).

Specified by:
initialize in class RVMType

getPrimitiveArrayType

public static RVMArray getPrimitiveArrayType(int atype)
Get description of specified primitive array.

Parameters:
atype - array type number (see "newarray" bytecode description in Java VM Specification)
Returns:
array description

arraycopy

public static void arraycopy(byte[] src,
                             int srcIdx,
                             byte[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of bytes.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(byte[] src,
                                       int srcIdx,
                                       byte[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of bytes. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(boolean[] src,
                             int srcIdx,
                             boolean[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of booleans.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(boolean[] src,
                                       int srcIdx,
                                       boolean[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of booleans. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(short[] src,
                             int srcIdx,
                             short[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of shorts.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(short[] src,
                                       int srcIdx,
                                       short[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of shorts. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(char[] src,
                             int srcIdx,
                             char[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of chars.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(char[] src,
                                       int srcIdx,
                                       char[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of chars. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(int[] src,
                             int srcIdx,
                             int[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of ints.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(int[] src,
                                       int srcIdx,
                                       int[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of ints. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(float[] src,
                             int srcIdx,
                             float[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of floats.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(float[] src,
                                       int srcIdx,
                                       float[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of floats. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(long[] src,
                             int srcIdx,
                             long[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of longs.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(long[] src,
                                       int srcIdx,
                                       long[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of longs. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(double[] src,
                             int srcIdx,
                             double[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of doubles.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyPiecemeal

private static void arraycopyPiecemeal(double[] src,
                                       int srcIdx,
                                       double[] dst,
                                       int dstIdx,
                                       int len)
Perform element-by-element arraycopy for array of doubles. Used when bulk copy is not possible.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopy

public static void arraycopy(Object[] src,
                             int srcIdx,
                             Object[] dst,
                             int dstIdx,
                             int len)
Perform an array copy for arrays of objects. This code must ensure that write barriers are invoked as if the copy were performed element-by-element.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

arraycopyNoCheckcast

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. This may be done using direct byte copies, however, write barriers must be explicitly invoked (if required by the GC) since the write barrier associated with an explicit array store (aastore) will be bypassed.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting source index
len - The number of array elements to be copied

arraycopyPiecemealNoCheckcast

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. Used when bulk copy is not possible, but checkcast is still not necessary. If barriers are required they must be explicitly invoked.

Parameters:
src - The source array
dst - The destination array
len - The number of array elements to be copied
srcOffset - The starting offset in the source array
dstOffset - The starting offset in the destination array.
bytes - the number of bytes to copy

arraycopyPiecemeal

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. This must be done with element by element assignments in the correct order. Since write barriers are implicitly performed on explicit array stores, there is no need to explicitly invoke a write barrier in this code.

Parameters:
src - The source array
srcIdx - The starting source index
dst - The destination array
dstIdx - The starting destination index
len - The number of array elements to be copied

failWithIndexOutOfBoundsException

private static void failWithIndexOutOfBoundsException()