Modifier and Type | Field and Description |
---|---|
private static SynchronizedCounter |
threadCounter
Counter to track index into thread table for root tracing.
|
Constructor and Description |
---|
Scanning() |
Modifier and Type | Method and Description |
---|---|
void |
computeBootImageRoots(TraceLocal trace)
Compute all roots out of the VM's boot image (if any).
|
void |
computeGlobalRoots(TraceLocal trace)
Computes global roots.
|
void |
computeNewThreadRoots(TraceLocal trace)
Computes new roots pointed to by threads, their associated registers
and stacks.
|
void |
computeStaticRoots(TraceLocal trace)
Computes static roots.
|
void |
computeThreadRoots(TraceLocal trace)
Computes roots pointed to by threads, their associated registers
and stacks.
|
private void |
computeThreadRoots(TraceLocal trace,
boolean newRootsSufficient)
Compute roots pointed to by threads.
|
void |
notifyInitialThreadScanComplete(boolean partialScan)
Called the first time during a collection that thread's stacks
have been scanned.
|
void |
resetThreadCounter()
Prepares for using the
computeAllRoots method. |
void |
scanObject(TransitiveClosure trace,
ObjectReference object)
Scanning of a object, processing each pointer field encountered.
|
void |
specializedScanObject(int id,
TransitiveClosure trace,
ObjectReference object)
Invoke a specialized scan method.
|
boolean |
supportsReturnBarrier() |
private static final SynchronizedCounter threadCounter
public Scanning()
public void scanObject(TransitiveClosure trace, ObjectReference object)
scanObject
in class Scanning
trace
- The closure being used.object
- The object to be scanned.public void specializedScanObject(int id, TransitiveClosure trace, ObjectReference object)
Scanning
specializedScanObject
in class Scanning
id
- The specialized method idtrace
- The trace the method has been specialized forobject
- The object to be scannedpublic void resetThreadCounter()
Scanning
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).resetThreadCounter
in class Scanning
public void notifyInitialThreadScanComplete(boolean partialScan)
Scanning
notifyInitialThreadScanComplete
in class Scanning
partialScan
- whether the scan was partial or full-heappublic void computeStaticRoots(TraceLocal trace)
threadCounter
must be reset so that load
balancing parallel GC can share the work of scanning threads.
computeStaticRoots
in class Scanning
trace
- The trace to use for computing roots.public void computeGlobalRoots(TraceLocal trace)
threadCounter
must be reset so that load
balancing parallel GC can share the work of scanning threads.
computeGlobalRoots
in class Scanning
trace
- The trace to use for computing roots.public void computeThreadRoots(TraceLocal trace)
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:
threadCounter
must be reset so that load
balancing parallel GC can share the work of scanning threads.
computeThreadRoots
in class Scanning
trace
- The trace to use for computing roots.public void computeNewThreadRoots(TraceLocal trace)
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:
threadCounter
must be reset so that load
balancing parallel GC can share the work of scanning threads.
computeNewThreadRoots
in class Scanning
trace
- The trace to use for computing roots.private void computeThreadRoots(TraceLocal trace, boolean newRootsSufficient)
trace
- The trace to use for computing roots.newRootsSufficient
- True if it sufficient for this method to only
compute those roots that are new since the previous stack scan. If false
then all roots must be computed (both new and preexisting).public void computeBootImageRoots(TraceLocal trace)
Scanning
computeBootImageRoots
in class Scanning
trace
- The trace object to use to report root locations.public boolean supportsReturnBarrier()
supportsReturnBarrier
in class Scanning