org.jikesrvm.objectmodel
Class JavaHeader

java.lang.Object
  extended by org.jikesrvm.objectmodel.JavaHeader
All Implemented Interfaces:
JavaHeaderConstants, SizeConstants

public class JavaHeader
extends Object
implements JavaHeaderConstants

Defines the JavaHeader portion of the object header for the default JikesRVM object model. The default object model uses a two word header.

One word holds a TIB pointer.

The other word ("status word") contains an inline thin lock, either the hash code or hash code state, and a few unallocated bits that can be used for other purposes. If JavaHeaderConstants.ADDRESS_BASED_HASHING is false, then to implement default hashcodes, Jikes RVM uses a 10 bit hash code that is completely stored in the status word, which is laid out as shown below:

      TTTT TTTT TTTT TTTT TTTT HHHH HHHH HHAA
 T = thin lock bits
 H = hash code
 A = available for use by GCHeader and/or MiscHeader.
 
If ADDRESS_BASED_HASHING is true, then Jikes RVM uses two bits of the status word to record the hash code state in a typical three state scheme (JavaHeaderConstants.HASH_STATE_UNHASHED, JavaHeaderConstants.HASH_STATE_HASHED, and JavaHeaderConstants.HASH_STATE_HASHED_AND_MOVED). In this case, the status word is laid out as shown below:
      TTTT TTTT TTTT TTTT TTTT TTHH AAAA AAAA
 T = thin lock bits
 H = hash code state bits
 A = available for use by GCHeader and/or MiscHeader.
 


Field Summary
static int ALIGNMENT_VALUE
          The alignment value
protected static int ARRAY_HEADER_SIZE
           
protected static Offset AVAILABLE_BITS_OFFSET
           
protected static Word HASH_CODE_MASK
           
protected static int HASH_CODE_SHIFT
           
protected static Word hashCodeGenerator
           
static int LOG_MIN_ALIGNMENT
           
static int NUM_THIN_LOCK_BITS
          How many bits are allocated to a thin lock?
static int OBJECT_REF_OFFSET
          offset of object reference from the lowest memory word
protected static int SCALAR_HEADER_SIZE
           
protected static Offset STATUS_OFFSET
           
static int THIN_LOCK_DEDICATED_U16_OFFSET
          How many bytes do we have to offset to get to the high locking bits
static int THIN_LOCK_DEDICATED_U16_SHIFT
          How many bits do we have to shift to only hold the high locking bits
static int THIN_LOCK_SHIFT
          How many bits to shift to get the thin lock?
protected static Offset TIB_OFFSET
           
 
Fields inherited from interface org.jikesrvm.objectmodel.JavaHeaderConstants
ADDRESS_BASED_HASHING, ALIGNMENT_MASK, ALLOWS_LINEAR_SCAN, ARRAY_BASE_OFFSET, ARRAY_LENGTH_BYTES, ARRAY_LENGTH_OFFSET, DYNAMIC_HASH_OFFSET, FIELD_ZERO_OFFSET, FORWARDING_PTR_OVERLAYS_TIB, GC_HEADER_BYTES, GC_HEADER_OFFSET, HASH_STATE_HASHED, HASH_STATE_HASHED_AND_MOVED, HASH_STATE_MASK, HASH_STATE_UNHASHED, HASHCODE_BYTES, HASHCODE_OFFSET, JAVA_HEADER_BYTES, JAVA_HEADER_OFFSET, MISC_HEADER_BYTES, MISC_HEADER_OFFSET, NUM_AVAILABLE_BITS, OTHER_HEADER_BYTES, SEGREGATE_ARRAYS_FOR_LINEAR_SCAN, STATUS_BYTES, TIB_BYTES
 
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
 
Constructor Summary
JavaHeader()
           
 
Method Summary
static void allocateThinLock(RVMType t)
          Allocate a thin lock word for instances of the type (if they already have one, then has no effect).
static boolean attemptAvailableBits(Object o, Word oldVal, Word newVal)
          An attempt on the word containing the available bits
static void baselineEmitLoadTIB(ArchitectureSpecific.Assembler asm, int dest, int object)
          The following method will emit code that moves a reference to an object's TIB into a destination register.
