org.mmtk.policy.immix
Class ObjectHeader

java.lang.Object
  extended by org.mmtk.policy.immix.ObjectHeader

public class ObjectHeader
extends Object


Field Summary
(package private) static int AVAILABLE_LOCAL_BITS
          number of header bits we may use
static int GC_HEADER_WORDS_REQUIRED
           
static int GLOBAL_GC_BITS_REQUIRED
           
static int LOCAL_GC_BITS_REQUIRED
           
private static byte MARK_AND_FORWARDING_MASK
           
private static int MARK_BASE
           
static byte MARK_BASE_VALUE
           
private static byte MARK_INCREMENT
           
static byte MARK_MASK
           
(package private) static int MAX_MARKCOUNT_BITS
           
(package private) static byte NEW_OBJECT_MARK
           
static byte PINNED_BIT
           
static int PINNED_BIT_NUMBER
           
static byte STRADDLE_BIT
           
private static int STRADDLE_BIT_NUMBER
           
 
Constructor Summary
ObjectHeader()
           
 
Method Summary
(package private) static byte deltaMarkState(byte state, boolean increment)
          Return the mark state incremented or decremented by one.
(package private) static boolean isMatureObject(ObjectReference object)
           
(package private) static boolean isNewObject(ObjectReference object)
           
(package private) static boolean isPinnedObject(ObjectReference object)
           
(package private) static boolean isStraddlingObject(ObjectReference object)
           
(package private) static void markAsStraddling(ObjectReference object)
           
static void pinObject(ObjectReference object)
           
(package private) static void returnToPriorStateAndEnsureUnlogged(ObjectReference object, byte status)
           
(package private) static void setMarkStateUnlogAndUnlock(ObjectReference object, byte gcByte, byte markState)
           
(package private) static byte testAndMark(ObjectReference object, byte markState)
          Non-atomically test and set the mark bit of an object.
(package private) static boolean testMarkState(byte gcByte, byte value)
           
(package private) static boolean testMarkState(ObjectReference object, byte value)
          Return true if the mark count for an object has the given value.
(package private) static void writeMarkState(ObjectReference object, byte markState, boolean straddle)
          Write the allocState into the mark state fields of an object non-atomically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AVAILABLE_LOCAL_BITS

static final int AVAILABLE_LOCAL_BITS
number of header bits we may use


LOCAL_GC_BITS_REQUIRED

public static final int LOCAL_GC_BITS_REQUIRED

GLOBAL_GC_BITS_REQUIRED

public static final int GLOBAL_GC_BITS_REQUIRED
See Also:
Constant Field Values

GC_HEADER_WORDS_REQUIRED

public static final int GC_HEADER_WORDS_REQUIRED
See Also:
Constant Field Values

NEW_OBJECT_MARK

static final byte NEW_OBJECT_MARK
See Also:
Constant Field Values

PINNED_BIT_NUMBER

public static final int PINNED_BIT_NUMBER
See Also:
Constant Field Values

PINNED_BIT

public static final byte PINNED_BIT
See Also:
Constant Field Values

STRADDLE_BIT_NUMBER

private static final int STRADDLE_BIT_NUMBER
See Also:
Constant Field Values

STRADDLE_BIT

public static final byte STRADDLE_BIT
See Also:
Constant Field Values

MARK_BASE

private static final int MARK_BASE
See Also:
Constant Field Values

MAX_MARKCOUNT_BITS

static final int MAX_MARKCOUNT_BITS

MARK_INCREMENT

private static final byte MARK_INCREMENT
See Also:
Constant Field Values

MARK_MASK

public static final byte MARK_MASK

MARK_AND_FORWARDING_MASK

private static final byte MARK_AND_FORWARDING_MASK

MARK_BASE_VALUE

public static final byte MARK_BASE_VALUE
See Also:
Constant Field Values
Constructor Detail

ObjectHeader

public ObjectHeader()
Method Detail

testAndMark

static byte testAndMark(ObjectReference object,
                        byte markState)
Non-atomically test and set the mark bit of an object.

Parameters:
object - The object whose mark bit is to be written
markState - The value to which the mark bits will be set
Returns:
the old mark state

setMarkStateUnlogAndUnlock

static void setMarkStateUnlogAndUnlock(ObjectReference object,
                                       byte gcByte,
                                       byte markState)

testMarkState

static boolean testMarkState(ObjectReference object,
                             byte value)
Return true if the mark count for an object has the given value.

Parameters:
object - The object whose mark bit is to be tested
value - The value against which the mark bit will be tested
Returns:
true if the mark bit for the object has the given value.

testMarkState

static boolean testMarkState(byte gcByte,
                             byte value)

isNewObject

static boolean isNewObject(ObjectReference object)

isMatureObject

static boolean isMatureObject(ObjectReference object)

markAsStraddling

static void markAsStraddling(ObjectReference object)

isStraddlingObject

static boolean isStraddlingObject(ObjectReference object)

pinObject

public static void pinObject(ObjectReference object)

isPinnedObject

static boolean isPinnedObject(ObjectReference object)

writeMarkState

static void writeMarkState(ObjectReference object,
                           byte markState,
                           boolean straddle)
Write the allocState into the mark state fields of an object non-atomically. This is appropriate for collection time initialization.

Parameters:
object - The object whose mark state is to be written
markState - TODO: what am I?
straddle - TODO: what am I?

returnToPriorStateAndEnsureUnlogged

static void returnToPriorStateAndEnsureUnlogged(ObjectReference object,
                                                byte status)

deltaMarkState

static byte deltaMarkState(byte state,
                           boolean increment)
Return the mark state incremented or decremented by one.

Parameters:
increment - If true, then return the incremented value else return the decremented value
Returns:
the mark state incremented or decremented by one.