org.jikesrvm.compilers.common
Class HardwareTrapGCMapIterator

java.lang.Object
  extended by org.jikesrvm.mm.mminterface.GCMapIterator
      extended by org.jikesrvm.compilers.common.HardwareTrapGCMapIterator
All Implemented Interfaces:
SizeConstants

public final class HardwareTrapGCMapIterator
extends GCMapIterator
implements SizeConstants

Iterator for stack frames inserted by hardware trap handler. Such frames are purely used as markers. They contain no object references or JSR return addresses.


Field Summary
 
Fields inherited from class org.jikesrvm.mm.mminterface.GCMapIterator
framePtr, registerLocations, thread
 
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
HardwareTrapGCMapIterator(WordArray registerLocations)
           
 
Method Summary
 void cleanupPointers()
          Iteration is complete, release any internal data structures including locks acquired during setupIterator for jsr maps.
 Address getNextReferenceAddress()
          Get address of next object reference held by current stackframe.
 Address getNextReturnAddressAddress()
          Get address of next JSR return address held by current stackframe.
 int getType()
          Get the type of this iterator (BASELINE, OPT, etc.).
 void reset()
          Prepare to re-iterate on same stackframe, and to switch between "reference" iteration and "JSR return address" iteration.
 void setupIterator(CompiledMethod compiledMethod, Offset instructionOffset, Address framePtr)
          Prepare to iterate over object references and JSR return addresses held by a stackframe.
 
Methods inherited from class org.jikesrvm.mm.mminterface.GCMapIterator
newStackWalk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HardwareTrapGCMapIterator

public HardwareTrapGCMapIterator(WordArray registerLocations)
Method Detail

setupIterator

public void setupIterator(CompiledMethod compiledMethod,
                          Offset instructionOffset,
                          Address framePtr)
Description copied from class: GCMapIterator
Prepare to iterate over object references and JSR return addresses held by a stackframe.

Specified by:
setupIterator in class GCMapIterator
Parameters:
compiledMethod - method running in the stackframe
instructionOffset - offset of current instruction within that method's code
framePtr - address of stackframe to be visited

getNextReferenceAddress

public Address getNextReferenceAddress()
Description copied from class: GCMapIterator
Get address of next object reference held by current stackframe. Returns zero when there are no more references to report.

Side effect: registerLocations[] updated at end of iteration. TODO: registerLocations[] update should be done via separately called method instead of as side effect.

Specified by:
getNextReferenceAddress in class GCMapIterator
Returns:
address of word containing an object reference zero if no more references to report

getNextReturnAddressAddress

public Address getNextReturnAddressAddress()
Description copied from class: GCMapIterator
Get address of next JSR return address held by current stackframe.

Specified by:
getNextReturnAddressAddress in class GCMapIterator
Returns:
address of word containing a JSR return address zero if no more return addresses to report

reset

public void reset()
Description copied from class: GCMapIterator
Prepare to re-iterate on same stackframe, and to switch between "reference" iteration and "JSR return address" iteration.

Specified by:
reset in class GCMapIterator

cleanupPointers

public void cleanupPointers()
Description copied from class: GCMapIterator
Iteration is complete, release any internal data structures including locks acquired during setupIterator for jsr maps.

Specified by:
cleanupPointers in class GCMapIterator

getType

public int getType()
Description copied from class: GCMapIterator
Get the type of this iterator (BASELINE, OPT, etc.). Called from GCMapIteratorGroup to select which iterator to use for a stackframe. The possible types are specified in CompiledMethod.

Specified by:
getType in class GCMapIterator
Returns:
type code for this iterator