static int bytesRequiredWhenCopied(Object fromObj, RVMArray type, int numElements)
          how many bytes are needed when the array object is copied by GC?
static int bytesRequiredWhenCopied(Object fromObj, RVMClass type)
          how many bytes are needed when the scalar object is copied by GC?
static int bytesUsed(Object obj, RVMArray type, int numElements)
          how many bytes are used by the array object?
static int bytesUsed(Object obj, RVMClass type)
          how many bytes are used by the scalar object?
static int computeArrayHeaderSize(RVMArray type)
          Compute the header size of an instance of the given type.
static int computeScalarHeaderSize(RVMClass type)
          Compute the header size of an instance of the given type.
static Offset defaultThinLockOffset()
          what is the default offset for a thin lock?
static void dumpHeader(Object ref)
          For low level debugging of GC subsystem.
static void genericLock(Object o)
          Generic lock
static void genericUnlock(Object o)
          Generic unlock
static int getAlignment(RVMArray t)
          Return the desired alignment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMArray.
static int getAlignment(RVMArray t, Object obj)
          Return the desired alignment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMArray.
static int getAlignment(RVMClass t)
          Return the desired aligment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMClass.
static int getAlignment(RVMClass t, Object obj)
          Return the desired aligment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMClass.
static ObjectReference getArrayFromStartAddress(Address start)
          Get an object reference from the address the lowest word of the object was allocated.
static int getHeaderEndOffset()
          What is the last word of the header from an out-to-in perspective?
static Lock getHeavyLock(Object o, boolean create)
          Obtains the heavy-weight lock, if there is one, associated with the indicated object.
protected static ObjectReference getNextObject(ObjectReference obj, int size)
          Get the next object in the heap under contiguous allocation.
static ObjectReference getNextObject(ObjectReference obj, RVMArray type, int numElements)
          Get the next array in the heap under contiguous allocation.
static ObjectReference getNextObject(ObjectReference obj, RVMClass type)
          Get the next scalar in the heap under contiguous allocation.
static Address getObjectEndAddress(Object obj, RVMArray type, int numElements)
          What is the first word after the array?
static Address getObjectEndAddress(Object obj, RVMClass type)
          What is the first word after the class?
static ObjectReference getObjectFromStartAddress(Address start)
          Get an object reference from the address the lowest word of the object was allocated.
static int getObjectHashCode(Object o)
          Get the hash code of an object.
static int getOffsetForAlignment(RVMArray t, boolean needsIdentityHash)
          Return the offset relative to physical beginning of object that must be aligned.
static int getOffsetForAlignment(RVMArray t, ObjectReference obj)
          Return the offset relative to physical beginning of object that must be aligned.
static int getOffsetForAlignment(RVMClass t, boolean needsIdentityHash)
          Return the offset relative to physical beginning of object that must be aligned.
static int getOffsetForAlignment(RVMClass t, ObjectReference obj)
          Return the offset relative to physical beginning of object that must be aligned.
static Address getPointerInMemoryRegion(ObjectReference ref)
          Given a reference, return an address which is guaranteed to be inside the memory region allocated to the object.
protected static Object getReferenceWhenCopiedTo(Object obj, Address to)
           
static Object getReferenceWhenCopiedTo(Object obj, Address to, RVMArray type)
          Get the reference of an array when copied to the specified region.
static Object getReferenceWhenCopiedTo(Object obj, Address to, RVMClass type)
          Get the reference of a scalar when copied to the specified region.
static ObjectReference getScalarFromStartAddress(Address start)
          Get an object reference from the address the lowest word of the object was allocated.
static Offset getThinLockOffset(Object o)
          Get the offset of the thin lock word in this object
static TIB getTIB(Object o)
          Get the TIB for an object.
static Offset getTibOffset()
          Return the TIB offset.
static boolean holdsLock(Object obj, RVMThread thread)
           
static Object initializeArrayHeader(Address ptr, TIB tib, int size)
          Perform any required initialization of the JAVA portion of the header.
static Address initializeArrayHeader(BootImageInterface bootImage, Address ptr, TIB tib, int size, int numElements, boolean needsIdentityHash, int identityHashValue)
          Perform any required initialization of the JAVA portion of the header.
