public class CMSMutator extends ConcurrentMutator
FIXME The SegregatedFreeList class (and its descendants such as MarkSweepLocal) does not properly separate mutator and collector behaviors, so the ms field below should really not exist in this class as there is no collection-time allocation in this collector.
CMS
,
CMSCollector
,
StopTheWorldMutator
,
MutatorContext
Modifier and Type | Field and Description |
---|---|
private MarkSweepLocal |
ms |
private TraceWriteBuffer |
remset |
barrierActive, newMutatorBarrierActive
Constructor and Description |
---|
CMSMutator()
Constructor
|
Modifier and Type | Method and Description |
---|---|
Address |
alloc(int bytes,
int align,
int offset,
int allocator,
int site)
Allocate memory for an object.
|
protected void |
checkAndEnqueueReference(ObjectReference ref)
Process a reference that may require being enqueued as part of a concurrent
collection.
|
void |
collectionPhase(short phaseId,
boolean primary)
Perform a per-mutator collection phase.
|
void |
flushRememberedSets()
Flush per-mutator remembered sets into the global remset pool.
|
Allocator |
getAllocatorFromSpace(Space space)
Return the allocator instance associated with a space
space , for this plan instance. |
private static CMS |
global() |
void |
postAlloc(ObjectReference ref,
ObjectReference typeRef,
int bytes,
int allocator)
Perform post-allocation actions.
|
javaLangReferenceReadBarrier, objectReferenceBulkCopy, objectReferenceTryCompareAndSwap, objectReferenceWrite
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, getId, getLog, initMutator, intBulkCopy, intRead, intTryCompareAndSwap, intWrite, longBulkCopy, longRead, longTryCompareAndSwap, longWrite, objectReferenceNonHeapRead, objectReferenceNonHeapWrite, objectReferenceRead, offsetBulkCopy, offsetRead, offsetWrite, shortBulkCopy, shortRead, shortWrite, wordBulkCopy, wordRead, wordTryCompareAndSwap, wordWrite
private final MarkSweepLocal ms
private final TraceWriteBuffer remset
public CMSMutator()
public Address alloc(int bytes, int align, int offset, int allocator, int site)
This class handles the default allocator from the mark sweep space, and delegates everything else to the superclass.
alloc
in class MutatorContext
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 ref, ObjectReference typeRef, int bytes, int allocator)
Initialize the object header for objects in the mark-sweep space, and delegate to the superclass for other objects.
postAlloc
in class MutatorContext
ref
- The newly allocated objecttypeRef
- the type reference for the instance being createdbytes
- The size of the space to be allocated (in bytes)allocator
- The allocator number to be used for this allocationpublic Allocator getAllocatorFromSpace(Space space)
MutatorContext
space
, for this plan instance.getAllocatorFromSpace
in class MutatorContext
space
- The space for which the allocator instance is desired.space
, or null
if no appropriate allocator can be established.public void collectionPhase(short phaseId, boolean primary)
collectionPhase
in class ConcurrentMutator
phaseId
- The unique phase identifierprimary
- Should this thread be used to execute any single-threaded
local operations?public void flushRememberedSets()
MutatorContext
flushRememberedSets
in class MutatorContext
protected void checkAndEnqueueReference(ObjectReference ref)
checkAndEnqueueReference
in class ConcurrentMutator
ref
- The reference to check.