org.mmtk.utility.deque
Class ObjectReferenceBuffer

java.lang.Object
  extended by org.mmtk.plan.TransitiveClosure
      extended by org.mmtk.utility.deque.ObjectReferenceBuffer
All Implemented Interfaces:
Constants
Direct Known Subclasses:
RCDecBuffer

public abstract class ObjectReferenceBuffer
extends TransitiveClosure
implements Constants

This class is a combination of a Deque and a TraceStep, designed to include intelligent processing of child references as objects are scanned.

See Also:
TransitiveClosure

Field Summary
private  ObjectReferenceDeque values
           
 
Fields inherited from class org.mmtk.plan.TransitiveClosure
specializedScan
 
Fields inherited from interface org.mmtk.utility.Constants
ALIGNMENT_VALUE, ARRAY_ELEMENT, BITS_IN_ADDRESS, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_INT, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_INT, BYTES_IN_KBYTE, BYTES_IN_MBYTE, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, CARD_MASK, CARD_META_PAGES_PER_REGION, INSTANCE_FIELD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_INT, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_ADDRESS_SPACE, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_INT, LOG_BYTES_IN_KBYTE, LOG_BYTES_IN_MBYTE, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD, LOG_CARD_BYTES, LOG_CARD_GRAIN, LOG_CARD_META_BYTES, LOG_CARD_META_PAGES, LOG_CARD_META_SIZE, LOG_CARD_UNITS, LOG_MIN_ALIGNMENT, MAX_ALIGNMENT, MAX_BYTES_PADDING, MAX_INT, MIN_ALIGNMENT, MIN_INT, SUPPORT_CARD_SCANNING
 
Constructor Summary
ObjectReferenceBuffer(String name, SharedDeque queue)
          Constructor
 
Method Summary
 void flushLocal()
          Flushes all local state back to the shared queue.
 boolean isEmpty()
           
 boolean isFlushed()
          Return true if this buffer is locally empty
 ObjectReference pop()
          Retrieves an object.
protected abstract  void process(ObjectReference object)
          This is the method that ensures
 void processChildren(ObjectReference object)
          Process each of the child objects for the passed object.
 void processEdge(ObjectReference source, Address slot)
          Trace an edge during GC.
 void push(ObjectReference object)
          Pushes an object onto the queue, forcing an inlined sequence.
 void pushOOL(ObjectReference object)
          Pushes an object onto the queue, forcing an out of line sequence.
 
Methods inherited from class org.mmtk.plan.TransitiveClosure
getSpecializedScanClass, processNode, registerSpecializedScan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

private final ObjectReferenceDeque values
Constructor Detail

ObjectReferenceBuffer

public ObjectReferenceBuffer(String name,
                             SharedDeque queue)
Constructor

Parameters:
name - The name of the underlying deque.
queue - The shared deque that is used.
Method Detail

processEdge

public final void processEdge(ObjectReference source,
                              Address slot)
Description copied from class: TransitiveClosure
Trace an edge during GC.

Overrides:
processEdge in class TransitiveClosure
Parameters:
source - The source of the reference.
slot - The location containing the object reference.

process

protected abstract void process(ObjectReference object)
This is the method that ensures

Parameters:
object - The object to process.

processChildren

public final void processChildren(ObjectReference object)
Process each of the child objects for the passed object.

Parameters:
object - The object to process the children of.

push

public final void push(ObjectReference object)
Pushes an object onto the queue, forcing an inlined sequence.

Parameters:
object - The object to push.

pushOOL

public final void pushOOL(ObjectReference object)
Pushes an object onto the queue, forcing an out of line sequence.

Parameters:
object - The object to push.

pop

public final ObjectReference pop()
Retrieves an object.

Returns:
The object retrieved.

isEmpty

public final boolean isEmpty()

flushLocal

public final void flushLocal()
Flushes all local state back to the shared queue.


isFlushed

public final boolean isFlushed()
Return true if this buffer is locally empty