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
ConstructorsModifierConstructorDescriptionprotectedLocalVariable(Object token) Internal constructor for generated code. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the bytecode index at which this local stops being live.abstract ObjectgetInfo()Returns the info provided for the local, ornullif no info was provided.abstract intReturns the local index, a unique identifier for eachBytecodeLocalin a root node.abstract intReturns the logical frame offset of a local variable.abstract ObjectgetName()Returns the name provided for the local, ornullif no name was provided.intReturns the bytecode index at which this local starts being live.abstract FrameSlotKindReturns 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 scopingis disabled, returns-1.- Since:
- 24.2
-
getEndIndex
public int getEndIndex()Returns the bytecode index at which this local stops being live. Ifblock scopingis 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 scopingis 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 eachBytecodeLocalin a root node.- Since:
- 24.2
-
getTypeProfile
Returns the type profile that was collected for this local. Returnsnullif no profile was yet collected or the interpreter does not collect profiles.- Since:
- 24.2
-
getInfo
Returns the info provided for the local, ornullif no info was provided.- Since:
- 24.2
-
getName
Returns the name provided for the local, ornullif no name was provided.- Since:
- 24.2
-
toString
-