private abstract static class MarkCompactCollector.RegionCursor extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
RegionCursor(String name) |
Modifier and Type | Method and Description |
---|---|
(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) |
protected Address region
protected Address limit
RegionCursor(String name)
name
- The name of the region - for debugging messages.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 regiontrue
if this cursor points to the same region as other
boolean isAvailable(int size)
size
- Size in bytestrue
if size
bytes are available in the current regionvoid advanceToNextRegion()
boolean isValid()
true
if we haven't advanced beyond the end of the region listboolean isInRegion(ObjectReference ref)
ref
- The object in questiontrue
if the object's start address is in this regionvoid print()