Class SLReadLocalVariableNode

All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class SLReadLocalVariableNode extends SLExpressionNode
Node to read a local variable from a function's frame. The Truffle frame API allows to store primitive values of all Java primitive types, and Object values. This means that all SL types that are objects are handled by the readObject(com.oracle.truffle.api.frame.VirtualFrame) method.

We use the primitive type only when the same primitive type is uses for all writes. If the local variable is type-polymorphic, then the value is always stored as an Object, i.e., primitive values are boxed. Even a mixture of long and boolean writes leads to both being stored boxed.

  • Constructor Details

    • SLReadLocalVariableNode

      public SLReadLocalVariableNode()
  • Method Details

    • getSlot

      protected abstract int getSlot()
      Returns the descriptor of the accessed local variable. The implementation of this method is created by the Truffle DSL based on the NodeField annotation on the class.
    • readLong

      protected long readLong(com.oracle.truffle.api.frame.VirtualFrame frame)
    • readBoolean

      protected boolean readBoolean(com.oracle.truffle.api.frame.VirtualFrame frame)
    • readObject

      protected Object readObject(com.oracle.truffle.api.frame.VirtualFrame frame)
    • hasTag

      public boolean hasTag(Class<? extends com.oracle.truffle.api.instrumentation.Tag> tag)
      Specified by:
      hasTag in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
      Overrides:
      hasTag in class SLExpressionNode
    • getNodeObject

      public Object getNodeObject()