static void initializeAvailableByte(Object o)
          Freeze the other bits in the byte containing the available bits so that it is safe to update them using setAvailableBits.
static Object initializeScalarHeader(Address ptr, TIB tib, int size)
          Perform any required initialization of the JAVA portion of the header.
static Address initializeScalarHeader(BootImageInterface bootImage, Address ptr, TIB tib, int size, boolean needsIdentityHash, int identityHashValue)
          Perform any required initialization of the JAVA portion of the header.
protected static int installHashCode(Object o)
          Install a new hashcode (only used if !
static Address maximumObjectRef(Address regionHighAddr)
          Given the largest base address in a region, return the largest object reference that could refer to an object in the region.
static Address minimumObjectRef(Address regionBaseAddr)
          Given the smallest base address in a region, return the smallest object reference that could refer to an object in the region.
static int minimumObjectSize()
          How small is the minimum object header size?
static Object moveObject(Address toAddress, Object fromObj, int numBytes, RVMArray type)
          Copy an array to the given raw storage address
static Object moveObject(Address toAddress, Object fromObj, int numBytes, RVMClass type)
          Copy a scalar to the given raw storage address
static Object moveObject(Address toAddress, Object fromObj, Object toObj, int numBytes)
          Copy an object to the given raw storage address
static Object moveObject(Object fromObj, Object toObj, int numBytes, RVMArray type)
          Copy an array to the given location.
static Object moveObject(Object fromObj, Object toObj, int numBytes, RVMClass type)
          Copy an array to the given location.
static Offset objectEndOffset(RVMClass klass)
          What is the offset of the first word after the class?
static int objectStartOffset(RVMClass klass)
          What is the offset of the first word of the class?
static Address objectStartRef(ObjectReference obj)
          Map from the object ref to the lowest address of the storage associated with the object
static Word prepareAvailableBits(Object o)
          A prepare on the word containing the available bits
static Word readAvailableBitsWord(Object o)
          Non-atomic read of word containing available bits
static byte readAvailableByte(Object o)
          Non-atomic read of byte containing available bits
static void setAvailableBit(Object o, int idx, boolean flag)
          Set argument bit to 1 if value is true, 0 if value is false
static void setTIB(BootImageInterface bootImage, Address refOffset, Address tibAddr, RVMType type)
          Set the TIB for an object.
static void setTIB(Object ref, TIB tib)
          Set the TIB for an object.
static boolean testAvailableBit(Object o, int idx)
          Return true if argument bit is 1, false if it is 0
static void writeAvailableBitsWord(Object o, Word val)
          Non-atomic write of word containing available bits
static void writeAvailableByte(BootImageInterface bootImage, Address ref, byte val)
          Non-atomic write of word containing available bits
static void writeAvailableByte(Object o, byte val)
          Non-atomic write of byte containing available bits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALAR_HEADER_SIZE

protected static final int SCALAR_HEADER_SIZE

ARRAY_HEADER_SIZE

protected static final int ARRAY_HEADER_SIZE

OBJECT_REF_OFFSET

public static final int OBJECT_REF_OFFSET
offset of object reference from the lowest memory word


TIB_OFFSET

protected static final Offset TIB_OFFSET

STATUS_OFFSET

protected static final Offset STATUS_OFFSET

AVAILABLE_BITS_OFFSET

protected static final Offset AVAILABLE_BITS_OFFSET

HASH_CODE_SHIFT

protected static final int HASH_CODE_SHIFT
See Also:
Constant Field Values

HASH_CODE_MASK

protected static final Word HASH_CODE_MASK

hashCodeGenerator

protected static Word hashCodeGenerator

NUM_THIN_LOCK_BITS

public static final int NUM_THIN_LOCK_BITS
How many bits are allocated to a thin lock?


THIN_LOCK_SHIFT

public static final int THIN_LOCK_SHIFT
How many bits to shift to get the thin lock?


THIN_LOCK_DEDICATED_U16_OFFSET

public static final int THIN_LOCK_DEDICATED_U16_OFFSET
How many bytes do we have to offset to get to the high locking bits

See Also:
Constant Field Values

THIN_LOCK_DEDICATED_U16_SHIFT

public static final int THIN_LOCK_DEDICATED_U16_SHIFT
How many bits do we have to shift to only hold the high locking bits

See Also:
Constant Field Values

ALIGNMENT_VALUE

public static final int ALIGNMENT_VALUE
The alignment value

See Also:
Constant Field Values

LOG_MIN_ALIGNMENT

public static final int LOG_MIN_ALIGNMENT
See Also:
Constant Field Values
Constructor Detail

JavaHeader

public JavaHeader()
Method Detail

getTibOffset

public static Offset getTibOffset()
Return the TIB offset.


objectEndOffset

public static Offset objectEndOffset(RVMClass klass)
What is the offset of the first word after the class? For use by ObjectModel.layoutInstanceFields


getObjectEndAddress

public static Address getObjectEndAddress(Object obj,
                                          RVMClass type)
What is the first word after the class?


getObjectEndAddress

public static Address getObjectEndAddress(Object obj,
                                          RVMArray type,
                                          int numElements)
What is the first word after the array?


objectStartOffset

public static int objectStartOffset(RVMClass klass)
What is the offset of the first word of the class?


getHeaderEndOffset

public static int getHeaderEndOffset()
What is the last word of the header from an out-to-in perspective?


minimumObjectSize

public static int minimumObjectSize()
How small is the minimum object header size? Can be used to pick chunk sizes for allocators.


getPointerInMemoryRegion

public static Address getPointerInMemoryRegion(ObjectReference ref)
Given a reference, return an address which is guaranteed to be inside the memory region allocated to the object.


getTIB

public static TIB getTIB(Object o)
Get the TIB for an object.


setTIB

public static void setTIB(Object ref,
                          TIB tib)
Set the TIB for an object.


setTIB

public static void setTIB(BootImageInterface bootImage,
                          Address refOffset,
                          Address tibAddr,
                          RVMType type)
Set the TIB for an object.


bytesRequiredWhenCopied

public static int bytesRequiredWhenCopied(Object fromObj,
                                          RVMClass type)
how many bytes are needed when the scalar object is copied by GC?


bytesUsed

public static int bytesUsed(Object obj,
                            RVMClass type)
how many bytes are used by the scalar object?


bytesRequiredWhenCopied

public static int bytesRequiredWhenCopied(Object fromObj,
                                          RVMArray type,
                                          int numElements)
how many bytes are needed when the array object is copied by GC?


bytesUsed

public static int bytesUsed(Object obj,
                            RVMArray type,
                            int numElements)
how many bytes are used by the array object?


objectStartRef

public static Address objectStartRef(ObjectReference obj)
Map from the object ref to the lowest address of the storage associated with the object


getObjectFromStartAddress

public static ObjectReference getObjectFromStartAddress(Address start)
Get an object reference from the address the lowest word of the object was allocated. In general this required that we are using a dynamic hash offset or not using address based hashing. However, the GC algorithm could safely do this in the nursery so we can't assert DYNAMIC_HASH_OFFSET.


getScalarFromStartAddress

public static ObjectReference getScalarFromStartAddress(Address start)
Get an object reference from the address the lowest word of the object was allocated.


getArrayFromStartAddress

public static ObjectReference getArrayFromStartAddress(Address start)
Get an object reference from the address the lowest word of the object was allocated.


getNextObject

protected static ObjectReference getNextObject(ObjectReference obj,
                                               int size)
Get the next object in the heap under contiguous allocation. Handles alignment issues only when there are no GC or Misc header words. In the case there are we probably have to ask MemoryManager to distinguish this for us.


getNextObject

public static ObjectReference getNextObject(ObjectReference obj,
                                            RVMClass type)
Get the next scalar in the heap under contiguous allocation. Handles alignment issues


getNextObject

public static ObjectReference getNextObject(ObjectReference obj,
                                            RVMArray type,
                                            int numElements)
Get the next array in the heap under contiguous allocation. Handles alignment issues


getReferenceWhenCopiedTo

public static Object getReferenceWhenCopiedTo(Object obj,
                                              Address to,
                                              RVMArray type)
Get the reference of an array when copied to the specified region.


getReferenceWhenCopiedTo

public static Object getReferenceWhenCopiedTo(Object obj,
                                              Address to,
                                              RVMClass type)
Get the reference of a scalar when copied to the specified region.


getReferenceWhenCopiedTo

protected static Object getReferenceWhenCopiedTo(Object obj,
                                                 Address to)

moveObject

public static Object moveObject(Address toAddress,
                                Object fromObj,
                                int numBytes,
                                RVMClass type)
Copy a scalar to the given raw storage address


moveObject

public static Object moveObject(Object fromObj,
                                Object toObj,
                                int numBytes,
                                RVMClass type)
Copy an array to the given location.


moveObject

public static Object moveObject(Address toAddress,
                                Object fromObj,
                                int numBytes,
                                RVMArray type)
Copy an array to the given raw storage address


moveObject

public static Object moveObject(Object fromObj,
                                Object toObj,
                                int numBytes,
                                RVMArray type)
Copy an array to the given location.


moveObject

public static Object moveObject(Address toAddress,
                                Object fromObj,
                                Object toObj,
                                int numBytes)
Copy an object to the given raw storage address


getObjectHashCode

public static int getObjectHashCode(Object o)
Get the hash code of an object.


installHashCode

protected static int installHashCode(Object o)
Install a new hashcode (only used if !ADDRESS_BASED_HASHING)


getThinLockOffset

public static Offset getThinLockOffset(Object o)
Get the offset of the thin lock word in this object


defaultThinLockOffset

public static Offset defaultThinLockOffset()
what is the default offset for a thin lock?


allocateThinLock

public static void allocateThinLock(RVMType t)
Allocate a thin lock word for instances of the type (if they already have one, then has no effect).


genericLock

public static void genericLock(Object o)
Generic lock


genericUnlock

public static void genericUnlock(Object o)
Generic unlock


holdsLock

public static boolean holdsLock(Object obj,
                                RVMThread thread)
Parameters:
obj - an object
thread - a thread
Returns:
true if the lock on obj is currently owned by thread false if it is not.

getHeavyLock

public static Lock getHeavyLock(Object o,
                                boolean create)
Obtains the heavy-weight lock, if there is one, associated with the indicated object. Returns null, if there is no heavy-weight lock associated with the object.

Parameters:
o - the object from which a lock is desired
create - if true, create heavy lock if none found
Returns:
the heavy-weight lock on the object (if any)

readAvailableBitsWord

public static Word readAvailableBitsWord(Object o)
Non-atomic read of word containing available bits


readAvailableByte

public static byte readAvailableByte(Object o)
Non-atomic read of byte containing available bits


writeAvailableBitsWord

public static void writeAvailableBitsWord(Object o,
                                          Word val)
Non-atomic write of word containing available bits


writeAvailableByte

public static void writeAvailableByte(BootImageInterface bootImage,
                                      Address ref,
                                      byte val)
Non-atomic write of word containing available bits


writeAvailableByte

public static void writeAvailableByte(Object o,
                                      byte val)
Non-atomic write of byte containing available bits


testAvailableBit

public static boolean testAvailableBit(Object o,
                                       int idx)
Return true if argument bit is 1, false if it is 0


setAvailableBit

public static void setAvailableBit(Object o,
                                   int idx,
                                   boolean flag)
Set argument bit to 1 if value is true, 0 if value is false


initializeAvailableByte

public static void initializeAvailableByte(Object o)
Freeze the other bits in the byte containing the available bits so that it is safe to update them using setAvailableBits.


prepareAvailableBits

public static Word prepareAvailableBits(Object o)
A prepare on the word containing the available bits


attemptAvailableBits

public static boolean attemptAvailableBits(Object o,
                                           Word oldVal,
                                           Word newVal)
An attempt on the word containing the available bits


minimumObjectRef

public static Address minimumObjectRef(Address regionBaseAddr)
Given the smallest base address in a region, return the smallest object reference that could refer to an object in the region.


maximumObjectRef

public static Address maximumObjectRef(Address regionHighAddr)
Given the largest base address in a region, return the largest object reference that could refer to an object in the region.


computeScalarHeaderSize

public static int computeScalarHeaderSize(RVMClass type)
Compute the header size of an instance of the given type.


computeArrayHeaderSize

public static int computeArrayHeaderSize(RVMArray type)
Compute the header size of an instance of the given type.


getAlignment

public static int getAlignment(RVMClass t)
Return the desired aligment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMClass.

Parameters:
t - RVMClass instance being created

getAlignment

public static int getAlignment(RVMClass t,
                               Object obj)
Return the desired aligment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMClass.

Parameters:
t - RVMClass instance being copied
obj - the object being copied

getAlignment

public static int getAlignment(RVMArray t)
Return the desired alignment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMArray.

Parameters:
t - RVMArray instance being created

getAlignment

public static int getAlignment(RVMArray t,
                               Object obj)
Return the desired alignment of the alignment point returned by getOffsetForAlignment in instances of the argument RVMArray.

Parameters:
t - RVMArray instance being copied
obj - the object being copied

getOffsetForAlignment

public static int getOffsetForAlignment(RVMClass t,
                                        boolean needsIdentityHash)
Return the offset relative to physical beginning of object that must be aligned.

Parameters:
t - RVMClass instance being created

getOffsetForAlignment

public static int getOffsetForAlignment(RVMClass t,
                                        ObjectReference obj)
Return the offset relative to physical beginning of object that must be aligned.

Parameters:
t - RVMClass instance being copied
obj - the object being copied

getOffsetForAlignment

public static int getOffsetForAlignment(RVMArray t,
                                        boolean needsIdentityHash)
Return the offset relative to physical beginning of object that must be aligned.

Parameters:
t - RVMArray instance being created

getOffsetForAlignment

public static int getOffsetForAlignment(RVMArray t,
                                        ObjectReference obj)
Return the offset relative to physical beginning of object that must be aligned.

Parameters:
t - RVMArray instance being copied
obj - the object being copied

initializeScalarHeader

public static Object initializeScalarHeader(Address ptr,
                                            TIB tib,
                                            int size)
Perform any required initialization of the JAVA portion of the header.

Parameters:
ptr - the raw storage to be initialized
tib - the TIB of the instance being created
size - the number of bytes allocated by the GC system for this object.

initializeScalarHeader

public static Address initializeScalarHeader(BootImageInterface bootImage,
                                             Address ptr,
                                             TIB tib,
                                             int size,
                                             boolean needsIdentityHash,
                                             int identityHashValue)
Perform any required initialization of the JAVA portion of the header.

Parameters:
bootImage - The bootimage being written
ptr - The object ref to the storage to be initialized
tib - The TIB of the instance being created
size - The number of bytes allocated by the GC system for this object.
needsIdentityHash - needs an identity hash value
identityHashValue - the value for the identity hash
Returns:
the address used for a reference to this object

initializeArrayHeader

public static Object initializeArrayHeader(Address ptr,
                                           TIB tib,
                                           int size)
Perform any required initialization of the JAVA portion of the header.

Parameters:
ptr - the raw storage to be initialized
tib - the TIB of the instance being created
size - the number of bytes allocated by the GC system for this object.

initializeArrayHeader

public static Address initializeArrayHeader(BootImageInterface bootImage,
                                            Address ptr,
                                            TIB tib,
                                            int size,
                                            int numElements,
                                            boolean needsIdentityHash,
                                            int identityHashValue)
Perform any required initialization of the JAVA portion of the header.

Parameters:
bootImage - the bootimage being written
ptr - the object ref to the storage to be initialized
tib - the TIB of the instance being created
size - the number of bytes allocated by the GC system for this object.
numElements - the number of elements in the array
Returns:
the address used for a reference to this object

dumpHeader

public static void dumpHeader(Object ref)
For low level debugging of GC subsystem. Dump the header word(s) of the given object reference.

Parameters:
ref - the object reference whose header should be dumped

baselineEmitLoadTIB

public static void baselineEmitLoadTIB(ArchitectureSpecific.Assembler asm,
                                       int dest,
                                       int object)
The following method will emit code that moves a reference to an object's TIB into a destination register.

Parameters:
asm - the assembler object to emit code with
dest - the number of the destination register
object - the number of the register holding the object reference