Class BytecodeLocal

java.lang.Object
com.oracle.truffle.api.bytecode.BytecodeLocal

public abstract class BytecodeLocal extends Object
Abstract definition of a local variable in the interpreter.

Local variables are stored in the frame. They are typically accessed in the bytecode using StoreLocal and LoadLocal operations. For uncommon scenarios where locals need to be accessed programmatically (e.g., in a node), locals can be accessed using accessor methods on the BytecodeNode, such as BytecodeNode.getLocalValue(int, Frame, int) and BytecodeNode.setLocalValue(int, com.oracle.truffle.api.frame.Frame, int, Object).

By default a local variable is live for the extent of the block that defines it ("block scoping"). Interpreters can also be configured so that locals live for the extent of the root node ("root scoping"). See GenerateBytecode.enableBlockScoping() for details.

Refer to the user guide for more details.

Since:
24.2
  • Constructor Details

    • BytecodeLocal

      public BytecodeLocal(Object token)
      Internal constructor for generated code. Do not use.
      Since:
      24.2
  • Method Details