public abstract class OptGenericGCMapIterator extends GCMapIterator
The architecture-dependent code is provided by the subclasses of this class.
Modifier and Type | Field and Description |
---|---|
protected OptCompiledMethod |
compiledMethod
The compiled method
|
private int |
currentRegister
This shows which register to inspect and report on.
|
private static boolean |
DEBUG
just used for debugging, all output statements use VM.syswrite
|
(package private) static boolean |
lookForMissedReferencesInRegs
when set to true, all registers and spills will be inspected for
values that look like references.
|
(package private) static boolean |
lookForMissedReferencesInSpills |
private OptMachineCodeMap |
map
The GC map for this method
|
private int |
mapIndex
Used to index into the GC map
|
private Address |
spillLoc
This caches the spill location, so that we can check for missed refs
hiding in spills
|
(package private) static boolean |
VERBOSE
just used for verbose debugging, all output statements use VM.syswrite
|
framePtr, registerLocations, thread
Modifier | Constructor and Description |
---|---|
protected |
OptGenericGCMapIterator(AddressArray registerLocations) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
checkAllRegistersForMissedReferences()
This method inspects all the registers for values that look like refs.
|
(package private) void |
checkCurrentRegisterForMissedReferences()
This method inspects the "current" register for values that look like refs.
|
(package private) void |
checkForMissedSpills(Address ref1,
Address ref2)
This method inspects spill locations between the parameters passed
to determine if they look like heap points
If the first parameter is 0, it looks from the beginning of the frame
until new.
|
(package private) void |
checkRegistersForMissedReferences(int firstReg,
int lastReg)
This method inspects the registers from firstReg to lastReg (inclusive)
for values that look like pointers.
|
void |
cleanupPointers()
scan of this frame is complete
clean up any pointers to allow GC to reclaim dead objects
|
boolean |
currentRegisterIsValid()
Determines if the value of "currentRegister" is valid, or if we
processed all registers
|
int |
getCurrentRegister()
return the current register we are processing
|
abstract Address |
getFirstSpillLoc()
Get address of the first spill location
(The location of spills varies among architectures.)
|
abstract Address |
getLastSpillLoc()
Get address of the last spill location
(The location of spills varies among architectures.)
|
Address |
getNextReferenceAddress()
Returns the next address that contains a reference
|
Address |
getNextReturnAddressAddress()
This method is called repeatedly to process derived pointers related
to JSRs.
|
abstract Address |
getStackLocation(Address framePtr,
int offset)
Determine the stack location given the frame ptr and spill offset.
|
int |
getType()
Get the type of this iterator (BASELINE, OPT, etc.).
|
void |
reset()
Externally visible method called to reset internal state
|
void |
setupIterator(CompiledMethod cm,
Offset instructionOffset,
Address framePtr)
Initialize the iterator for another stack frame scan
|
void |
updateCurrentRegister()
update the state of the current register we are processing
|
protected abstract void |
updateLocateRegisters()
If any non-volatile gprs were saved by the method being processed
then update the registerLocations array with the locations where the
registers were saved.
|
newStackWalk
protected OptCompiledMethod compiledMethod
private OptMachineCodeMap map
private int mapIndex
private int currentRegister
private Address spillLoc
private static final boolean DEBUG
static final boolean VERBOSE
static final boolean lookForMissedReferencesInRegs
static final boolean lookForMissedReferencesInSpills
protected OptGenericGCMapIterator(AddressArray registerLocations)
public final void setupIterator(CompiledMethod cm, Offset instructionOffset, Address framePtr)
setupIterator
in class GCMapIterator
cm
- The compiled method we are interested ininstructionOffset
- The place in the method where we currently areframePtr
- The current frame pointerpublic final Address getNextReferenceAddress()
getNextReferenceAddress
in class GCMapIterator
public final Address getNextReturnAddressAddress()
getNextReturnAddressAddress
in class GCMapIterator
public final void cleanupPointers()
cleanupPointers
in class GCMapIterator
public final int getType()
GCMapIterator
getType
in class GCMapIterator
public final void reset()
reset
in class GCMapIterator
public final int getCurrentRegister()
public final void updateCurrentRegister()
public final boolean currentRegisterIsValid()
protected abstract void updateLocateRegisters()
public abstract Address getStackLocation(Address framePtr, int offset)
framePtr
- the frame pointeroffset
- the offsetpublic abstract Address getFirstSpillLoc()
public abstract Address getLastSpillLoc()
final void checkCurrentRegisterForMissedReferences()
final void checkAllRegistersForMissedReferences()
final void checkRegistersForMissedReferences(int firstReg, int lastReg)
firstReg
- first reg to checklastReg
- last reg to checkfinal void checkForMissedSpills(Address ref1, Address ref2)
ref1
- the last spill found as a referenceref2
- the next spill found as a reference