org.mmtk.plan
Class Simple

java.lang.Object
  extended by org.mmtk.plan.Plan
      extended by org.mmtk.plan.Simple
All Implemented Interfaces:
Constants
Direct Known Subclasses:
Concurrent, StopTheWorld

public abstract class Simple
extends Plan
implements Constants

This abstract class implements the core functionality for simple collectors.

This class defines the collection phases, and provides base level implementations of them. Subclasses should provide implementations for the spaces that they introduce, and delegate up the class hierarchy.

For details of the split between global and thread-local operations

See Also:
Plan

Field Summary
static short CLOSURE
           
 short collection
          This is the phase that is executed to perform a collection.
protected  int collectionAttempt
          The current collection attempt.
static short COMPLETE
           
protected static short completeClosurePhase
          Complete closure including reference types and finalizable objects.
static short FINALIZABLE
           
private static Timer finalizeTime
           
protected static short finishPhase
          The collection scheme - this is a small tree of complex phases.
static short FORWARD
           
static short FORWARD_FINALIZABLE
           
static short FORWARD_REFS
           
protected static short forwardPhase
          Ensure that all references in the system are correct.
static short INITIATE
           
protected static short initPhase
          Start the collection, including preparation for any collected spaces.
static short PHANTOM_REFS
           
static short POST_SANITY_PLACEHOLDER
           
static short PRE_SANITY_PLACEHOLDER
           
static short PREPARE
           
static short PREPARE_STACKS
           
protected static short prepareStacks
          Ensure stacks are ready to be scanned
protected static short refTypeClosurePhase
          Complete closure including reference types and finalizable objects.
private static Timer refTypeTime
          Constants
static short RELEASE
           
protected static short rootClosurePhase
          Perform the initial determination of liveness from the roots.
static short ROOTS
           
static short SANITY_BUILD_TABLE
           
static short SANITY_CHECK_TABLE
           
static short SANITY_COPY_ROOTS
           
static short SANITY_PREPARE
           
static short SANITY_RELEASE
           
static short SANITY_ROOTS
           
static short SANITY_SET_POSTGC
           
static short SANITY_SET_PREGC
           
protected static short sanityBuildPhase
          Trace and set up a sanity table
protected static short sanityCheckPhase
          Validate a sanity table
private static Timer scanTime
           
static short SET_COLLECTION_KIND
           
static short SOFT_REFS
           
static short STACK_ROOTS
           
static short WEAK_REFS
           
static short WEAK_TRACK_REFS
           
 
Fields inherited from class org.mmtk.plan.Plan
ALLOC_CODE, ALLOC_COLD_CODE, ALLOC_DEFAULT, ALLOC_GCSPY, ALLOC_HOT_CODE, ALLOC_IMMORTAL, ALLOC_LARGE_CODE, ALLOC_LOS, ALLOC_NON_MOVING, ALLOC_NON_REFERENCE, ALLOC_PRIMITIVE_LOS, ALLOC_STACK, allocationSiteCount, ALLOCATORS, concurrentWorkers, controlCollectorContext, DEFAULT_MAX_NURSERY, DEFAULT_MIN_NURSERY, DEFAULT_SITE, defaultCollectorContext, emergencyCollection, GATHER_WRITE_BARRIER_STATS, GC_PREPARE, GC_PROPER, IMMORTAL, immortalSpace, insideHarness, internalTriggeredCollection, LARGE_CODE, largeCodeSpace, lastInternalTriggeredCollection, LOS, loSpace, MAX_NON_LOS_COPY_BYTES, MAX_NON_LOS_DEFAULT_ALLOC_BYTES, MAX_NON_LOS_NONMOVING_ALLOC_BYTES, META, metaDataSpace, NEEDS_LOG_BIT_IN_HEADER, NON_MOVING, NON_PARTICIPANT, nonMovingSpace, NOT_IN_GC, parallelWorkers, pretenureThreshold, SANITY, sanityChecker, sanitySpace, SCAN_BOOT_IMAGE, SMALL_CODE, smallCodeSpace, stacksPrepared, totalTime, USE_CODE_SPACE, userTriggeredCollection, VM_SPACE, vmSpace
 
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
Simple()
           
 
Method Summary
 void collectionPhase(short phaseId)
          Perform a (global) collection phase.
 void replacePhase(int oldScheduledPhase, int newScheduledPhase)
          Replace a phase.
 void replacePlaceholderPhase(short placeHolderPhase, int newScheduledPhase)
          Replace a placeholder phase.
protected  void switchNurseryZeroingApproach(Space nurserySpace)
          Update the nursery zeroing approach based on option settings.
 
Methods inherited from class org.mmtk.plan.Plan
availableMemory, bootTimeWriteBarrier, collectionRequired, concurrentCollectionRequired, enableAllocation, enableCollection, forceFullHeapCollection, freeMemory, fullyBooted, gcInProgress, gcInProgressProper, getAllocationSite, getCollectionReserve, getPagesAvail, getPagesReserved, getPagesUsed, getSpecializedScanClass, getTotalPages, handleUserCollectionRequest, harnessBegin, harnessEnd, insertPhaseAfter, isCurrentGCNursery, isEmergencyCollection, isInitialized, isInternalTriggeredCollection, isUserTriggeredCollection, lastCollectionFullHeap, lastCollectionWasExhaustive, loadObjectReference, logPoll, notifyExit, poll, printDetailedTiming, printPostStats, printPreStats, printUsedPages, processOptions, registerSpecializedMethods, reservedMemory, resetCollectionTrigger, sanityExpectedRC, sanityLinearScan, setGCStatus, stacksPrepared, startGCspyServer, storeObjectReference, stressTestGCRequired, totalMemory, triggerInternalCollectionRequest, usedMemory, willNeverMove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

refTypeTime

private static final Timer refTypeTime
Constants


scanTime

private static final Timer scanTime

finalizeTime

private static final Timer finalizeTime

SET_COLLECTION_KIND

public static final short SET_COLLECTION_KIND

INITIATE

public static final short INITIATE

PREPARE

public static final short PREPARE

PREPARE_STACKS

public static final short PREPARE_STACKS

STACK_ROOTS

public static final short STACK_ROOTS

ROOTS

public static final short ROOTS

CLOSURE

public static final short CLOSURE

SOFT_REFS

public static final short SOFT_REFS

WEAK_REFS

public static final short WEAK_REFS

FINALIZABLE

public static final short FINALIZABLE

WEAK_TRACK_REFS

public static final short WEAK_TRACK_REFS

PHANTOM_REFS

public static final short PHANTOM_REFS

FORWARD

public static final short FORWARD

FORWARD_REFS

public static final short FORWARD_REFS

FORWARD_FINALIZABLE

public static final short FORWARD_FINALIZABLE

RELEASE

public static final short RELEASE

COMPLETE

public static final short COMPLETE

PRE_SANITY_PLACEHOLDER

public static final short PRE_SANITY_PLACEHOLDER

POST_SANITY_PLACEHOLDER

public static final short POST_SANITY_PLACEHOLDER

SANITY_SET_PREGC

public static final short SANITY_SET_PREGC

SANITY_SET_POSTGC

public static final short SANITY_SET_POSTGC

SANITY_PREPARE

public static final short SANITY_PREPARE

SANITY_ROOTS

public static final short SANITY_ROOTS

SANITY_COPY_ROOTS

public static final short SANITY_COPY_ROOTS

SANITY_BUILD_TABLE

public static final short SANITY_BUILD_TABLE

SANITY_CHECK_TABLE

public static final short SANITY_CHECK_TABLE

SANITY_RELEASE

public static final short SANITY_RELEASE

prepareStacks

protected static final short prepareStacks
Ensure stacks are ready to be scanned


sanityBuildPhase

protected static final short sanityBuildPhase
Trace and set up a sanity table


sanityCheckPhase

protected static final short sanityCheckPhase
Validate a sanity table


initPhase

protected static final short initPhase
Start the collection, including preparation for any collected spaces.


rootClosurePhase

protected static final short rootClosurePhase
Perform the initial determination of liveness from the roots.


refTypeClosurePhase

protected static final short refTypeClosurePhase
Complete closure including reference types and finalizable objects.


forwardPhase

protected static final short forwardPhase
Ensure that all references in the system are correct.


completeClosurePhase

protected static final short completeClosurePhase
Complete closure including reference types and finalizable objects.


finishPhase

protected static final short finishPhase
The collection scheme - this is a small tree of complex phases.


collection

public short collection
This is the phase that is executed to perform a collection.


collectionAttempt

protected int collectionAttempt
The current collection attempt.

Constructor Detail

Simple

public Simple()
Method Detail

collectionPhase

public void collectionPhase(short phaseId)
Perform a (global) collection phase.

Specified by:
collectionPhase in class Plan
Parameters:
phaseId - The unique id of the phase to perform.

switchNurseryZeroingApproach

protected void switchNurseryZeroingApproach(Space nurserySpace)
Update the nursery zeroing approach based on option settings.

Parameters:
nurserySpace - The space to apply the changes to.

replacePhase

public void replacePhase(int oldScheduledPhase,
                         int newScheduledPhase)
Replace a phase. Used for example to replace a placeholder.

Overrides:
replacePhase in class Plan
Parameters:
oldScheduledPhase - The scheduled phase to insert after
newScheduledPhase - The scheduled phase to insert

replacePlaceholderPhase

public void replacePlaceholderPhase(short placeHolderPhase,
                                    int newScheduledPhase)
Replace a placeholder phase.

Parameters:
placeHolderPhase - The placeholder phase
newScheduledPhase - The new scheduled phase.