public final class MarkCompactSpace extends Space
Space.SpaceVisitor
Modifier and Type | Field and Description |
---|---|
private static Offset |
FORWARDING_POINTER_OFFSET |
static int |
GC_HEADER_WORDS_REQUIRED |
private static Word |
GC_MARK_BIT_MASK |
static int |
GLOBAL_GC_BITS_REQUIRED |
static int |
LOCAL_GC_BITS_REQUIRED |
private static Lock |
lock |
private Address |
regionList
The list of occupied regions
|
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 |
---|
MarkCompactSpace(String name,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for
this space.
|
Modifier and Type | Method and Description |
---|---|
void |
append(Address region)
Append a region or list of regions to the global list
|
static void |
appendRegion(Address listHead,
Address region) |
static void |
clearForwardingPointer(ObjectReference object)
Non-atomic clear of forwarding pointer word (assumption, thread
doing the set has done attempt to forward and owns the right to
copy the object)
|
static void |
clearMark(ObjectReference object) |
static ObjectReference |
getForwardingPointer(ObjectReference object)
Non-atomic read of forwarding pointer
|
Address |
getNextRegion() |
void |
initializeHeader(ObjectReference object)
Initialise the header of the object.
|
boolean |
isLive(ObjectReference object)
Is the object in this space alive?
|
static boolean |
isMarked(ObjectReference object) |
boolean |
isReachable(ObjectReference object)
Has the object in this space been reached during the current collection.
|
void |
postAlloc(ObjectReference object)
Perform any required post-allocation initialization
Nothing to be done in this case
|
void |
prepare()
Prepare for a collection
|
void |
release()
Release after a collection
|
void |
release(Address start)
Release a unit of allocation (a page or pages)
|
static void |
setForwardingPointer(ObjectReference object,
ObjectReference ptr)
Non-atomic write of forwarding pointer word (assumption, thread
doing the set has done attempt to forward and owns the right to
copy the object)
|
private static boolean |
testAndClearMark(ObjectReference object)
Used to mark boot image objects during a parallel scan of objects
during GC Returns true if marking was done.
|
static boolean |
testAndMark(ObjectReference object)
Used to mark boot image objects during a parallel scan of objects
during GC.
|
static boolean |
toBeCompacted(ObjectReference object) |
ObjectReference |
traceForwardObject(TraceLocal trace,
ObjectReference object)
Trace an object under a copying collection policy.
|
ObjectReference |
traceMarkObject(TraceLocal trace,
ObjectReference object)
Trace an object under a copying collection policy.
|
ObjectReference |
traceObject(TransitiveClosure trace,
ObjectReference object)
Trace an object under a copying collection policy.
|
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, printUsageMB, printUsagePages, printVMMap, releaseAllChunks, releaseDiscontiguousChunks, requiredChunks, reservedPages, setZeroingApproach, skipConcurrentZeroing, triggerConcurrentZeroing, visitSpaces
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 static final Word GC_MARK_BIT_MASK
private static final Offset FORWARDING_POINTER_OFFSET
private Address regionList
public MarkCompactSpace(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 prepare()
public void release()
public void release(Address start)
In this case we do nothing ecause we only release pages enmasse.
public ObjectReference traceObject(TransitiveClosure trace, ObjectReference object)
traceObject
in class Space
trace
- The trace being conducted.object
- The object to be forwarded.public ObjectReference traceMarkObject(TraceLocal trace, ObjectReference object)
trace
- The trace being conducted.object
- The object to be forwarded.public ObjectReference traceForwardObject(TraceLocal trace, ObjectReference object)
trace
- The trace being conducted.object
- The object to be forwarded.public boolean isLive(ObjectReference object)
Space
public boolean isReachable(ObjectReference object)
Space
isReachable
in class Space
object
- The object reference.true
if the object is reachable.public void postAlloc(ObjectReference object)
object
- the object ref to the storage to be initializedpublic static ObjectReference getForwardingPointer(ObjectReference object)
object
- The object whose forwarding pointer is to be readobject
's
header.public void initializeHeader(ObjectReference object)
object
- The object to initialisepublic static boolean testAndMark(ObjectReference object)
object
- The object to be markedtrue
if marking was done.public static boolean isMarked(ObjectReference object)
object
- the object in questiontrue
if the object is markedprivate static boolean testAndClearMark(ObjectReference object)
object
- The object to be markedtrue
if marking was done, false
otherwisepublic static boolean toBeCompacted(ObjectReference object)
public static void clearMark(ObjectReference object)
public static void setForwardingPointer(ObjectReference object, ObjectReference ptr)
object
- The object whose forwarding pointer is to be setptr
- The forwarding pointer to be stored in the object's
forwarding wordpublic static void clearForwardingPointer(ObjectReference object)
object
- The object whose forwarding pointer is to be setpublic Address getNextRegion()
public void append(Address region)
region
- the region to appendpublic static void appendRegion(Address listHead, Address region)