org.mmtk.vm
Class Scanning

java.lang.Object
  extended by org.mmtk.vm.Scanning
All Implemented Interfaces:
Constants
Direct Known Subclasses:
Scanning

public abstract class Scanning
extends Object
implements Constants


Field Summary
 
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
Scanning()
           
 
Method Summary
abstract  void computeBootImageRoots(TraceLocal trace)
          Compute all roots out of the VM's boot image (if any).
abstract  void computeGlobalRoots(TraceLocal trace)
          Computes global roots.
abstract  void computeStaticRoots(TraceLocal trace)
          Computes static roots.
abstract  void computeThreadRoots(TraceLocal trace)
          Computes roots pointed to by threads, their associated registers and stacks.
abstract  void notifyInitialThreadScanComplete()
          Called the first time during a collection that thread's stacks have been scanned.
abstract  void resetThreadCounter()
          Prepares for using the computeAllRoots method.
abstract  void scanObject(TransitiveClosure trace, ObjectReference object)
          Delegated scanning of a object, processing each pointer field encountered.
abstract  void specializedScanObject(int id, TransitiveClosure trace, ObjectReference object)
          Invoke a specialized scan method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scanning

public Scanning()
Method Detail

scanObject

public abstract void scanObject(TransitiveClosure trace,
                                ObjectReference object)
Delegated scanning of a object, processing each pointer field encountered.

Parameters:
object - The object to be scanned.

specializedScanObject

public abstract void specializedScanObject(int id,
                                           TransitiveClosure trace,
                                           ObjectReference object)
Invoke a specialized scan method. Note that these methods must have been allocated explicitly through Plan and PlanConstraints.

Parameters:
id - The specialized method id
trace - The trace the method has been specialized for
object - The object to be scanned

resetThreadCounter

public abstract void resetThreadCounter()
Prepares for using the computeAllRoots method. The thread counter allows multiple GC threads to co-operatively iterate through the thread data structure (if load balancing parallel GC threads were not important, the thread counter could simply be replaced by a for loop).


notifyInitialThreadScanComplete

public abstract void notifyInitialThreadScanComplete()
Called the first time during a collection that thread's stacks have been scanned. This can be used (for example) to clean up obsolete compiled methods that are no longer being executed.


computeStaticRoots

public abstract void computeStaticRoots(TraceLocal trace)
Computes static roots. This method establishes all such roots for collection and places them in the root locations queue. This method should not have side effects (such as copying or forwarding of objects). There are a number of important preconditions:

Parameters:
trace - The trace to use for computing roots.

computeGlobalRoots

public abstract void computeGlobalRoots(TraceLocal trace)
Computes global roots. This method establishes all such roots for collection and places them in the root locations queue. This method should not have side effects (such as copying or forwarding of objects). There are a number of important preconditions:

Parameters:
trace - The trace to use for computing roots.

computeThreadRoots

public abstract void computeThreadRoots(TraceLocal trace)
Computes roots pointed to by threads, their associated registers and stacks. This method places these roots in the root values, root locations and interior root locations queues. This method should not have side effects (such as copying or forwarding of objects). There are a number of important preconditions:

Parameters:
trace - The trace to use for computing roots.

computeBootImageRoots

public abstract void computeBootImageRoots(TraceLocal trace)
Compute all roots out of the VM's boot image (if any). This method is a no-op in the case where the VM does not maintain an MMTk-visible Java space. However, when the VM does maintain a space (such as a boot image) which is visible to MMTk, that space could either be scanned by MMTk as part of its transitive closure over the whole heap, or as a (considerable) performance optimization, MMTk could avoid scanning the space if it is aware of all pointers out of that space. This method is used to establish the root set out of the scannable space in the case where such a space exists.

Parameters:
trace - The trace object to use to report root locations.