|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.vm.FinalizableProcessor org.jikesrvm.mm.mmtk.FinalizableProcessor
public final class FinalizableProcessor
This class manages the processing of finalizable objects.
TODO can this be a linked list?
Field Summary | |
---|---|
private static FinalizableProcessor |
finalizableProcessor
The FinalizableProcessor singleton |
private static double |
GROWTH_FACTOR
Amount to grow the table by when it is filled |
private static int |
INITIAL_SIZE
Initial size of the reference object table |
private int |
lastReadyIndex
Last object ready to be finalized |
private Lock |
lock
Used to ensure mutual exclusion during table manipulation |
protected int |
maxIndex
Index of the first free slot in the table. |
private int |
nextReadyIndex
Next object ready to be finalized |
protected int |
nurseryIndex
Index of first entry created since last collection |
protected Object[] |
readyForFinalize
The table of ready objects |
private static boolean |
STRESS
Stress the system? |
protected AddressArray |
table
The table of candidates |
Constructor Summary | |
---|---|
protected |
FinalizableProcessor()
Create a new table. |
Method Summary | |
---|---|
void |
add(Object object)
Allocate an entry in the table. |
static void |
addCandidate(Object object)
Add a finalization candidate. |
void |
clear()
Clear the contents of the table. |
int |
count()
The number of entries in the table. |
int |
countReady()
The number of entries ready to be finalized. |
static int |
countReadyForFinalize()
The number of objects waiting for finalize() calls. |
void |
forward(TraceLocal trace,
boolean nursery)
Iterate over and forward entries in the table. |
int |
freeReady()
The number of entries ready to be finalized. |
static Object |
getForFinalize()
Get an object to call the finalize() method on it. |
static FinalizableProcessor |
getProcessor()
Get the singleton |
Object |
getReady()
Get an object to run finalize(). |
void |
scan(TraceLocal trace,
boolean nursery)
Scan through the list of references. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final FinalizableProcessor finalizableProcessor
private static final boolean STRESS
private static final int INITIAL_SIZE
private static final double GROWTH_FACTOR
private final Lock lock
protected volatile AddressArray table
protected volatile Object[] readyForFinalize
protected int nurseryIndex
protected volatile int maxIndex
private volatile int nextReadyIndex
private volatile int lastReadyIndex
Constructor Detail |
---|
protected FinalizableProcessor()
Method Detail |
---|
public void add(Object object)
public void clear()
FinalizableProcessor
clear
in class FinalizableProcessor
public void forward(TraceLocal trace, boolean nursery)
Currently ignores the nursery hint.
TODO parallelise this code?
forward
in class FinalizableProcessor
trace
- The tracenursery
- Is this a nursery collection ?public void scan(TraceLocal trace, boolean nursery)
Depending on the value of nursery
, we will either
scan all references, or just those created since the last scan.
TODO parallelise this code
scan
in class FinalizableProcessor
nursery
- Scan only the newly created referencestrace
- the thread local trace element.public Object getReady()
public int count()
public int countReady()
public int freeReady()
public static FinalizableProcessor getProcessor()
public static void addCandidate(Object object)
object
- The object with a finalizer.public static Object getForFinalize()
public static int countReadyForFinalize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |