Space.SpaceVisitor
Modifier and Type | Field and Description |
---|---|
private boolean |
fromSpace |
static int |
GC_HEADER_WORDS_REQUIRED |
static int |
GLOBAL_GC_BITS_REQUIRED |
static int |
LOCAL_GC_BITS_REQUIRED |
private static int |
META_DATA_PAGES_PER_REGION |
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 |
---|
CopySpace(String name,
boolean fromSpace,
boolean zeroed,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for
this space.
|
CopySpace(String name,
boolean fromSpace,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for
this space.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isFromSpace() |
boolean |
isLive(ObjectReference object)
Return
true if this object is live in this GC |
boolean |
isMovable()
fromSpace CopySpace can always move, toSpace will not move during current GC
|
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(boolean fromSpace)
Prepare this space instance for a collection.
|
void |
release()
Release this copy space after a collection.
|
void |
release(Address start)
Release an allocated page or pages.
|
ObjectReference |
traceObject(TransitiveClosure trace,
ObjectReference object)
Trace an object under a copying collection policy.
|
ObjectReference |
traceObject(TransitiveClosure trace,
ObjectReference object,
int allocator)
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, 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 int META_DATA_PAGES_PER_REGION
private boolean fromSpace
public CopySpace(String name, boolean fromSpace, VMRequest vmRequest)
name
- The name of this space (used when printing error messages etc)fromSpace
- The does this instance start life as from-space
(or to-space)?vmRequest
- An object describing the virtual memory requested.public CopySpace(String name, boolean fromSpace, boolean zeroed, VMRequest vmRequest)
name
- The name of this space (used when printing error messages etc)fromSpace
- The does this instance start life as from-spacezeroed
- if true, allocations return zeroed memory.
(or to-space)?vmRequest
- An object describing the virtual memory requested.public boolean isFromSpace()
public boolean isMovable()
public void prepare(boolean fromSpace)
fromSpace
- Set the fromSpace field to this valuepublic void release()
public void release(Address start)
public ObjectReference traceObject(TransitiveClosure trace, ObjectReference object)
We use a tri-state algorithm to deal with races to forward the object. The tracer must wait if the object is concurrently being forwarded by another thread.
If the object is already forwarded, the copy is returned. Otherwise, the object is forwarded and the copy is returned.
traceObject
in class Space
trace
- The trace being conducted.object
- The object to be forwarded.public ObjectReference traceObject(TransitiveClosure trace, ObjectReference object, int allocator)
We use a tri-state algorithm to deal with races to forward the object. The tracer must wait if the object is concurrently being forwarded by another thread.
If the object is already forwarded, the copy is returned. Otherwise, the object is forwarded and the copy is returned.
trace
- The trace being conducted.object
- The object to be forwarded.allocator
- The allocator to use when copying.public boolean isLive(ObjectReference object)
true
if this object is live in this GCpublic 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 initialized