org.mmtk.utility
Class HeaderByte

java.lang.Object
  extended by org.mmtk.utility.HeaderByte

public class HeaderByte
extends Object

This class provides generic support for operations over the GC byte within each object's header word. Specifically this class manages global status bits which cut across policies (for example the logging bit).

The general pattern for use of the GC byte is that the high order bits successively reserved for global use, as necessary. Any GC policy may use those bits that are not reserved for global use.


Field Summary
static boolean NEEDS_UNLOGGED_BIT
           
private static int TOTAL_BITS
           
static byte UNLOGGED_BIT
           
private static int UNLOGGED_BIT_NUMBER
           
static int USED_GLOBAL_BITS
           
 
Constructor Summary
HeaderByte()
           
 
Method Summary
static boolean isUnlogged(ObjectReference object)
          Return true if the specified object needs to be logged.
static void markAsLogged(ObjectReference object)
          Mark an object as logged.
static void markAsUnlogged(ObjectReference object)
           
static byte setBuildTimeGCByte(Address object, ObjectReference typeRef, int size)
          Perform any required initialization of the GC portion of the header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOTAL_BITS

private static final int TOTAL_BITS
See Also:
Constant Field Values

NEEDS_UNLOGGED_BIT

public static final boolean NEEDS_UNLOGGED_BIT

UNLOGGED_BIT_NUMBER

private static final int UNLOGGED_BIT_NUMBER

UNLOGGED_BIT

public static final byte UNLOGGED_BIT

USED_GLOBAL_BITS

public static final int USED_GLOBAL_BITS
Constructor Detail

HeaderByte

public HeaderByte()
Method Detail

setBuildTimeGCByte

public static byte setBuildTimeGCByte(Address object,
                                      ObjectReference typeRef,
                                      int size)
Perform any required initialization of the GC portion of the header. Called for objects created at boot time.

Parameters:
object - the Address representing the storage to be initialized
typeRef - the type reference for the instance being created
size - the number of bytes allocated by the GC system for this object.
Returns:
The new value of the status word

markAsUnlogged

public static void markAsUnlogged(ObjectReference object)

markAsLogged

public static void markAsLogged(ObjectReference object)
Mark an object as logged. Since duplicate logging does not raise any correctness issues, we do not worry about synchronization and allow threads to race to log the object, potentially including it twice (unlike reference counting where duplicates would lead to incorrect reference counts).

Parameters:
object - The object to be marked as logged

isUnlogged

public static boolean isUnlogged(ObjectReference object)
Return true if the specified object needs to be logged.

Parameters:
object - The object in question
Returns:
true if the object in question needs to be logged (remembered).