public final class FrameState extends VirtualState implements IterableNodeType
FrameState class encapsulates the frame state (i.e. local variables, operand stack
and locked objects) at a particular point in the abstract interpretation.
This can be used as debug or deoptimization information.| Modifier and Type | Class and Description |
|---|---|
static interface |
FrameState.ValueFunction
Function for computing a value in this frame state.
|
VirtualState.NodeClosure<T extends Node>, VirtualState.NodePositionClosure<T extends Node>, VirtualState.VirtualClosureNode.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberable| Modifier and Type | Field and Description |
|---|---|
int |
bci
The bytecode index to which this frame state applies.
|
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 |
NODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Constructor and Description |
|---|
FrameState(FrameState outerFrameState,
Bytecode code,
int bci,
int localsSize,
int stackSize,
int locksSize,
boolean rethrowException,
boolean duringCall,
List<MonitorIdNode> monitorIds,
List<EscapeObjectState> virtualObjectMappings) |
FrameState(FrameState outerFrameState,
Bytecode code,
int bci,
List<ValueNode> values,
int localsSize,
int stackSize,
int locksSize,
boolean rethrowException,
boolean duringCall,
List<MonitorIdNode> monitorIds,
List<EscapeObjectState> virtualObjectMappings,
FrameState.ValueFunction valueFunction) |
FrameState(FrameState outerFrameState,
Bytecode code,
int bci,
ValueNode[] locals,
ValueNode[] stack,
int stackSize,
JavaKind[] pushedSlotKinds,
ValueNode[] pushedValues,
ValueNode[] locks,
List<MonitorIdNode> monitorIds,
boolean rethrowException,
boolean duringCall) |
FrameState(int bci) |
FrameState(int bci,
ValueNode returnValueOrExceptionObject)
Creates a placeholder frame state with a single element on the stack representing a return
value or thrown exception.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addVirtualObjectMapping(EscapeObjectState virtualObject) |
void |
applyToNonVirtual(VirtualState.NodePositionClosure<? super Node> closure) |
void |
applyToVirtual(VirtualState.VirtualClosure closure)
Performs a pre-order iteration over all elements reachable from this state that are a
subclass of
VirtualState. |
boolean |
canProduceBytecodeFrame()
Determines if this frame state can be converted to a
BytecodeFrame. |
FrameState |
duplicate()
Gets a copy of this frame state.
|
FrameState |
duplicate(FrameState.ValueFunction valueFunc)
Gets a copy of this frame state with each value in the copy computed by applying
valueFunc to the FrameState.values() in this frame state. |
FrameState |
duplicateModified(JavaKind popKind,
JavaKind pushedSlotKind,
ValueNode pushedValue,
List<EscapeObjectState> pushedVirtualObjectMappings)
Creates a copy of this frame state with the top of stack replaced with
pushedValue
which must be of type popKind. |
FrameState |
duplicateModified(StructuredGraph graph,
int newBci,
boolean newRethrowException,
boolean newDuringCall,
JavaKind popKind,
JavaKind[] pushedSlotKinds,
ValueNode[] pushedValues,
List<EscapeObjectState> pushedVirtualObjectMappings) |
FrameState |
duplicateModified(StructuredGraph graph,
int newBci,
boolean newRethrowException,
boolean newDuringCall,
JavaKind popKind,
JavaKind[] pushedSlotKinds,
ValueNode[] pushedValues,
List<EscapeObjectState> pushedVirtualObjectMappings,
boolean checkStackDepth)
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,
JavaKind popKind,
JavaKind[] pushedSlotKinds,
ValueNode[] pushedValues,
List<EscapeObjectState> pushedVirtualObjectMappings) |
FrameState |
duplicateModifiedDuringCall(int newBci,
JavaKind 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() |
Bytecode |
getCode() |
Map<Object,Object> |
getDebugProperties(Map<Object,Object> map)
Fills a
Map with properties of this for use in debugging (e.g., to view in
the ideal graph visualizer). |
Node |
getInput(Position p)
Wrapper for
Position.get(Node) that is aware of the local variable storage truncation
in FrameState.values(). |
ResolvedJavaMethod |
getMethod() |
NodeIterable<FrameState> |
innerFrameStates() |
boolean |
isExceptionHandlingBCI() |
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.
|
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 size (height) of the stack.
|
static NodeSourcePosition |
toSourcePosition(FrameState fs) |
String |
toString(Verbosity verbosity)
Creates a String representation for
this with a given Verbosity. |
NodeInputList<ValueNode> |
values()
Gets the list of values in this frame state.
|
boolean |
verify() |
EscapeObjectState |
virtualObjectMappingAt(int i) |
int |
virtualObjectMappingCount() |
NodeInputList<EscapeObjectState> |
virtualObjectMappings() |
graphafterClone, applyInputs, applySuccessors, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, checkReplaceAtUsagesInvariants, clearInputs, clearNodeSourcePosition, clearSuccessors, copyWithInputs, copyWithInputs, dataFlowEquals, dynamicNodeSizeEstimate, estimatedNodeCycles, estimatedNodeSize, fail, formatTo, getCreationPosition, getDebug, getDebugProperties, getInsertionPosition, getNodeClass, getNodeSourcePosition, getOptions, getUsageCount, hasExactlyOneUsage, hashCode, hasMoreThanOneUsage, hasNoUsages, hasOnlyUsagesOfType, hasUsages, hasUsagesOfType, inputPositions, inputs, isAlive, isAllowedUsageType, isDeleted, isUnregistered, markDeleted, maybeNotifyZeroUsages, modCount, predecessor, pushInputs, removeUsage, replaceAllInputs, replaceAndDelete, replaceAtAllUsages, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsagesAndDelete, replaceAtUsagesAndDelete, replaceFirstInput, replaceFirstSuccessor, safeDelete, setCreationPosition, setInsertionPosition, setNodeSourcePosition, singleUsage, successorPositions, successors, toString, updateNodeSourcePosition, updatePredecessor, updateUsages, usages, valueEquals, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePositionpublic static final NodeClass<FrameState> TYPE
public static final ValueNode TWO_SLOT_MARKER
null in the
FrameState.values of the FrameState.public final int bci
public FrameState(FrameState outerFrameState, Bytecode code, int bci, int localsSize, int stackSize, int locksSize, boolean rethrowException, boolean duringCall, List<MonitorIdNode> monitorIds, List<EscapeObjectState> virtualObjectMappings)
public FrameState(FrameState outerFrameState, Bytecode code, int bci, List<ValueNode> values, int localsSize, int stackSize, int locksSize, boolean rethrowException, boolean duringCall, List<MonitorIdNode> monitorIds, List<EscapeObjectState> virtualObjectMappings, FrameState.ValueFunction valueFunction)
values - see FrameState.values()public FrameState(int bci)
public FrameState(int bci,
ValueNode returnValueOrExceptionObject)
stateAfter to the inlining call
site.bci - this must be BytecodeFrame.AFTER_BCIpublic FrameState(FrameState outerFrameState, Bytecode code, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues, ValueNode[] locks, List<MonitorIdNode> monitorIds, boolean rethrowException, boolean duringCall)
public NodeInputList<ValueNode> values()
<-- locksSize --> <-- stackSize --> <----- localsSize ----> +-----------------+-----------------+---------+-------------+ | locks | stack | locals | null locals | +-----------------+-----------------+---------+-------------+ <-------------- values.size() -------------->
public Node getInput(Position p)
Position.get(Node) that is aware of the local variable storage truncation
in FrameState.values(). That is, if p denotes a valid local variable index for which
there is no allocated storage, null is returned.public NodeInputList<MonitorIdNode> monitorIds()
public FrameState outerFrameState()
public void setOuterFrameState(FrameState x)
public static NodeSourcePosition toSourcePosition(FrameState fs)
public boolean rethrowException()
BytecodeFrame.rethrowExceptionpublic boolean duringCall()
public Bytecode getCode()
public ResolvedJavaMethod getMethod()
public boolean canProduceBytecodeFrame()
BytecodeFrame.
Since a BytecodeFrame encodes FrameState.getMethod() and FrameState.bci, it does not
preserve FrameState.getCode(). FrameState.bci is only guaranteed to be valid in terms of
getCode().getCode() which may be different from getMethod().getCode() if the
latter has been subject to instrumentation.public void addVirtualObjectMapping(EscapeObjectState virtualObject)
public int virtualObjectMappingCount()
public EscapeObjectState virtualObjectMappingAt(int i)
public NodeInputList<EscapeObjectState> virtualObjectMappings()
public FrameState duplicate()
public FrameState duplicate(FrameState.ValueFunction valueFunc)
valueFunc to the FrameState.values() in this frame state.public FrameState duplicateWithVirtualState()
duplicateWithVirtualState in class VirtualStatepublic FrameState duplicateModifiedDuringCall(int newBci, JavaKind popKind)
popKind popped from
the stack.public FrameState duplicateModifiedBeforeCall(int newBci, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues, List<EscapeObjectState> pushedVirtualObjectMappings)
public FrameState duplicateModified(JavaKind popKind, JavaKind pushedSlotKind, ValueNode pushedValue, List<EscapeObjectState> pushedVirtualObjectMappings)
pushedValue
which must be of type popKind.public FrameState duplicateModified(StructuredGraph graph, int newBci, boolean newRethrowException, boolean newDuringCall, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues, List<EscapeObjectState> pushedVirtualObjectMappings)
public FrameState duplicateModified(StructuredGraph graph, int newBci, boolean newRethrowException, boolean newDuringCall, JavaKind popKind, JavaKind[] pushedSlotKinds, ValueNode[] pushedValues, List<EscapeObjectState> pushedVirtualObjectMappings, boolean checkStackDepth)
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. The bci will be changed to newBci.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()
public String toString(Verbosity verbosity)
Nodethis with a given Verbosity.public Map<Object,Object> getDebugProperties(Map<Object,Object> map)
NodeMap with properties of this 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 Nodepublic void applyToVirtual(VirtualState.VirtualClosure closure)
VirtualStateVirtualState.applyToVirtual in class VirtualStatepublic void applyToNonVirtual(VirtualState.NodePositionClosure<? super Node> closure)
applyToNonVirtual in class VirtualStatepublic boolean isPartOfThisState(VirtualState state)
isPartOfThisState in class VirtualStatepublic boolean isExceptionHandlingBCI()