org.jikesrvm.objectmodel
Class MiscHeader

java.lang.Object
  extended by org.jikesrvm.objectmodel.MiscHeader
All Implemented Interfaces:
Constants, HeapLayoutConstants, MiscHeaderConstants, ThinLockConstants, TIBLayoutConstants, SizeConstants

public final class MiscHeader
extends Object
implements Constants, MiscHeaderConstants

Defines other header words not used for core Java language support of memory allocation. Typically these are extra header words used for various kinds of instrumentation or profiling.

See Also:
ObjectModel

Field Summary
private static Offset MISC_HEADER_START
           
(package private) static Offset OBJECT_DEATH_OFFSET
           
(package private) static Offset OBJECT_LINK_OFFSET
           
(package private) static Offset OBJECT_OID_OFFSET
           
private static Word oid
          The next object ID to be used.
private static Word prevAddress
          The address of the last object allocated into the header.
(package private) static int REQUESTED_BITS
          How many available bits does the misc header want to use?
private static Word time
          The current "time" for the trace being generated.
 
Fields inherited from interface org.jikesrvm.objectmodel.MiscHeaderConstants
GC_TRACING_HEADER_BYTES, GC_TRACING_HEADER_WORDS, NUM_BYTES_HEADER
 
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
MiscHeader()
           
 
Method Summary
static void dumpHeader(Object ref)
          For low level debugging of GC subsystem.
static Address getBootImageLink()
           
static Word getDeathTime(Object object)
           
static int getHeaderSize()
           
static ObjectReference getLink(Object ref)
           
static Word getOID()
           
static Word getOID(Object object)
           
static void initializeHeader(BootImageInterface bootImage, Address ref, TIB tib, int size, boolean isScalar)
          Perform any required initialization of the MISC portion of the header.
static void initializeHeader(Object obj, TIB tib, int size, boolean isScalar)
          Perform any required initialization of the MISC portion of the header.
static void setDeathTime(Object object, Word time_)
           
static void setLink(Object object, ObjectReference link)
           
static void setOID(Word oid_)
           
static void updateDeathTime(Object object)
           
static void updateTime(Word time_)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MISC_HEADER_START

private static final Offset MISC_HEADER_START

OBJECT_OID_OFFSET

static final Offset OBJECT_OID_OFFSET

OBJECT_DEATH_OFFSET

static final Offset OBJECT_DEATH_OFFSET

OBJECT_LINK_OFFSET

static final Offset OBJECT_LINK_OFFSET

REQUESTED_BITS

static final int REQUESTED_BITS
How many available bits does the misc header want to use?

See Also:
Constant Field Values

oid

private static Word oid
The next object ID to be used.


time

private static Word time
The current "time" for the trace being generated.


prevAddress

private static Word prevAddress
The address of the last object allocated into the header.

Constructor Detail

MiscHeader

public MiscHeader()
Method Detail

initializeHeader

public static void initializeHeader(Object obj,
                                    TIB tib,
                                    int size,
                                    boolean isScalar)
Perform any required initialization of the MISC portion of the header.

Parameters:
obj - 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.
isScalar - are we initializing a scalar (true) or array (false) object?

initializeHeader

public static void initializeHeader(BootImageInterface bootImage,
                                    Address ref,
                                    TIB tib,
                                    int size,
                                    boolean isScalar)
Perform any required initialization of the MISC portion of the header.

Parameters:
bootImage - the bootimage being written
ref - 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.
isScalar - are we initializing a scalar (true) or array (false) object?

updateDeathTime

public static void updateDeathTime(Object object)

setDeathTime

public static void setDeathTime(Object object,
                                Word time_)

setLink

public static void setLink(Object object,
                           ObjectReference link)

updateTime

public static void updateTime(Word time_)

getOID

public static Word getOID(Object object)

getDeathTime

public static Word getDeathTime(Object object)

getLink

public static ObjectReference getLink(Object ref)

getBootImageLink

public static Address getBootImageLink()

getOID

public static Word getOID()

setOID

public static void setOID(Word oid_)

getHeaderSize

public static int getHeaderSize()

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