public interface Frame
Object
.Modifier and Type | Method and Description |
---|---|
default void |
clear(int slot)
Clears the given indexed slot in the frame.
|
default void |
clearObjectStatic(int slot)
Clears the object value at the given slot in the frame.
|
default void |
clearPrimitiveStatic(int slot)
Clears the primitive value at the given slot in the frame.
|
default void |
clearStatic(int slot)
Clears the value at the given slot in the frame.
|
default void |
copy(int srcSlot,
int destSlot)
Copies, including the type, from one slot to another.
|
default void |
copyObjectStatic(int srcSlot,
int destSlot)
Copies an object value from one slot to another.
|
default void |
copyPrimitiveStatic(int srcSlot,
int destSlot)
Copies a primitive value from one slot to another.
|
default void |
copyStatic(int srcSlot,
int destSlot)
Copies from one slot to another.
|
Object[] |
getArguments()
Retrieves the arguments object from this frame.
|
default Object |
getAuxiliarySlot(int slot) |
default boolean |
getBoolean(int slot)
Read access to a local variable of type boolean.
|
default boolean |
getBooleanStatic(int slot)
Static read access to a local variable of type boolean.
|
default byte |
getByte(int slot)
Read access to a local variable of type byte.
|
default byte |
getByteStatic(int slot)
Static read access to a local variable of type byte.
|
default double |
getDouble(int slot)
Read access to a local variable of type double.
|
default double |
getDoubleStatic(int slot)
Static read access to a local variable of type double.
|
default float |
getFloat(int slot)
Read access to a local variable of type float.
|
default float |
getFloatStatic(int slot)
Static read access to a local variable of type float.
|
FrameDescriptor |
getFrameDescriptor() |
default int |
getInt(int slot)
Read access to a local variable of type int.
|
default int |
getIntStatic(int slot)
Static read access to a local variable of type int.
|
default long |
getLong(int slot)
Read access to a local variable of type long.
|
default long |
getLongStatic(int slot)
Static read access to a local variable of type long.
|
default Object |
getObject(int slot)
Read access to a local variable of type
Object . |
default Object |
getObjectStatic(int slot)
Static read access to a local variable of type
Object . |
default byte |
getTag(int slot)
Determines the actual
FrameSlotKind of the value in the slot, and returns it as
FrameSlotKind.tag . |
default Object |
getValue(int slot)
Read access to a local variable of any type.
|
default boolean |
isBoolean(int slot)
Check whether the given indexed slot is of type boolean.
|
default boolean |
isByte(int slot)
Check whether the given indexed slot is of type byte.
|
default boolean |
isDouble(int slot)
Check whether the given indexed slot is of type double.
|
default boolean |
isFloat(int slot)
Check whether the given indexed slot is of type float.
|
default boolean |
isInt(int slot)
Check whether the given indexed slot is of type int.
|
default boolean |
isLong(int slot)
Check whether the given indexed slot is of type long.
|
default boolean |
isObject(int slot)
Check whether the given indexed slot is of type object.
|
default boolean |
isStatic(int slot)
Checks whether the given indexed slot is static.
|
MaterializedFrame |
materialize()
Materializes this frame, which allows it to be stored in a field or cast to
Object . |
default void |
setAuxiliarySlot(int slot,
Object value)
Sets the value of the given auxiliary slot.
|
default void |
setBoolean(int slot,
boolean value)
Write access to a local variable of type boolean.
|
default void |
setBooleanStatic(int slot,
boolean value)
Static write access to a local variable of type boolean.
|
default void |
setByte(int slot,
byte value)
Write access to a local variable of type byte.
|
default void |
setByteStatic(int slot,
byte value)
Static write access to a local variable of type byte.
|
default void |
setDouble(int slot,
double value)
Write access to a local variable of type double.
|
default void |
setDoubleStatic(int slot,
double value)
Static write access to a local variable of type double.
|
default void |
setFloat(int slot,
float value)
Write access to a local variable of type float.
|
default void |
setFloatStatic(int slot,
float value)
Static write access to a local variable of type float.
|
default void |
setInt(int slot,
int value)
Write access to a local variable of type int.
|
default void |
setIntStatic(int slot,
int value)
Static write access to a local variable of type int.
|
default void |
setLong(int slot,
long value)
Write access to a local variable of type long.
|
default void |
setLongStatic(int slot,
long value)
Static write access to a local variable of type long.
|
default void |
setObject(int slot,
Object value)
Write access to a local variable of type
Object . |
default void |
setObjectStatic(int slot,
Object value)
Static write access to a local variable of type
Object . |
default void |
swap(int first,
int second)
Swaps, including the type, the contents of two slots.
|
default void |
swapObjectStatic(int first,
int second)
Swaps the object values of two slots.
|
default void |
swapPrimitiveStatic(int first,
int second)
Swaps the primitive values of two slots.
|
default void |
swapStatic(int first,
int second)
Swaps the contents of two slots.
|
FrameDescriptor getFrameDescriptor()
Object[] getArguments()
MaterializedFrame materialize()
Object
.default Object getObject(int slot) throws FrameSlotTypeException
Object
.slot
- the slot of the local variableFrameSlotTypeException
- if the current value is not of type objectdefault void setObject(int slot, Object value)
Object
.slot
- the slot of the local variablevalue
- the new value of the local variabledefault byte getByte(int slot) throws FrameSlotTypeException
slot
- the slot of the local variableFrameSlotTypeException
default void setByte(int slot, byte value)
slot
- the slot of the local variablevalue
- the new value of the local variabledefault boolean getBoolean(int slot) throws FrameSlotTypeException
slot
- the slot of the local variableFrameSlotTypeException
- if the current value is not of type booleandefault void setBoolean(int slot, boolean value)
slot
- the slot of the local variablevalue
- the new value of the local variabledefault int getInt(int slot) throws FrameSlotTypeException
slot
- the slot of the local variableFrameSlotTypeException
- if the current value is not of type intdefault void setInt(int slot, int value)
slot
- the slot of the local variablevalue
- the new value of the local variabledefault long getLong(int slot) throws FrameSlotTypeException
slot
- the slot of the local variableFrameSlotTypeException
- if the current value is not of type longdefault void setLong(int slot, long value)
slot
- the slot of the local variablevalue
- the new value of the local variabledefault float getFloat(int slot) throws FrameSlotTypeException
slot
- the slot of the local variableFrameSlotTypeException
- if the current value is not of type floatdefault void setFloat(int slot, float value)
slot
- the slot of the local variablevalue
- the new value of the local variabledefault double getDouble(int slot) throws FrameSlotTypeException
slot
- the slot of the local variableFrameSlotTypeException
- if the current value is not of type doubledefault void setDouble(int slot, double value)
slot
- the slot of the local variablevalue
- the new value of the local variabledefault Object getValue(int slot)
slot
- the slot of the local variabledefault void copy(int srcSlot, int destSlot)
srcSlot
- the slot of the source local variabledestSlot
- the slot of the target local variabledefault void swap(int first, int second)
first
- the slot of the first local variablesecond
- the slot of the second local variabledefault byte getTag(int slot)
FrameSlotKind
of the value in the slot, and returns it as
FrameSlotKind.tag
.slot
- the slot of the local variabledefault boolean isObject(int slot)
slot
- the slot of the local variabledefault boolean isByte(int slot)
slot
- the slot of the local variabledefault boolean isBoolean(int slot)
slot
- the slot of the local variabledefault boolean isInt(int slot)
slot
- the slot of the local variabledefault boolean isLong(int slot)
slot
- the slot of the local variabledefault boolean isFloat(int slot)
slot
- the slot of the local variabledefault boolean isDouble(int slot)
slot
- the slot of the local variabledefault boolean isStatic(int slot)
slot
- the slot of the local variabledefault void clear(int slot)
FrameSlotTypeException
.
This method is intended to be used for implementations of liveness analysis. As such, the compiler will find and report any inconsistency with respect to liveness analysis when using this method, such as clearing a slot in a branch, but not on another one, and their execution merge.
Liveness analysis implementations are expected to clear unused slots on method entry
slot
- the slot of the local variabledefault Object getAuxiliarySlot(int slot)
slot
- the auxiliary slot index to querynull
if it was never set (not the
frame descriptor's default value)default void setAuxiliarySlot(int slot, Object value)
slot
- the auxiliary slot indexvalue
- the new valuedefault Object getObjectStatic(int slot)
Object
. Requires the given slot to use
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot is of type
Object
.slot
- the slot of the local variabledefault void setObjectStatic(int slot, Object value)
Object
. Requires the given slot to
use FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault byte getByteStatic(int slot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot is of type byte.slot
- the slot of the local variabledefault void setByteStatic(int slot, byte value)
FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault boolean getBooleanStatic(int slot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot is of type boolean.slot
- the slot of the local variabledefault void setBooleanStatic(int slot, boolean value)
FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault int getIntStatic(int slot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot can is of type int.slot
- the slot of the local variabledefault void setIntStatic(int slot, int value)
FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault long getLongStatic(int slot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot is of type long.slot
- the slot of the local variabledefault void setLongStatic(int slot, long value)
FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault float getFloatStatic(int slot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot is of type float.slot
- the slot of the local variabledefault void setFloatStatic(int slot, float value)
FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault double getDoubleStatic(int slot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable in the given slot is of type double.slot
- the slot of the local variabledefault void setDoubleStatic(int slot, double value)
FrameSlotKind.Static
. Since this method does not update the internal slot type,
language implementations have to track this information.slot
- the slot of the local variablevalue
- the new value of the local variabledefault void copyPrimitiveStatic(int srcSlot, int destSlot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable at the source slot is a primitive value.srcSlot
- the slot of the source local variabledestSlot
- the slot of the target local variabledefault void copyObjectStatic(int srcSlot, int destSlot)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variable at the source slot is an Object
.srcSlot
- the slot of the source local variabledestSlot
- the slot of the target local variabledefault void copyStatic(int srcSlot, int destSlot)
FrameSlotKind.Static
. In
cases where the underlying slot type is known, Frame.copyPrimitiveStatic(int, int)
and
Frame.copyObjectStatic(int, int)
should be used for performance reasons.srcSlot
- the slot of the source local variabledestSlot
- the slot of the target local variabledefault void swapPrimitiveStatic(int first, int second)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variables in both slots are primitive values.first
- the slot of the first local variablesecond
- the slot of the second local variabledefault void swapObjectStatic(int first, int second)
FrameSlotKind.Static
. Since this method does not perform any type checks, language
implementations have to guarantee that the variables in both slots are Object
s.first
- the slot of the first local variablesecond
- the slot of the second local variabledefault void swapStatic(int first, int second)
FrameSlotKind.Static
. In
cases where the underlying slot type is known, Frame.swapPrimitiveStatic(int, int)
and
Frame.swapObjectStatic(int, int)
should be used for performance reasons.first
- the slot of the first local variablesecond
- the slot of the second local variabledefault void clearPrimitiveStatic(int slot)
FrameSlotKind.Static
. Writing over a previously cleared slot is still allowed.
Subsequent reads to the slot, unless re-written to, are not allowed and will fail with an
AssertionError
if assertions are enabled. Since this method does not perform any type
checks, language implementations have to guarantee that the variable at the given slot is a
primitive value.
This method is intended to be used for implementations of liveness analysis. As such, the compiler will find and report any inconsistency with respect to liveness analysis when using this method, such as clearing a slot in a branch, but not on another one, and their execution merge.
Liveness analysis implementations are expected to clear unused slots on method entry.slot
- the slot of the local variabledefault void clearObjectStatic(int slot)
FrameSlotKind.Static
. Writing over a previously cleared slot is still allowed.
Subsequent reads to the slot, unless re-written to, are not allowed and will fail with an
AssertionError
if assertions are enabled. Since this method does not perform any type
checks, language implementations have to guarantee that the variable at the given slot is an
Object
.
This method is intended to be used for implementations of liveness analysis. As such, the compiler will find and report any inconsistency with respect to liveness analysis when using this method, such as clearing a slot in a branch, but not on another one, and their execution merge.
Liveness analysis implementations are expected to clear unused slots on method entry.slot
- the slot of the local variabledefault void clearStatic(int slot)
FrameSlotKind.Static
. Writing over a previously cleared slot is still allowed.
Subsequent reads to the slot, unless re-written to, are not allowed and will fail with an
AssertionError
if assertions are enabled. In cases where the underlying slot type is
known, Frame.clearPrimitiveStatic(int)
and Frame.clearObjectStatic(int)
should be used
for performance reasons.slot
- The slot of the local variable