|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.policy.MarkCompactCollector.RegionCursor
private abstract static class MarkCompactCollector.RegionCursor
Both the 'compact' and 'calculate' phases can be thought of as sweeping a pair of cursors across a linked list of regions. Each cursor requires maintaining pointers to the current region, the current address and the end of the region. The regionCursor class maintains these 3 pointers, while the subclasses ToCursor and FromCursor provide methods specific to the read and write pointers.
Field Summary | |
---|---|
protected Address |
cursor
The current address |
protected Address |
limit
The limit of the current region. |
private String |
name
Name of the cursor - for debugging messages |
protected Address |
region
The current region, or zero if the cursor is invalid (eg after advancing past the end of the current work list |
Constructor Summary | |
---|---|
MarkCompactCollector.RegionCursor(String name)
|
Method Summary | |
---|---|
(package private) void |
advanceToNextRegion()
Follow the linked-list of regions to the next region. |
protected void |
assertCursorInBounds()
Assert that the cursor is within the bounds of the region. |
Address |
get()
|
Address |
getLimit()
|
Address |
getRegion()
|
(package private) void |
inc(int size)
Increment the cursor. |
void |
incTo(Address cursor)
Increment the cursor to a specific address |
(package private) abstract void |
init(Address region)
Hook to allow subclasses to initialize the cursor in different ways. |
(package private) boolean |
isAvailable(int size)
|
(package private) boolean |
isInRegion(ObjectReference ref)
|
(package private) boolean |
isValid()
|
(package private) void |
print()
Print the cursor - for debugging |
(package private) boolean |
sameRegion(MarkCompactCollector.RegionCursor other)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final String name
protected Address region
protected Address limit
protected Address cursor
Constructor Detail |
---|
public MarkCompactCollector.RegionCursor(String name)
name
- The name of the region - for debugging messages.Method Detail |
---|
abstract void init(Address region)
region
- The region to be processed.protected void assertCursorInBounds()
if (VM.VERIFY_ASSERTIONS)
void inc(int size)
size
- Bytes to increment bypublic void incTo(Address cursor)
cursor
- Destination addressboolean sameRegion(MarkCompactCollector.RegionCursor other)
other
- Other region
true
if this cursor points to the same region as other
boolean isAvailable(int size)
size
- Size in bytes
true
if size
bytes are available in the current regionpublic Address get()
public Address getRegion()
public Address getLimit()
void advanceToNextRegion()
boolean isValid()
true
if we haven't advanced beyond the end of the region listboolean isInRegion(ObjectReference ref)
ref
- The object in question
true
if the object's start address is in this regionvoid print()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |