Class LocalVariable
java.lang.Object
com.oracle.truffle.api.bytecode.LocalVariable
Introspection class modeling a local variable and its liveness info in a bytecode interpreter.
There can be more than one local variable for a given
BytecodeLocal
because locals can be
live for multiple disjoint bytecode ranges.
Note: Introspection classes are intended to be used for debugging purposes only. These APIs may change in the future.
- Since:
- 24.2
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LocalVariable
(Object token) Internal constructor for generated code. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the bytecode index at which this local stops being live.abstract Object
getInfo()
Returns the info provided for the local, ornull
if no info was provided.abstract int
Returns the local index, a unique identifier for eachBytecodeLocal
in a root node.abstract int
Returns the logical frame offset of a local variable.abstract Object
getName()
Returns the name provided for the local, ornull
if no name was provided.int
Returns the bytecode index at which this local starts being live.abstract FrameSlotKind
Returns the type profile that was collected for this local.toString()
-
Constructor Details
-
LocalVariable
Internal constructor for generated code. Do not use.- Since:
- 24.2
-
-
Method Details
-
getStartIndex
public int getStartIndex()Returns the bytecode index at which this local starts being live. Ifblock scoping
is disabled, returns-1
.- Since:
- 24.2
-
getEndIndex
public int getEndIndex()Returns the bytecode index at which this local stops being live. Ifblock scoping
is disabled, returns-1
.- Since:
- 24.2
-
getLocalOffset
public abstract int getLocalOffset()Returns the logical frame offset of a local variable. The local index should be used with local accessor methods likeBytecodeNode.getLocalValue(int, Frame, int)
(it does not represent a frame index that can be used to directly access the frame). Always returns an integer greater or equal to zero.If
block scoping
is enabled, multiple locals can share an offset; otherwise, the local offset is the same as thelocal index
.Note that the local offset can only be read if the current bytecode index is between
getStartIndex()
andgetEndIndex()
(exclusive).- Since:
- 24.2
-
getLocalIndex
public abstract int getLocalIndex()Returns the local index, a unique identifier for eachBytecodeLocal
in a root node.- Since:
- 24.2
-
getTypeProfile
Returns the type profile that was collected for this local. Returnsnull
if no profile was yet collected or the interpreter does not collect profiles.- Since:
- 24.2
-
getInfo
Returns the info provided for the local, ornull
if no info was provided.- Since:
- 24.2
-
getName
Returns the name provided for the local, ornull
if no name was provided.- Since:
- 24.2
-
toString
-