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 to
Object
.-
Method Summary
Modifier and TypeMethodDescriptionObject[]
Retrieves the arguments object from this frame.boolean
getBoolean
(FrameSlot slot) Read access to a local variable of type boolean.byte
Read access to a local variable of type byte.double
Read access to a local variable of type double.float
Read access to a local variable of type float.int
Read access to a local variable of type int.long
Read access to a local variable of type long.Read access to a local variable of typeObject
.Read access to a local variable of any type.boolean
Check whether the givenFrameSlot
is of type boolean.boolean
Check whether the givenFrameSlot
is of type byte.boolean
Check whether the givenFrameSlot
is of type double.boolean
Check whether the givenFrameSlot
is of type float.boolean
Check whether the givenFrameSlot
is of type int.boolean
Check whether the givenFrameSlot
is of type long.boolean
Check whether the givenFrameSlot
is of type object.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
Write access to a local variable of type byte.void
Write access to a local variable of type double.void
Write access to a local variable of type float.void
Write access to a local variable of type int.void
Write access to a local variable of type long.void
Write access to a local variable of typeObject
.
-
Method Details
-
getFrameDescriptor
FrameDescriptor getFrameDescriptor()- Returns:
- the object describing the layout of this frame
-
getArguments
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
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
Write access to a local variable of typeObject
.- Parameters:
slot
- the slot of the local variablevalue
- the new value of the local variable
-
getByte
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
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
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
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
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
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
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
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
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
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
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
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
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
-
isObject
Check whether the givenFrameSlot
is of type object. -
isByte
Check whether the givenFrameSlot
is of type byte. -
isBoolean
Check whether the givenFrameSlot
is of type boolean. -
isInt
Check whether the givenFrameSlot
is of type int. -
isLong
Check whether the givenFrameSlot
is of type long. -
isFloat
Check whether the givenFrameSlot
is of type float. -
isDouble
Check whether the givenFrameSlot
is of type double.
-