|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.policy.Space org.mmtk.policy.SegregatedFreeListSpace org.mmtk.policy.MarkSweepSpace
public final class MarkSweepSpace
Each instance of this class corresponds to one mark-sweep *space*. Each of the instance methods of this class may be called by any thread (i.e. synchronization must be explicit in any instance or class method). This contrasts with the MarkSweepLocal, where instances correspond to *plan* instances and therefore to kernel threads. Thus unlike this class, synchronization is not necessary in the instance methods of MarkSweepLocal.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mmtk.policy.SegregatedFreeListSpace |
---|
SegregatedFreeListSpace.Sweeper |
Nested classes/interfaces inherited from class org.mmtk.policy.Space |
---|
Space.SpaceVisitor |
Field Summary | |
---|---|
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
|
Fields inherited from class org.mmtk.policy.SegregatedFreeListSpace |
---|
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 |
Fields inherited from class org.mmtk.policy.Space |
---|
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 Summary | |
---|---|
MarkSweepSpace(String name,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for this space. |
Method Summary | |
---|---|
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()
Do we need to preserve free lists as we move blocks around. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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.Method Detail |
---|
public void makeAgeSegregatedSpace()
protected boolean maintainSideBitmap()
maintainSideBitmap
in class SegregatedFreeListSpace
protected boolean preserveFreeList()
SegregatedFreeListSpace
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 block
protected 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()
public void release(Address start)
release
in class Space
start
- The address of the start of the page or pagesprotected boolean isCellLive(ObjectReference object)
isCellLive
in class SegregatedFreeListSpace
object
- The object to query
public 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
isLive
in class Space
object
- The object reference.
true
if this object is known to be live (i.e. it is marked)public byte getPreviousMarkState()
private byte deltaMarkState(boolean increment)
increment
- If true, then return the incremented value else return the decremented value
public 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 setprivate boolean testMarkState(ObjectReference object)
object
- The object whose mark bit is to be tested
true
if the mark bit for the object is set.public void makeAllocAsMarked()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |