|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.utility.Treadmill
public final class Treadmill
FIXME The DoublyLinkedList class, upon which this depends, must be re-written as it makes the assumption that the implementation language (Java) and the language being implemented are the same. This is true in the case of Jikes RVM, but it is not true for any VM implementing a language other than Java.
Each instance of this class is a doubly-linked list, in which each item or node is a piece of memory. The first two words of each node contains the forward and backward links. The third word contains the treadmill. The remaining portion is the payload.
The treadmill object itself must not be moved.
Access to the instances may be synchronized depending on the constructor argument.
Field Summary | |
---|---|
private DoublyLinkedList |
allocNursery
|
private DoublyLinkedList |
collectNursery
|
private DoublyLinkedList |
fromSpace
|
private DoublyLinkedList |
toSpace
|
Constructor Summary | |
---|---|
Treadmill(int granularity,
boolean shared)
|
Method Summary | |
---|---|
void |
addToTreadmill(Address node,
boolean nursery)
Add a node to the treadmill. |
void |
copy(Address node,
boolean isInNursery)
Copy a node (during gc tracing). |
void |
flip(boolean fullHeap)
Flip the roles of the spaces in preparation for a collection. |
boolean |
fromSpaceEmpty()
Is the from-space empty? |
void |
gcspyGatherData(int event,
TreadmillDriver tmDriver)
Gather data for GCSpy from the nursery |
void |
gcspyGatherData(int event,
TreadmillDriver tmDriver,
boolean tospace)
Gather data for GCSpy |
static int |
headerSize()
|
static Address |
midPayloadToNode(Address payload)
|
static Address |
nodeToPayload(Address payload)
|
boolean |
nurseryEmpty()
Is the nursery empty? |
Address |
pop()
Remove a node from the mature list. |
Address |
popNursery()
Remove a node from the nursery list. |
boolean |
toSpaceEmpty()
Is the to-space empty? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DoublyLinkedList fromSpace
private DoublyLinkedList toSpace
private DoublyLinkedList collectNursery
private DoublyLinkedList allocNursery
Constructor Detail |
---|
public Treadmill(int granularity, boolean shared)
granularity
- shared
- true
if the created instance will be shared between threads. If it is shared, accesses will be synchronized using locks.Method Detail |
---|
public void addToTreadmill(Address node, boolean nursery)
public Address popNursery()
public Address pop()
public void copy(Address node, boolean isInNursery)
public boolean toSpaceEmpty()
public boolean fromSpaceEmpty()
public boolean nurseryEmpty()
public void flip(boolean fullHeap)
public static int headerSize()
public static Address nodeToPayload(Address payload)
public static Address midPayloadToNode(Address payload)
public void gcspyGatherData(int event, TreadmillDriver tmDriver)
event
- the gc eventtmDriver
- the GCSpy space driverpublic void gcspyGatherData(int event, TreadmillDriver tmDriver, boolean tospace)
event
- the gc eventtmDriver
- the GCSpy space drivertospace
- gather from tospace?
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |