org.mmtk.policy
Class MarkCompactCollector.ToCursor

java.lang.Object
  extended by org.mmtk.policy.MarkCompactCollector.RegionCursor
      extended by org.mmtk.policy.MarkCompactCollector.ToCursor
Enclosing class:
MarkCompactCollector

private static final class MarkCompactCollector.ToCursor
extends MarkCompactCollector.RegionCursor

Subclass for the read-only cursor that follows the 'from' cursor, writing or calculating the position of copied objects


Field Summary
 
Fields inherited from class org.mmtk.policy.MarkCompactCollector.RegionCursor
cursor, limit, region
 
Constructor Summary
MarkCompactCollector.ToCursor()
           
 
Method Summary
(package private)  void advanceToNextRegion()
          Move to the next region, in read-only mode.
(package private)  void copy(ObjectReference from, ObjectReference to)
          Copy an object to an address within this cursor's region.
(package private)  void finish()
          Update the metadata of the current region with the current value of the cursor.
(package private)  void finishAndAdvanceToNextRegion()
          Move to the next region, updating the metadata with the current 'write' state.
(package private)  void init(Address region)
          Initialize the cursor to a given region.
(package private)  Address snip()
          Terminate the list of regions here.
 
Methods inherited from class org.mmtk.policy.MarkCompactCollector.RegionCursor
assertCursorInBounds, get, getLimit, getRegion, inc, incTo, isAvailable, isInRegion, isValid, print, sameRegion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkCompactCollector.ToCursor

public MarkCompactCollector.ToCursor()
Method Detail

init

void init(Address region)
Initialize the cursor to a given region. The limit is the limit of available space in the region.

Specified by:
init in class MarkCompactCollector.RegionCursor
Parameters:
region - The region to be processed.

finish

void finish()
Update the metadata of the current region with the current value of the cursor. Zero the region from here to the end.


snip

Address snip()
Terminate the list of regions here.

Returns:
The address of the (old) next region in the list.

copy

void copy(ObjectReference from,
          ObjectReference to)
Copy an object to an address within this cursor's region.

Parameters:
from - The source object
to - The target object

finishAndAdvanceToNextRegion

void finishAndAdvanceToNextRegion()
Move to the next region, updating the metadata with the current 'write' state.


advanceToNextRegion

void advanceToNextRegion()
Move to the next region, in read-only mode. Add the assertion of validity, since we shouldn't be able to fall off the end of the list while writing.

Overrides:
advanceToNextRegion in class MarkCompactCollector.RegionCursor