org.mmtk.plan
Class TransitiveClosure

java.lang.Object
  extended by org.mmtk.plan.TransitiveClosure
Direct Known Subclasses:
GenRCModifiedProcessor, ImmortalSpaceDriver.Closure, ObjectReferenceBuffer, RCModifiedProcessor, RCZero, TraceLocal, TraceWriteBuffer

public abstract class TransitiveClosure
extends Object

This abstract class is the fundamental mechanism for performing a transitive closure over an object graph.

Some mechanisms only operate on nodes or edges, but due to limitations of inheritance we have combined these two here.

See Also:
TraceLocal

Field Summary
protected  int specializedScan
          The specialized scan identifier
private static Class<?>[] specializedScans
          Database of specialized scan classes.
 
Constructor Summary
protected TransitiveClosure()
          Constructor
protected TransitiveClosure(int specializedScan)
          Constructor
 
Method Summary
static Class<?> getSpecializedScanClass(int id)
          Get the specialized scan with the given id.
 void processEdge(ObjectReference source, Address slot)
          Trace an edge during GC.
 void processNode(ObjectReference object)
          Trace a node during GC.
static void registerSpecializedScan(int id, Class<?> specializedScanClass)
          A transitive closure has been created that is designed to work with a specialized scan method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

specializedScans

private static final Class<?>[] specializedScans
Database of specialized scan classes.


specializedScan

protected final int specializedScan
The specialized scan identifier

Constructor Detail

TransitiveClosure

protected TransitiveClosure()
Constructor


TransitiveClosure

protected TransitiveClosure(int specializedScan)
Constructor

Parameters:
specializedScan - The specialized scan for this trace.
Method Detail

registerSpecializedScan

public static void registerSpecializedScan(int id,
                                           Class<?> specializedScanClass)
A transitive closure has been created that is designed to work with a specialized scan method. We must register it here so the specializer can return the class when queried.

Parameters:
id - The method id to register.
specializedScanClass - The class to register.

getSpecializedScanClass

public static Class<?> getSpecializedScanClass(int id)
Get the specialized scan with the given id.


processEdge

public void processEdge(ObjectReference source,
                        Address slot)
Trace an edge during GC.

Parameters:
source - The source of the reference.
slot - The location containing the object reference.

processNode

public void processNode(ObjectReference object)
Trace a node during GC.

Parameters:
object - The object to be processed.