|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mmtk.plan.MutatorContext
org.mmtk.plan.SimpleMutator
org.mmtk.plan.StopTheWorldMutator
org.mmtk.plan.refcount.RCBaseMutator
public class RCBaseMutator
This class implements the mutator context for a reference counting collector. See Shahriyar et al for details of and rationale for the optimizations used here (http://dx.doi.org/10.1145/2258996.2259008). See Chapter 4 of Daniel Frampton's PhD thesis for details of and rationale for the cycle collection strategy used by this collector.
| Field Summary | |
|---|---|
private BTSweepImmortalScanner |
btSweepImmortal
|
private RCDecBuffer |
decBuffer
|
private ObjectReferenceDeque |
modBuffer
|
private ExplicitFreeListLocal |
rc
|
private LargeObjectLocal |
rclos
|
| Fields inherited from class org.mmtk.plan.MutatorContext |
|---|
immortal, lgcode, log, los, nonmove, smcode |
| Constructor Summary | |
|---|---|
RCBaseMutator()
Constructor. |
|
| Method Summary | |
|---|---|
Address |
alloc(int bytes,
int align,
int offset,
int allocator,
int site)
Allocate memory for an object. |
void |
assertRemsetsFlushed()
Assert that the remsets have been flushed. |
private void |
coalescingWriteBarrierSlow(ObjectReference srcObj)
Slow path of the coalescing write barrier. |
void |
collectionPhase(short phaseId,
boolean primary)
Perform a per-mutator collection phase. |
void |
flush()
Flush mutator context, in response to a requestMutatorFlush. |
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 RCBase |
global()
|
boolean |
objectReferenceBulkCopy(ObjectReference src,
Offset srcOffset,
ObjectReference dst,
Offset dstOffset,
int bytes)
A number of references are about to be copied from object src to object dst (as in an array
copy). |
boolean |
objectReferenceTryCompareAndSwap(ObjectReference src,
Address slot,
ObjectReference old,
ObjectReference tgt,
Word metaDataA,
Word metaDataB,
int mode)
Attempt to atomically exchange the value in the given slot with the passed replacement value. |
void |
objectReferenceWrite(ObjectReference src,
Address slot,
ObjectReference tgt,
Word metaDataA,
Word metaDataB,
int mode)
Write an object reference. |
void |
postAlloc(ObjectReference ref,
ObjectReference typeRef,
int bytes,
int allocator)
Perform post-allocation actions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final ExplicitFreeListLocal rc
private final LargeObjectLocal rclos
private final ObjectReferenceDeque modBuffer
private final RCDecBuffer decBuffer
private final BTSweepImmortalScanner btSweepImmortal
| Constructor Detail |
|---|
public RCBaseMutator()
| Method Detail |
|---|
public Address alloc(int bytes,
int align,
int offset,
int allocator,
int site)
alloc in class MutatorContextbytes - 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 site
public void postAlloc(ObjectReference ref,
ObjectReference typeRef,
int bytes,
int allocator)
MutatorContext
postAlloc in class MutatorContextref - 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)
MutatorContextspace, for this plan instance.
getAllocatorFromSpace in class MutatorContextspace - 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 SimpleMutatorphaseId - The unique phase identifierprimary - Should this thread be used to execute any single-threaded
local operations?public final void flushRememberedSets()
MutatorContext
flushRememberedSets in class MutatorContextpublic final void assertRemsetsFlushed()
MutatorContext
assertRemsetsFlushed in class MutatorContextpublic void flush()
MutatorContext
flush in class MutatorContext
public void objectReferenceWrite(ObjectReference src,
Address slot,
ObjectReference tgt,
Word metaDataA,
Word metaDataB,
int mode)
By default do nothing, override if appropriate.
objectReferenceWrite in class MutatorContextsrc - The object into which the new reference will be storedslot - The address into which the new reference will be
stored.tgt - The value of the new referencemetaDataA - A value that assists the host VM in creating a storemetaDataB - A value that assists the host VM in creating a storemode - The context in which the store occurred
public boolean objectReferenceTryCompareAndSwap(ObjectReference src,
Address slot,
ObjectReference old,
ObjectReference tgt,
Word metaDataA,
Word metaDataB,
int mode)
MutatorContextBy default do nothing, override if appropriate.
objectReferenceTryCompareAndSwap in class MutatorContextsrc - The object into which the new reference will be storedslot - The address into which the new reference will be
stored.old - The old reference to be swapped outtgt - The target of the new referencemetaDataA - A value that assists the host VM in creating a storemetaDataB - A value that assists the host VM in creating a storemode - The context in which the store occurred
public boolean objectReferenceBulkCopy(ObjectReference src,
Offset srcOffset,
ObjectReference dst,
Offset dstOffset,
int bytes)
src to object dst (as in an array
copy). Thus, dst is the mutated object. Take
appropriate write barrier actions.
objectReferenceBulkCopy in class MutatorContextsrc - The source of the values to be copiedsrcOffset - The offset of the first source address, in
bytes, relative to src (in principle, this could be
negative).dst - The mutated object, i.e. the destination of the copy.dstOffset - The offset of the first destination address, in
bytes relative to tgt (in principle, this could be
negative).bytes - The size of the region being copied, in bytes.
private void coalescingWriteBarrierSlow(ObjectReference srcObj)
Attempt to log the source object. If successful in racing for the log bit, push an entry into the modified buffer and add a decrement buffer entry for each referent object (in the RC space) before setting the header bit to indicate that it has finished logging (allowing others in the race to continue).
srcObj - The object being mutatedprivate static RCBase global()
RC instance.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||