|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.plan.TransitiveClosure org.mmtk.plan.TraceLocal
public abstract class TraceLocal
This abstract class and its global counterpart implement the core functionality for a transitive closure over the heap graph. This class specifically implements the unsynchronized thread-local component (ie the 'fast path') of the trace mechanism.
Plan
,
Trace
Field Summary | |
---|---|
protected AddressDeque |
rootLocations
delayed root slots |
protected ObjectReferenceDeque |
values
gray objects |
Fields inherited from class org.mmtk.plan.TransitiveClosure |
---|
specializedScan |
Constructor Summary | |
---|---|
TraceLocal(int specializedScan,
Trace trace)
Constructor |
|
TraceLocal(Trace trace)
Constructor |
Method Summary | |
---|---|
private void |
assertMutatorRemsetsFlushed()
Assert that the remsets have been flushed. |
void |
completeTrace()
Finishing processing all GC work. |
void |
flush()
Flush the local buffers of all deques. |
ObjectReference |
getForwardedFinalizable(ObjectReference object)
If a Finalizable object has moved, return the new location. |
ObjectReference |
getForwardedReference(ObjectReference object)
If the referenced object has moved, return the new location. |
ObjectReference |
getForwardedReferenceType(ObjectReference object)
If the Reference Type object has moved, return the new location. |
ObjectReference |
getForwardedReferent(ObjectReference object)
If the reference object (from a Reference Type) has object has moved, return the new location. |
boolean |
incrementalTrace(int workLimit)
Process GC work until either complete or workLimit units of work are completed. |
boolean |
isLive(ObjectReference object)
Is the specified object live? |
boolean |
isReachable(ObjectReference object)
Is the specified object reachable? |
boolean |
isReferentLive(ObjectReference object)
Is the specified referent of a reference type object live? |
protected void |
logMessage(int minVerbose,
String message)
This method logs a message with prepended thread id, if the verbosity level is greater or equal to the passed level. |
protected boolean |
overwriteReferenceDuringTrace()
Should reference values be overwritten as the heap is traced? |
void |
prepare()
TODO write JavaDoc comment |
void |
processEdge(ObjectReference source,
Address slot)
Trace a reference during GC. |
void |
processInteriorEdge(ObjectReference target,
Address slot,
boolean root)
Trace a reference during GC. |
void |
processNode(ObjectReference object)
Add a gray object |
protected void |
processRememberedSets()
Flush any remembered sets pertaining to the current collection. |
void |
processRootEdge(Address slot,
boolean untraced)
Trace a reference during GC. |
void |
processRoots()
Process any roots for which processing was delayed. |
boolean |
readyToFinalize(ObjectReference object)
Return true if an object is ready to move to the finalizable queue, i.e. it has no regular references to it. |
void |
release()
|
void |
reportDelayedRootEdge(Address slot)
Report a root edge to be processed during GC. |
ObjectReference |
retainForFinalize(ObjectReference object)
An object is unreachable and is about to be added to the finalizable queue. |
ObjectReference |
retainReferent(ObjectReference object)
Make alive a referent object that is known not to be live (isLive is false). |
protected void |
scanObject(ObjectReference object)
Collectors that move objects must override this method. |
ObjectReference |
traceObject(ObjectReference object)
This method is the core method during the trace of the object graph. |
ObjectReference |
traceObject(ObjectReference object,
boolean root)
This method traces an object with knowledge of the fact that object is a root or not. |
boolean |
willNotMoveInCurrentCollection(ObjectReference object)
Ensure that the referenced object will not move from this point through to the end of the collection. |
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 |
Field Detail |
---|
protected final ObjectReferenceDeque values
protected final AddressDeque rootLocations
Constructor Detail |
---|
public TraceLocal(Trace trace)
trace
- The global trace class to use.public TraceLocal(int specializedScan, Trace trace)
specializedScan
- The specialized scan id.trace
- The global trace class to use.Method Detail |
---|
protected boolean overwriteReferenceDuringTrace()
public final void processEdge(ObjectReference source, Address slot)
trace
method.
processEdge
in class TransitiveClosure
source
- The source of the reference.slot
- The location containing the object reference to be
traced. The object reference is NOT an interior pointer.public final void reportDelayedRootEdge(Address slot)
slot
- The location containing the object reference to be
traced. The object reference is NOT an interior pointer.public final void processRootEdge(Address slot, boolean untraced)
trace
method.
slot
- The location containing the object reference to be
traced. The object reference is NOT an interior pointer.untraced
- true
if objLoc
is an untraced root.public final void processInteriorEdge(ObjectReference target, Address slot, boolean root)
trace
method.
target
- The object the interior edge points within.slot
- The location of the interior edge.root
- true
if this is a root edge.protected void scanObject(ObjectReference object)
object
- The forwarded object to be scannedpublic final void processNode(ObjectReference object)
processNode
in class TransitiveClosure
object
- The object to be enqueuedpublic final void flush()
public boolean isLive(ObjectReference object)
object
- The object.
true
if the object is live.public boolean isReachable(ObjectReference object)
object
- The object.
true
if the object is live.public boolean isReferentLive(ObjectReference object)
object
- The object.
true
if the reference object is live.public ObjectReference traceObject(ObjectReference object)
object
- The object to be traced.
public ObjectReference traceObject(ObjectReference object, boolean root)
object
- The object to be traced.root
- Is this object a root?
public boolean willNotMoveInCurrentCollection(ObjectReference object)
object
- The object that must not move during the collection.
true
If the object will not move during collectionpublic ObjectReference getForwardedFinalizable(ObjectReference object)
object
- The object which may have been forwarded.
object
.public ObjectReference getForwardedReferent(ObjectReference object)
object
- The object which may have been forwarded.
object
.public ObjectReference getForwardedReferenceType(ObjectReference object)
object
- The object which may have been forwarded.
object
.public ObjectReference getForwardedReference(ObjectReference object)
object
- The object which may have been forwarded.
object
.public ObjectReference retainReferent(ObjectReference object)
traceObject
, which is implemented here. Other
collectors must override this method.
object
- The object which is to be made alive.
public ObjectReference retainForFinalize(ObjectReference object)
For many collectors these semantics reflect those of
traceObject
, which is implemented here. Other
collectors must override this method.
object
- The object which may have been forwarded.
object
. In this
case return object
, copying collectors must override
this method.public boolean readyToFinalize(ObjectReference object)
isLive
, which is implemented here. Other
collectors must override this method.
object
- The object being queried.
true
if the object has no regular references
to it.public void prepare()
public void release()
public void processRoots()
public void completeTrace()
public boolean incrementalTrace(int workLimit)
workLimit
- The maximum units of work to perform.
true
if all work was completed within workLimit.protected void processRememberedSets()
private void assertMutatorRemsetsFlushed()
protected final void logMessage(int minVerbose, String message)
minVerbose
- The required verbosity levelmessage
- The message to display
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |