|
|||||||||||
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.MarkCompactSpace
public final class MarkCompactSpace
This class implements functionality for a simple sliding mark-compact space.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.mmtk.policy.Space |
---|
Space.SpaceVisitor |
Field Summary | |
---|---|
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 |
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 | |
---|---|
MarkCompactSpace(String name,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for this space. |
Method Summary | |
---|---|
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)
Used to mark boot image objects during a parallel scan of objects during GC Returns true if marking was done. |
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)
Used to mark boot image objects during a parallel scan of objects during GC Returns true if marking was done. |
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)
Used to mark boot image objects during a parallel scan of objects during GC Returns true if marking was done. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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 static final Lock lock
private Address regionList
Constructor Detail |
---|
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.Method Detail |
---|
public void prepare()
public void release()
public void release(Address start)
In this case we do nothing ecause we only release pages enmasse.
release
in class Space
start
- The address of the start of the region to be releasedpublic 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
isLive
in class Space
object
- The object reference.
true
if the object is live.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 read
object
's
header.public void initializeHeader(ObjectReference object)
object
- The object to initialisepublic static boolean testAndMark(ObjectReference object)
object
- The object to be marked
true
if marking was done.public static boolean isMarked(ObjectReference object)
object
- The object to be markedprivate static boolean testAndClearMark(ObjectReference object)
object
- The object to be markedpublic static boolean toBeCompacted(ObjectReference object)
object
- The object to be markedpublic static void clearMark(ObjectReference object)
object
- The object to be markedpublic 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
- public static void appendRegion(Address listHead, Address region)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |