public class BytecodeFrame extends BytecodePosition
locations
where to find the local variables, operand stack values and locked objects of the bytecode
frame(s).Modifier and Type | Field and Description |
---|---|
static int |
AFTER_BCI
The BCI for the state after finishing the execution of a method and returning normally.
|
static int |
AFTER_EXCEPTION_BCI
The BCI for exception unwind.
|
static int |
BEFORE_BCI
The BCI for the state before starting to execute a method.
|
boolean |
duringCall |
static int |
INVALID_FRAMESTATE_BCI
This BCI should be used for states that cannot be the target of a deoptimization, like
snippet frame states.
|
int |
numLocals
The number of locals in the values array.
|
int |
numLocks
The number of locks in the values array.
|
int |
numStack
The number of stack slots in the values array.
|
boolean |
rethrowException
True if this is a position inside an exception handler before the exception object has been
consumed.
|
static int |
UNKNOWN_BCI
This BCI should be used for frame states that are built for code with no meaningful BCI.
|
static int |
UNWIND_BCI
The BCI for exception unwind.
|
Value[] |
values
An array of values representing how to reconstruct the state of the Java frame.
|
Constructor and Description |
---|
BytecodeFrame(BytecodeFrame caller,
ResolvedJavaMethod method,
int bci,
boolean rethrowException,
boolean duringCall,
Value[] values,
int numLocals,
int numStack,
int numLocks)
Creates a new frame object.
|
Modifier and Type | Method and Description |
---|---|
BytecodeFrame |
caller()
Gets the caller of this frame.
|
boolean |
equals(Object obj)
Deep equality test.
|
Value |
getLocalValue(int i)
Gets the value representing the specified local variable.
|
Value |
getLockValue(int i)
Gets the value representing the specified lock.
|
static String |
getPlaceholderBciName(int bci)
Gets the name of a given placeholder BCI.
|
Value |
getStackValue(int i)
Gets the value representing the specified stack slot.
|
static boolean |
isPlaceholderBci(int bci)
Determines if a given BCI matches one of the placeholder BCI constants defined in this class.
|
String |
toString()
Converts this code position to a string representation.
|
boolean |
validateFormat(boolean derivedOk)
Ensure that the frame state is formatted as expected by the JVM, with null or Illegal in the
slot following a double word item.
|
public final Value[] values
Start index (inclusive) | End index (exclusive) | Description |
---|---|---|
0 | numLocals | Local variables |
numLocals | numLocals + numStack | Operand stack |
numLocals + numStack | values.length | Locked objects |
Note that the number of locals and the number of stack slots may be smaller than the maximum number of locals and stack slots as specified in the compiled method.
public final int numLocals
public final int numStack
public final int numLocks
public final boolean rethrowException
numStack
== 1
and getStackValue(0)
is the location of the exception object. If deoptimization happens at this
position, the interpreter will rethrow the exception instead of executing the bytecode
instruction at this position.public final boolean duringCall
public static final int UNKNOWN_BCI
public static final int UNWIND_BCI
AFTER_EXCEPTION_BCI
, at this point, if the method is synchronized,
the monitor is still held.public static final int BEFORE_BCI
public static final int AFTER_BCI
public static final int AFTER_EXCEPTION_BCI
UNWIND_BCI
, at this point, if the method is synchronized, the
monitor is already released.public static final int INVALID_FRAMESTATE_BCI
public BytecodeFrame(BytecodeFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks)
caller
- the caller frame (which may be null
)method
- the methodbci
- a BCI within the methodrethrowException
- specifies if the VM should re-throw the pending exception when
deopt'ing using this framevalues
- the frame state values
numLocals
- the number of local variablesnumStack
- the depth of the stacknumLocks
- the number of locked objectspublic static boolean isPlaceholderBci(int bci)
public static String getPlaceholderBciName(int bci)
public boolean validateFormat(boolean derivedOk)
public Value getLocalValue(int i)
i
- the local variable indexpublic Value getStackValue(int i)
i
- the stack indexpublic Value getLockValue(int i)
i
- the lock indexpublic BytecodeFrame caller()
null
if this frame has no callerpublic boolean equals(Object obj)
BytecodePosition
equals
in class BytecodePosition
public String toString()
BytecodePosition
toString
in class BytecodePosition