public final class FrameState extends VirtualState implements IterableNodeType
FrameState
class encapsulates the frame state (i.e. local variables and operand
stack) at a particular point in the abstract interpretation.
This can be used as debug or deoptimization information.Modifier and Type | Class and Description |
---|---|
private static class |
FrameState.TwoSlotMarker |
VirtualState.NodeClosure<T extends Node>, VirtualState.VirtualClosure
Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Modifier and Type | Field and Description |
---|---|
int |
bci
The bytecode index to which this frame state applies.
|
protected boolean |
duringCall |
protected int |
localsSize |
protected ResolvedJavaMethod |
method |
private static DebugMetric |
METRIC_FRAMESTATE_COUNT |
(package private) NodeInputList<MonitorIdNode> |
monitorIds |
(package private) FrameState |
outerFrameState |
protected boolean |
rethrowException |
protected int |
stackSize |
static ValueNode |
TWO_SLOT_MARKER
Marker value for the second slot of values that occupy two local variable or expression stack
slots.
|
static NodeClass<FrameState> |
TYPE |
(package private) NodeInputList<ValueNode> |
values
Contains the locals, the expressions and the locked objects, in this order.
|
(package private) NodeInputList<EscapeObjectState> |
virtualObjectMappings |
NODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Constructor and Description |
---|
FrameState(FrameState outerFrameState,
ResolvedJavaMethod method,
int bci,
int localsSize,
int stackSize,
int lockSize,
boolean rethrowException,
boolean duringCall,
List<MonitorIdNode> monitorIds,
List<EscapeObjectState> virtualObjectMappings) |
FrameState(FrameState outerFrameState,
ResolvedJavaMethod method,
int bci,
List<ValueNode> values,
int localsSize,
int stackSize,
boolean rethrowException,
boolean duringCall,
List<MonitorIdNode> monitorIds,
List<EscapeObjectState> virtualObjectMappings) |
FrameState(FrameState outerFrameState,
ResolvedJavaMethod method,
int bci,
ValueNode[] locals,
ValueNode[] stack,
int stackSize,
ValueNode[] locks,
List<MonitorIdNode> monitorIds,
boolean rethrowException,
boolean duringCall) |
FrameState(int bci) |
FrameState(int bci,
ValueNode returnValue)
Creates a placeholder frame state with a single element on the stack representing a return
value.
|
Modifier and Type | Method and Description |
---|---|
void |
addVirtualObjectMapping(EscapeObjectState virtualObject) |
void |
applyToNonVirtual(VirtualState.NodeClosure<? super ValueNode> closure) |
void |
applyToVirtual(VirtualState.VirtualClosure closure)
Performs a pre-order iteration over all elements reachable from this state that are a
subclass of
VirtualState . |
private boolean |
checkStackDepth(int oldBci,
int oldStackSize,
boolean oldDuringCall,
boolean oldRethrowException,
int newBci,
int newStackSize,
boolean newDuringCall,
boolean newRethrowException)
Perform a few sanity checks on the transformation of the stack state.
|
private void |
createValues(ValueNode[] locals,
ValueNode[] stack,
ValueNode[] locks) |
FrameState |
duplicate()
Gets a copy of this frame state.
|
FrameState |
duplicate(int newBci)
Gets a copy of this frame state.
|
FrameState |
duplicateModified(int newBci,
boolean newRethrowException,
Kind popKind,
Kind[] pushedSlotKinds,
ValueNode[] pushedValues)
Creates a copy of this frame state with one stack element of type
popKind popped from
the stack and the values in pushedValues pushed on the stack. |
FrameState |
duplicateModified(Kind popKind,
Kind pushedSlotKind,
ValueNode pushedValue)
Creates a copy of this frame state with the top of stack replaced with with
pushedValue which must be of type popKind . |
FrameState |
duplicateModified(StructuredGraph graph,
int newBci,
boolean newRethrowException,
boolean newDuringCall,
Kind popKind,
Kind[] pushedSlotKinds,
ValueNode[] pushedValues)
Creates a copy of this frame state with one stack element of type popKind popped from the
stack and the values in pushedValues pushed on the stack.
|
FrameState |
duplicateModifiedBeforeCall(int newBci,
Kind popKind,
Kind[] pushedSlotKinds,
ValueNode[] pushedValues) |
FrameState |
duplicateModifiedDuringCall(int newBci,
Kind popKind)
Creates a copy of this frame state with one stack element of type
popKind popped from
the stack. |
FrameState |
duplicateWithVirtualState()
Duplicates a FrameState, along with a deep copy of all connected VirtualState (outer
FrameStates, VirtualObjectStates, ...).
|
boolean |
duringCall() |
Map<Object,Object> |
getDebugProperties(Map<Object,Object> map)
Fills a
Map with properties of this node for use in debugging (e.g., to view in the
ideal graph visualizer). |
NodeIterable<FrameState> |
innerFrameStates() |
boolean |
isPartOfThisState(VirtualState state) |
ValueNode |
localAt(int i)
Gets the value in the local variables at the specified index.
|
int |
localsSize()
Gets the size of the local variables.
|
ValueNode |
lockAt(int i)
Get the monitor owner at the specified index.
|
int |
locksSize()
Gets the number of locked monitors in this frame state.
|
ResolvedJavaMethod |
method() |
MonitorIdNode |
monitorIdAt(int i)
Get the MonitorIdNode that corresponds to the locked object at the specified index.
|
int |
monitorIdCount() |
NodeInputList<MonitorIdNode> |
monitorIds() |
int |
nestedLockDepth()
Gets the number of locked monitors in this frame state and all
outer frame states.
|
FrameState |
outerFrameState() |
boolean |
rethrowException() |
void |
setOuterFrameState(FrameState x) |
ValueNode |
stackAt(int i)
Get the value on the stack at the specified stack index.
|
int |
stackSize()
Gets the current size (height) of the stack.
|
BytecodePosition |
toBytecodePosition() |
static BytecodePosition |
toBytecodePosition(FrameState fs) |
private static String |
toString(FrameState frameState) |
String |
toString(Verbosity verbosity)
Creates a String representation for this node with a given
Verbosity . |
NodeInputList<ValueNode> |
values() |
boolean |
verify() |
EscapeObjectState |
virtualObjectMappingAt(int i) |
int |
virtualObjectMappingCount() |
NodeInputList<EscapeObjectState> |
virtualObjectMappings() |
graph
acceptInputs, acceptSuccessors, afterClone, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, clearInputs, clearSuccessors, copyWithInputs, copyWithInputs, equals, fail, formatTo, getDebugProperties, getId, getNodeClass, getUsageAt, getUsageCount, hashCode, hasNoUsages, hasUsages, inputs, isAlive, isAllowedUsageType, isDeleted, markDeleted, modCount, newIdentityMap, newIdentityMap, newIdentityMap, newMap, newMap, newMap, newSet, newSet, predecessor, pushInputs, removeUsage, replaceAndDelete, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceFirstInput, replaceFirstSuccessor, safeDelete, simplify, successors, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verifyEdges, verifyInputs
public static final NodeClass<FrameState> TYPE
private static final DebugMetric METRIC_FRAMESTATE_COUNT
public static final ValueNode TWO_SLOT_MARKER
null
in the
values
of the FrameState
.protected final int localsSize
protected final int stackSize
protected boolean rethrowException
BytecodeFrame.rethrowException
protected final boolean duringCall
FrameState outerFrameState
NodeInputList<ValueNode> values
NodeInputList<MonitorIdNode> monitorIds
NodeInputList<EscapeObjectState> virtualObjectMappings
public final int bci
protected final ResolvedJavaMethod method
public FrameState(FrameState outerFrameState, ResolvedJavaMethod method, int bci, int localsSize, int stackSize, int lockSize, boolean rethrowException, boolean duringCall, List<MonitorIdNode> monitorIds, List<EscapeObjectState> virtualObjectMappings)
public FrameState(FrameState outerFrameState, ResolvedJavaMethod method, int bci, List<ValueNode> values, int localsSize, int stackSize, boolean rethrowException, boolean duringCall, List<MonitorIdNode> monitorIds, List<EscapeObjectState> virtualObjectMappings)
public FrameState(int bci)
public FrameState(int bci, ValueNode returnValue)
stateAfter
to the inlining call site.bci
- this must be BytecodeFrame.AFTER_BCI
public FrameState(FrameState outerFrameState, ResolvedJavaMethod method, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, ValueNode[] locks, List<MonitorIdNode> monitorIds, boolean rethrowException, boolean duringCall)
private void createValues(ValueNode[] locals, ValueNode[] stack, ValueNode[] locks)
public NodeInputList<ValueNode> values()
public NodeInputList<MonitorIdNode> monitorIds()
public FrameState outerFrameState()
public void setOuterFrameState(FrameState x)
public BytecodePosition toBytecodePosition()
public static BytecodePosition toBytecodePosition(FrameState fs)
public boolean rethrowException()
BytecodeFrame.rethrowException
public boolean duringCall()
public ResolvedJavaMethod method()
public void addVirtualObjectMapping(EscapeObjectState virtualObject)
public int virtualObjectMappingCount()
public EscapeObjectState virtualObjectMappingAt(int i)
public NodeInputList<EscapeObjectState> virtualObjectMappings()
public FrameState duplicate(int newBci)
public FrameState duplicate()
public FrameState duplicateWithVirtualState()
duplicateWithVirtualState
in class VirtualState
public FrameState duplicateModifiedDuringCall(int newBci, Kind popKind)
popKind
popped from
the stack.public FrameState duplicateModifiedBeforeCall(int newBci, Kind popKind, Kind[] pushedSlotKinds, ValueNode[] pushedValues)
public FrameState duplicateModified(int newBci, boolean newRethrowException, Kind popKind, Kind[] pushedSlotKinds, ValueNode[] pushedValues)
popKind
popped from
the stack and the values in pushedValues
pushed on the stack. The
pushedValues
will be formatted correctly in slot encoding: a long or double will be
followed by a null slot.public FrameState duplicateModified(Kind popKind, Kind pushedSlotKind, ValueNode pushedValue)
pushedValue
which must be of type popKind
.public FrameState duplicateModified(StructuredGraph graph, int newBci, boolean newRethrowException, boolean newDuringCall, Kind popKind, Kind[] pushedSlotKinds, ValueNode[] pushedValues)
private boolean checkStackDepth(int oldBci, int oldStackSize, boolean oldDuringCall, boolean oldRethrowException, int newBci, int newStackSize, boolean newDuringCall, boolean newRethrowException)
public int localsSize()
public int stackSize()
public int locksSize()
public int nestedLockDepth()
public ValueNode localAt(int i)
i
- the index into the localspublic ValueNode stackAt(int i)
i
- the index into the stack, with 0
being the bottom of the stackpublic ValueNode lockAt(int i)
i
- the index into the list of locked monitors.public MonitorIdNode monitorIdAt(int i)
public int monitorIdCount()
public NodeIterable<FrameState> innerFrameStates()
private static String toString(FrameState frameState)
public String toString(Verbosity verbosity)
Node
Verbosity
.public Map<Object,Object> getDebugProperties(Map<Object,Object> map)
Node
Map
with properties of this node for use in debugging (e.g., to view in the
ideal graph visualizer). Subclasses overriding this method should also fill the map using
their superclass.getDebugProperties
in class Node
public void applyToNonVirtual(VirtualState.NodeClosure<? super ValueNode> closure)
applyToNonVirtual
in class VirtualState
public void applyToVirtual(VirtualState.VirtualClosure closure)
VirtualState
VirtualState
.applyToVirtual
in class VirtualState
public boolean isPartOfThisState(VirtualState state)
isPartOfThisState
in class VirtualState