org.jikesrvm.runtime
Class StackBrowser

java.lang.Object
  extended by org.jikesrvm.runtime.StackBrowser
All Implemented Interfaces:
ArchitectureSpecific.StackframeLayoutConstants, StackframeLayoutConstants

public final class StackBrowser
extends Object
implements ArchitectureSpecific.StackframeLayoutConstants

Use this class to explore the stack. It is sometimes necessary to find out the current context class loader, and other things like that.


Field Summary
private  int currentBytecodeIndex
          Bytecode associated with current stack location
private  CompiledMethod currentCompiledMethod
          The current compiled method
private  Address currentFramePointer
          The frame pointer for the current stack location
private  int currentInlineEncodingIndex
          The current inline encoding index for opt compiled methods
private  Offset currentInstructionPointer
          The offset of the current instruction within its method
private  RVMMethod currentMethod
          Method associated with current stack location
 
Fields inherited from interface org.jikesrvm.ia32.StackframeLayoutConstants
BYTES_IN_STACKSLOT, FPU_STATE_SIZE, INVISIBLE_METHOD_ID, LOG_BYTES_IN_STACKSLOT, STACK_SIZE_BOOT, STACK_SIZE_COLLECTOR, STACK_SIZE_DLOPEN, STACK_SIZE_GCDISABLED, STACK_SIZE_GROW, STACK_SIZE_GUARD, STACK_SIZE_JNINATIVE_GROW, STACK_SIZE_MAX, STACK_SIZE_NORMAL, STACK_SIZE_SYSCALL, STACKFRAME_ALIGNMENT, STACKFRAME_BODY_OFFSET, STACKFRAME_FRAME_POINTER_OFFSET, STACKFRAME_HEADER_SIZE, STACKFRAME_METHOD_ID_OFFSET, STACKFRAME_RETURN_ADDRESS_OFFSET, STACKFRAME_SENTINEL_FP, XMM_STATE_SIZE
 
Constructor Summary
StackBrowser()
           
 
Method Summary
 int getBytecodeIndex()
          The bytecode index associated with the current stack frame
 ClassLoader getClassLoader()
          The class loader of the method associated with the current stack frame
 CompiledMethod getCompiledMethod()
          The compiled method associated with the current stack frame
 RVMClass getCurrentClass()
          The class of the method associated with the current stack frame
 int getInlineEncodingIndex()
          Get the inline encoding associated with the current stack location, called only by opt compiled methods
 RVMMethod getMethod()
          The method associated with the current stack frame
 boolean hasMoreFrames()
          Are there more stack frames?
 void init()
          Initialise state of browser
 void setBytecodeIndex(int bytecodeIndex)
          Set the current bytecode index, called only by the appropriate compiled method code
 void setCompiledMethod(CompiledMethod cm)
          Set the current compiled method, called only by the appropriate compiled method code
 void setInlineEncodingIndex(int index)
          Set the inline encoding for opt compiled methods only
 void setMethod(RVMMethod method)
          Set the current method, called only by the appropriate compiled method code
 void up()
          Browse up one frame eliding native frames
private  void upOneFrame()
          Browse up one frame failing if we fall off the stack
private  boolean upOneFrameInternal(boolean set)
          Browse up one frame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentMethod

private RVMMethod currentMethod
Method associated with current stack location


currentBytecodeIndex

private int currentBytecodeIndex
Bytecode associated with current stack location


currentFramePointer

private Address currentFramePointer
The frame pointer for the current stack location


currentInstructionPointer

private Offset currentInstructionPointer
The offset of the current instruction within its method


currentCompiledMethod

private CompiledMethod currentCompiledMethod
The current compiled method


currentInlineEncodingIndex

private int currentInlineEncodingIndex
The current inline encoding index for opt compiled methods

Constructor Detail

StackBrowser

public StackBrowser()
Method Detail

init

public void init()
Initialise state of browser


upOneFrameInternal

private boolean upOneFrameInternal(boolean set)
Browse up one frame

Parameters:
set - should the state of the stack browser be effected?
Returns:
do more frames exist?

upOneFrame

private void upOneFrame()
Browse up one frame failing if we fall off the stack


hasMoreFrames

public boolean hasMoreFrames()
Are there more stack frames?


up

public void up()
Browse up one frame eliding native frames


setBytecodeIndex

public void setBytecodeIndex(int bytecodeIndex)
Set the current bytecode index, called only by the appropriate compiled method code


setMethod

public void setMethod(RVMMethod method)
Set the current method, called only by the appropriate compiled method code


setCompiledMethod

public void setCompiledMethod(CompiledMethod cm)
Set the current compiled method, called only by the appropriate compiled method code


setInlineEncodingIndex

public void setInlineEncodingIndex(int index)
Set the inline encoding for opt compiled methods only


getBytecodeIndex

public int getBytecodeIndex()
The bytecode index associated with the current stack frame


getMethod

public RVMMethod getMethod()
The method associated with the current stack frame


getCompiledMethod

public CompiledMethod getCompiledMethod()
The compiled method associated with the current stack frame


getCurrentClass

public RVMClass getCurrentClass()
The class of the method associated with the current stack frame


getClassLoader

public ClassLoader getClassLoader()
The class loader of the method associated with the current stack frame


getInlineEncodingIndex

public int getInlineEncodingIndex()
Get the inline encoding associated with the current stack location, called only by opt compiled methods