public final class MarkSweepSpace extends SegregatedFreeListSpace
SegregatedFreeListSpace.Sweeper
Space.SpaceVisitor
Modifier and Type | Field and Description |
---|---|
private byte |
allocState |
private static int |
AVAILABLE_LOCAL_BITS
highest bit bits we may use
|
private static int |
COUNT_BASE |
static int |
DEFAULT_MARKCOUNT_BITS |
private static boolean |
EAGER_MARK_CLEAR |
static int |
GC_HEADER_WORDS_REQUIRED |
static int |
GLOBAL_GC_BITS_REQUIRED |
static boolean |
HEADER_MARK_BITS
Select between using mark bits in a side bitmap, or mark bits
in the headers of object (or other sub-class scheme), and a single
mark bit per block.
|
private boolean |
inMSCollection |
private boolean |
isAgeSegregated |
private boolean |
isAllocAsMarked |
static int |
LOCAL_GC_BITS_REQUIRED |
private static byte |
MARK_COUNT_INCREMENT |
private static byte |
MARK_COUNT_MASK |
private byte |
markState |
static int |
MAX_MARKCOUNT_BITS |
private static boolean |
usingStickyMarkBits |
availableBlockHead, consumedBlockHead, flushedBlockHead, LAZY_SWEEP, lock, MAX_CELL_SIZE, MAX_CELLS, MAX_FREELIST_OBJECT_BYTES, META_DATA_PAGES_PER_REGION_NO_BITMAP, META_DATA_PAGES_PER_REGION_WITH_BITMAP, MIN_CELLS, WORST_CASE_FRAGMENTATION
AVAILABLE_BYTES, AVAILABLE_END, AVAILABLE_PAGES, AVAILABLE_START, BYTES_IN_CHUNK, contiguous, descriptor, extent, headDiscontiguousRegion, HEAP_END, HEAP_START, immortal, LOG_ADDRESS_SPACE, LOG_BYTES_IN_CHUNK, MAX_CHUNKS, MAX_SPACES, movable, PAGES_IN_CHUNK, pr, start, zeroed
Constructor and Description |
---|
MarkSweepSpace(String name,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for
this space.
|
Modifier and Type | Method and Description |
---|---|
protected Address |
advanceToBlock(Address block,
int sizeClass)
Prepare the next block in the free block list for use by the free
list allocator.
|
private byte |
deltaMarkState(boolean increment)
Return the mark state incremented or decremented by one.
|
byte |
getPreviousMarkState()
Get the previous mark state.
|
void |
initializeHeader(ObjectReference object,
boolean alloc)
Perform any required initialization of the GC portion of the header.
|
protected boolean |
isCellLive(ObjectReference object)
Should the sweep reclaim the cell containing this object.
|
boolean |
isLive(ObjectReference object)
Is the object in this space alive?
|
protected boolean |
maintainSideBitmap()
Should SegregatedFreeListSpace manage a side bitmap to keep track of live objects?
|
void |
makeAgeSegregatedSpace()
This instance will be age-segregated using the sticky mark bits
algorithm.
|
void |
makeAllocAsMarked() |
protected void |
notifyNewBlock(Address block,
int sizeClass)
Notify that a new block has been installed.
|
void |
postAlloc(ObjectReference object)
Perform any required post allocation initialization
|
void |
postCopy(ObjectReference object,
boolean majorGC)
Perform any required post copy (i.e. in-GC allocation) initialization.
|
void |
prepare(boolean gcWholeMS)
Prepare for a new collection increment.
|
protected boolean |
preserveFreeList() |
void |
release()
A new collection increment has completed.
|
void |
release(Address start)
Release an allocated page or pages
|
private boolean |
testAndMark(ObjectReference object)
Atomically attempt to set the mark bit of an object.
|
private boolean |
testMarkState(ObjectReference object)
Return true if the mark count for an object has the given value.
|
ObjectReference |
traceObject(TransitiveClosure trace,
ObjectReference object)
Trace a reference to an object under a mark sweep collection
policy.
|
clearAllBlockMarks, clearBlockMark, clearLiveBit, clearLiveBit, clearLiveBits, consumeBlocks, containsLiveCell, flushAvailableBlocks, getAllocationBlock, getBaseCellSize, getFreeList, getSizeClass, liveBitSet, liveBitSet, makeFreeList, markBlock, markBlock, parallelSweepCells, reclaimCellForObject, returnBlock, returnConsumedBlock, setFreeList, sizeClassCount, sweepBlock, sweepCells, sweepCells, sweepConsumedBlocks, testAndSetLiveBit, unsyncClearLiveBit, unsyncClearLiveBit, unsyncSetLiveBit, zeroLiveBits
acquire, availablePhysicalPages, chunkAlign, chunkAlign, committedPages, cumulativeCommittedPages, eagerlyMmapMMTkContiguousSpaces, eagerlyMmapMMTkDiscontiguousSpaces, eagerlyMmapMMTkSpaces, getDescriptor, getDiscontigEnd, getDiscontigStart, getExtent, getFracAvailable, getHeadDiscontiguousRegion, getIndex, getName, getSpaceCount, getSpaceForAddress, getSpaceForObject, getSpaces, getStart, growDiscontiguousSpace, growSpace, isImmortal, isImmortal, isInSpace, isInSpace, isMappedAddress, isMappedObject, isMovable, isMovable, isReachable, printUsageMB, printUsagePages, printVMMap, releaseAllChunks, releaseDiscontiguousChunks, requiredChunks, reservedPages, setZeroingApproach, skipConcurrentZeroing, triggerConcurrentZeroing, visitSpaces
public static final boolean HEADER_MARK_BITS
private static final int AVAILABLE_LOCAL_BITS
private static final int COUNT_BASE
public static final int DEFAULT_MARKCOUNT_BITS
public static final int MAX_MARKCOUNT_BITS
private static final byte MARK_COUNT_INCREMENT
private static final byte MARK_COUNT_MASK
private static final boolean EAGER_MARK_CLEAR
public static final int LOCAL_GC_BITS_REQUIRED
public static final int GLOBAL_GC_BITS_REQUIRED
public static final int GC_HEADER_WORDS_REQUIRED
private byte markState
private byte allocState
private boolean inMSCollection
private static final boolean usingStickyMarkBits
private boolean isAgeSegregated
private boolean isAllocAsMarked
public MarkSweepSpace(String name, VMRequest vmRequest)
name
- The name of this space (used when printing error messages etc)vmRequest
- An object describing the virtual memory requested.public void makeAgeSegregatedSpace()
protected boolean maintainSideBitmap()
maintainSideBitmap
in class SegregatedFreeListSpace
protected boolean preserveFreeList()
preserveFreeList
in class SegregatedFreeListSpace
protected Address advanceToBlock(Address block, int sizeClass)
advanceToBlock
in class SegregatedFreeListSpace
block
- The block to be prepared for usesizeClass
- The size class of the blockprotected void notifyNewBlock(Address block, int sizeClass)
This is to ensure that appropriate collection state can be initialized for the block.
notifyNewBlock
in class SegregatedFreeListSpace
block
- The new blocksizeClass
- The block's sizeclass.public void prepare(boolean gcWholeMS)
gcWholeMS
- True if we are going to collect the whole marksweep spacepublic void release()
protected boolean isCellLive(ObjectReference object)
isCellLive
in class SegregatedFreeListSpace
object
- The object to querypublic ObjectReference traceObject(TransitiveClosure trace, ObjectReference object)
traceObject
in class Space
object
- The object to be traced.trace
- The trace being conducted.public boolean isLive(ObjectReference object)
Space
public byte getPreviousMarkState()
private byte deltaMarkState(boolean increment)
increment
- If true, then return the incremented value else return the decremented valuepublic void postAlloc(ObjectReference object)
object
- the object ref to the storage to be initializedpublic void postCopy(ObjectReference object, boolean majorGC)
object
- the object ref to the storage to be initializedmajorGC
- Is this copy happening during a major gc?public void initializeHeader(ObjectReference object, boolean alloc)
object
- the object ref to the storage to be initializedalloc
- is this initialization occuring due to (initial) allocation
(true) or due to copying (false)?private boolean testAndMark(ObjectReference object)
object
- The object whose mark bit is to be settrue
if successful, false
if the mark
bit was already setprivate boolean testMarkState(ObjectReference object)
object
- The object whose mark bit is to be testedtrue
if the mark bit for the object is set.public void makeAllocAsMarked()