org.jikesrvm.mm.mminterface
Class GCMapIteratorGroup

java.lang.Object
  extended by org.jikesrvm.mm.mminterface.GCMapIteratorGroup
All Implemented Interfaces:
SizeConstants

public final class GCMapIteratorGroup
extends Object
implements SizeConstants

Maintains a collection of compiler specific GCMapIterators that are used by collection threads when scanning thread stacks to locate object references in those stacks. Each collector thread has its own GCMapIteratorGroup.

The group contains a GCMapIterator for each type of stack frame that may be found while scanning a stack during garbage collection, including frames for baseline compiled methods, OPT compiled methods, and frames for transitions from Java into JNI native code. These iterators are responsible for reporting the location of references in the stack or register save areas.

See Also:
GCMapIterator, CompiledMethod, CollectorThread

Field Summary
private  GCMapIterator baselineIterator
          iterator for baseline compiled frames
private  GCMapIterator hardwareTrapIterator
          iterator for HardwareTrap stackframes
private  GCMapIterator jniIterator
          iterator for JNI Java -> C stackframes
private  GCMapIterator optIterator
          iterator for opt compiled frames
private  WordArray registerLocations
          current location (memory address) of each gpr register
 
Fields inherited from interface org.jikesrvm.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
Constructor Summary
GCMapIteratorGroup()
           
 
Method Summary
 GCMapIterator getJniIterator()
          get the GCMapIterator used for scanning JNI native stack frames.
 void newStackWalk(RVMThread thread, Address registerLocation)
          Prepare to scan a thread's stack for object references.
 GCMapIterator selectIterator(CompiledMethod compiledMethod)
          Select iterator for scanning for object references in a stackframe.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registerLocations

private final WordArray registerLocations
current location (memory address) of each gpr register


baselineIterator

private final GCMapIterator baselineIterator
iterator for baseline compiled frames


optIterator

private final GCMapIterator optIterator
iterator for opt compiled frames


hardwareTrapIterator

private final GCMapIterator hardwareTrapIterator
iterator for HardwareTrap stackframes


jniIterator

private final GCMapIterator jniIterator
iterator for JNI Java -> C stackframes

Constructor Detail

GCMapIteratorGroup

public GCMapIteratorGroup()
Method Detail

newStackWalk

public void newStackWalk(RVMThread thread,
                         Address registerLocation)
Prepare to scan a thread's stack for object references. Called by collector threads when beginning to scan a threads stack. Calls newStackWalk for each of the contained GCMapIterators.

Assumption: the thread is currently suspended, ie. its saved gprs[] contain the thread's full register state.

Side effect: registerLocations[] initialized with pointers to the thread's saved gprs[] (in thread.contextRegisters.gprs)

Parameters:
thread - Thread whose registers and stack are to be scanned

selectIterator

public GCMapIterator selectIterator(CompiledMethod compiledMethod)
Select iterator for scanning for object references in a stackframe. Called by collector threads while scanning a threads stack.

Parameters:
compiledMethod - CompiledMethod for the method executing in the stack frame
Returns:
GCMapIterator to use

getJniIterator

public GCMapIterator getJniIterator()
get the GCMapIterator used for scanning JNI native stack frames.

Returns:
jniIterator