org.mmtk.plan.semispace.gctrace
Class GCTraceTraceLocal

java.lang.Object
  extended by org.mmtk.plan.TransitiveClosure
      extended by org.mmtk.plan.TraceLocal
          extended by org.mmtk.plan.semispace.SSTraceLocal
              extended by org.mmtk.plan.semispace.gctrace.GCTraceTraceLocal
All Implemented Interfaces:
Constants

public final class GCTraceTraceLocal
extends SSTraceLocal

This plan has been modified slightly to perform the processing necessary for GC trace generation. To maximize performance, it attempts to remain as faithful as possible to semiSpace/Plan.java.

 The generated trace format is as follows:
    B 345678 12
      (Object 345678 was created in the boot image with a size of 12 bytes)
    U 59843 234 47298
      (Update object 59843 at the slot at offset 234 to refer to 47298)
    S 1233 12345
      (Update static slot 1233 to refer to 12345)
    T 4567 78924
      (The TIB of 4567 is set to refer to 78924)
    D 342789
      (Object 342789 became unreachable)
    A 6860 24 346648 3
      (Object 6860 was allocated, requiring 24 bytes, with fp 346648 on
        thread 3; this allocation has perfect knowledge)
    a 6884 24 346640 5
      (Object 6864 was allocated, requiring 24 bytes, with fp 346640 on
 thread 5; this allocation DOES NOT have perfect knowledge)
    I 6860 24 346648 3
      (Object 6860 was allocated into immortal space, requiring 24 bytes,
        with fp 346648 on thread 3; this allocation has perfect knowledge)
    i 6884 24 346640 5
      (Object 6864 was allocated into immortal space, requiring 24 bytes,
        with fp 346640 on thread 5; this allocation DOES NOT have perfect
        knowledge)
    48954->[345]LObject;:blah()V:23   Ljava/lang/Foo;
      (Citation for: a) where the was allocated, fp of 48954,
         at the method with ID 345 -- or void Object.blah() -- and bytecode
         with offset 23; b) the object allocated is of type java.lang.Foo)
    D 342789 361460
      (Object 342789 became unreachable after 361460 was allocated)
 
This class implements a simple semi-space collector. See the Jones & Lins GC book, section 2.2 for an overview of the basic algorithm. This implementation also includes a large object space (LOS), and an uncollected "immortal" space.

All plans make a clear distinction between global and thread-local activities. Global activities must be synchronized, whereas no synchronization is required for thread-local activities. Instances of Plan map 1:1 to "kernel threads" (aka CPUs). Thus instance methods allow fast, unsychronized access to Plan utilities such as allocation and collection. Each instance rests on static resources (such as memory and virtual memory resources) which are "global" and therefore "static" members of Plan. This mapping of threads to instances is crucial to understanding the correctness and performance properties of this plan.


Field Summary
 
Fields inherited from class org.mmtk.plan.TraceLocal
rootLocations, 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
GCTraceTraceLocal(Trace trace)
          Constructor
 
Method Summary
 ObjectReference getForwardedReference(ObjectReference object)
          If the referenced object has moved, return the new location.
 boolean isLive(ObjectReference object)
          Is the specified object live?
 boolean isReachable(ObjectReference object)
          Return true if obj is a reachable object.
 ObjectReference traceObject(ObjectReference object)
          Trace a reference during GC.
 boolean willNotMoveInCurrentCollection(ObjectReference object)
          Is this object guaranteed not to move during the collection.
 
Methods inherited from class org.mmtk.plan.TraceLocal
completeTrace, flush, getForwardedFinalizable, getForwardedReferenceType, getForwardedReferent, incrementalTrace, isReferentLive, logMessage, overwriteReferenceDuringTrace, prepare, processEdge, processInteriorEdge, processNode, processRememberedSets, processRootEdge, processRoots, readyToFinalize, release, reportDelayedRootEdge, retainForFinalize, retainReferent, scanObject, traceObject
 
Methods inherited from class org.mmtk.plan.TransitiveClosure
getSpecializedScanClass, registerSpecializedScan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCTraceTraceLocal

public GCTraceTraceLocal(Trace trace)
Constructor

Parameters:
trace - The global trace to use.
Method Detail

traceObject

public ObjectReference traceObject(ObjectReference object)
Trace a reference during GC. This involves determining which collection policy applies (such as those needed for trace generation) and taking the appropriate actions.

Overrides:
traceObject in class SSTraceLocal
Parameters:
object - The object reference to be traced. In certain cases, this should NOT be an interior pointer.
Returns:
The possibly moved reference.

getForwardedReference

public ObjectReference getForwardedReference(ObjectReference object)
Description copied from class: TraceLocal
If the referenced object has moved, return the new location. Some copying collectors will need to override this method.

Overrides:
getForwardedReference in class TraceLocal
Parameters:
object - The object which may have been forwarded.
Returns:
The new location of object.

isLive

public boolean isLive(ObjectReference object)
Description copied from class: SSTraceLocal
Is the specified object live?

Overrides:
isLive in class SSTraceLocal
Parameters:
object - The object.
Returns:
true if the object is live.

isReachable

public boolean isReachable(ObjectReference object)
Return true if obj is a reachable object.

Overrides:
isReachable in class TraceLocal
Parameters:
object - The object in question
Returns:
True if obj is a reachable object; unreachable objects may still be live, however

willNotMoveInCurrentCollection

public boolean willNotMoveInCurrentCollection(ObjectReference object)
Is this object guaranteed not to move during the collection.

Overrides:
willNotMoveInCurrentCollection in class SSTraceLocal
Parameters:
object - The object to check.
Returns:
True if the object is guaranteed not to move.