Package com.oracle.truffle.api.frame
Interface Frame
-
- All Known Subinterfaces:
MaterializedFrame
,VirtualFrame
public interface Frame
Represents a frame containing values of local variables of the guest language. Instances of this type must not be stored in a field or cast toObject
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object[]
getArguments()
Retrieves the arguments object from this frame.boolean
getBoolean(FrameSlot slot)
Read access to a local variable of type boolean.byte
getByte(FrameSlot slot)
Read access to a local variable of type byte.double
getDouble(FrameSlot slot)
Read access to a local variable of type double.float
getFloat(FrameSlot slot)
Read access to a local variable of type float.FrameDescriptor
getFrameDescriptor()
int
getInt(FrameSlot slot)
Read access to a local variable of type int.long
getLong(FrameSlot slot)
Read access to a local variable of type long.java.lang.Object
getObject(FrameSlot slot)
Read access to a local variable of typeObject
.java.lang.Object
getValue(FrameSlot slot)
Read access to a local variable of any type.boolean
isBoolean(FrameSlot slot)
Check whether the givenFrameSlot
is of type boolean.boolean
isByte(FrameSlot slot)
Check whether the givenFrameSlot
is of type byte.boolean
isDouble(FrameSlot slot)
Check whether the givenFrameSlot
is of type double.boolean
isFloat(FrameSlot slot)
Check whether the givenFrameSlot
is of type float.boolean
isInt(FrameSlot slot)
Check whether the givenFrameSlot
is of type int.boolean
isLong(FrameSlot slot)
Check whether the givenFrameSlot
is of type long.boolean
isObject(FrameSlot slot)
Check whether the givenFrameSlot
is of type object.MaterializedFrame
materialize()
Materializes this frame, which allows it to be stored in a field or cast toObject
.void
setBoolean(FrameSlot slot, boolean value)
Write access to a local variable of type boolean.void
setByte(FrameSlot slot, byte value)
Write access to a local variable of type byte.void
setDouble(FrameSlot slot, double value)
Write access to a local variable of type double.void
setFloat(FrameSlot slot, float value)
Write access to a local variable of type float.void
setInt(FrameSlot slot, int value)
Write access to a local variable of type int.void
setLong(FrameSlot slot, long value)
Write access to a local variable of type long.void
setObject(FrameSlot slot, java.lang.Object value)
Write access to a local variable of typeObject
.
-
-
-
Method Detail
-
getFrameDescriptor
FrameDescriptor getFrameDescriptor()
- Returns:
- the object describing the layout of this frame
-
getArguments
java.lang.Object[] getArguments()
Retrieves the arguments object from this frame. The runtime assumes that the arguments object is never null.- Returns:
- the arguments used when calling this method
-
getObject
java.lang.Object getObject(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of typeObject
.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setObject
void setObject(FrameSlot slot, java.lang.Object value)
Write access to a local variable of typeObject
.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getByte
byte getByte(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type byte.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setByte
void setByte(FrameSlot slot, byte value)
Write access to a local variable of type byte.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getBoolean
boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type boolean.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setBoolean
void setBoolean(FrameSlot slot, boolean value)
Write access to a local variable of type boolean.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getInt
int getInt(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type int.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setInt
void setInt(FrameSlot slot, int value)
Write access to a local variable of type int.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getLong
long getLong(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type long.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setLong
void setLong(FrameSlot slot, long value)
Write access to a local variable of type long.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getFloat
float getFloat(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type float.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setFloat
void setFloat(FrameSlot slot, float value)
Write access to a local variable of type float.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getDouble
double getDouble(FrameSlot slot) throws FrameSlotTypeException
Read access to a local variable of type double.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable
- Throws:
FrameSlotTypeException
-
setDouble
void setDouble(FrameSlot slot, double value)
Write access to a local variable of type double.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getValue
java.lang.Object getValue(FrameSlot slot)
Read access to a local variable of any type.- Parameters:
slot
- the slot of the local variable- Returns:
- the current value of the local variable or defaultValue if unset
-
materialize
MaterializedFrame materialize()
Materializes this frame, which allows it to be stored in a field or cast toObject
. The frame however looses the ability to be packed or to access the caller frame.- Returns:
- the new materialized frame
-
-