|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.utility.DoublyLinkedList
public final class DoublyLinkedList
FIXME This class 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 Address |
head
|
private static Offset |
HEADER_SIZE
|
private Lock |
lock
|
private int |
logGranularity
|
private static Offset |
NEXT_OFFSET
|
private static Word |
nodeMask
|
private static Offset |
PREV_OFFSET
|
Constructor Summary | |
---|---|
DoublyLinkedList(int logGranularity,
boolean shared)
Constructor |
Method Summary | |
---|---|
void |
add(Address node)
|
(package private) void |
gcspyGatherData(AbstractDriver driver)
Gather data for GCSpy |
Address |
getHead()
|
Address |
getNext(Address node)
|
static int |
headerSize()
|
boolean |
isEmpty()
|
boolean |
isMember(Address node)
Return true if a cell is on a given treadmill |
boolean |
isNode(Address node)
|
static Address |
midPayloadToNode(Address payload)
|
static Address |
nodeToPayload(Address node)
|
Address |
pop()
|
void |
remove(Address node)
|
void |
show()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Address head
private final Lock lock
private final int logGranularity
private static final Offset PREV_OFFSET
private static Offset NEXT_OFFSET
private static Offset HEADER_SIZE
private static final Word nodeMask
Constructor Detail |
---|
public DoublyLinkedList(int logGranularity, boolean shared)
Method Detail |
---|
public static int headerSize()
public boolean isNode(Address node)
public static Address nodeToPayload(Address node)
public static Address midPayloadToNode(Address payload)
public void add(Address node)
public void remove(Address node)
public Address getHead()
public Address getNext(Address node)
public Address pop()
public boolean isEmpty()
public boolean isMember(Address node)
node
- The cell being searched for
true
if the cell is found on the treadmillpublic void show()
void gcspyGatherData(AbstractDriver driver)
driver
- the GCSpy space driver
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |