public class SSGCspyMutator extends SSMutator
SSGCspy
for an overview of the GC-spy mechanisms.SSMutator
,
SSGCspy
,
SSGCspyCollector
,
StopTheWorldMutator
,
MutatorContext
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
private BumpPointer |
gcspy
Per-mutator allocator into GCspy's space
|
private static boolean |
LOS_FROMSPACE |
private static boolean |
LOS_TOSPACE |
Constructor and Description |
---|
SSGCspyMutator() |
Modifier and Type | Method and Description |
---|---|
Address |
alloc(int bytes,
int align,
int offset,
int allocator,
int site)
Allocate memory for an object.
|
void |
collectionPhase(short phaseId,
boolean primary)
Perform a per-mutator collection phase.
|
private void |
debugSpaces(CopySpace scannedSpace)
Debugging info for the semispaces
|
private void |
gatherImmortal(int event)
Gather data for the immortal space
|
private void |
gcspyGatherData(int event)
Gather data for GCspy for the semispaces, the immortal space and the large
object space.
|
Allocator |
getAllocatorFromSpace(Space space)
Return the allocator instance associated with a space
space , for this plan instance. |
void |
postAlloc(ObjectReference object,
ObjectReference typeRef,
int bytes,
int allocator)
Perform post-allocation actions.
|
private LinearSpaceDriver |
toSpaceDriver() |
initMutator, show
addressBulkCopy, addressRead, addressTryCompareAndSwap, addressWrite, assertRemsetsFlushed, booleanBulkCopy, booleanRead, booleanWrite, byteBulkCopy, byteRead, byteWrite, charBulkCopy, charRead, charWrite, checkAllocator, deinitMutator, doubleBulkCopy, doubleRead, doubleWrite, extentBulkCopy, extentRead, extentWrite, floatBulkCopy, floatRead, floatWrite, flush, flushRememberedSets, getId, getLog, intBulkCopy, intRead, intTryCompareAndSwap, intWrite, javaLangReferenceReadBarrier, longBulkCopy, longRead, longTryCompareAndSwap, longWrite, objectReferenceBulkCopy, objectReferenceNonHeapRead, objectReferenceNonHeapWrite, objectReferenceRead, objectReferenceTryCompareAndSwap, objectReferenceWrite, offsetBulkCopy, offsetRead, offsetWrite, shortBulkCopy, shortRead, shortWrite, wordBulkCopy, wordRead, wordTryCompareAndSwap, wordWrite
private static final boolean DEBUG
private static final boolean LOS_TOSPACE
private static final boolean LOS_FROMSPACE
private final BumpPointer gcspy
public SSGCspyMutator()
public Address alloc(int bytes, int align, int offset, int allocator, int site)
alloc
in class SSMutator
bytes
- The number of bytes required for the object.align
- Required alignment for the object.offset
- Offset associated with the alignment.allocator
- The allocator associated with this request.site
- Allocation sitepublic void postAlloc(ObjectReference object, ObjectReference typeRef, int bytes, int allocator)
MutatorContext
public Allocator getAllocatorFromSpace(Space space)
MutatorContext
space
, for this plan instance.getAllocatorFromSpace
in class SSMutator
space
- The space for which the allocator instance is desired.space
, or null
if no appropriate allocator can be established.public final void collectionPhase(short phaseId, boolean primary)
collectionPhase
in class SSMutator
phaseId
- The unique phase identifierprimary
- Should this thread be used to execute any single-threaded
local operations?private void gcspyGatherData(int event)
This method sweeps the semispace under consideration to gather data. Alternatively and more efficiently, 'used space' can obviously be discovered in constant time simply by comparing the start and the end addresses of the semispace. However, per-object information can only be gathered by sweeping through the space and we do this here for tutorial purposes.
event
- The event, either BEFORE_COLLECTION, SEMISPACE_COPIED or
AFTER_COLLECTIONprivate void gatherImmortal(int event)
event
- The event, either BEFORE_COLLECTION, SEMISPACE_COPIED or
AFTER_COLLECTIONprivate void debugSpaces(CopySpace scannedSpace)
scannedSpace
- the space to output debug for.private LinearSpaceDriver toSpaceDriver()