Class SLScopedNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.sl.nodes.local.SLScopedNode
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable
Direct Known Subclasses:
SLStatementNode

public abstract class SLScopedNode extends com.oracle.truffle.api.nodes.Node
The SL implementation of NodeLibrary provides fast access to local variables. It's used by tools like debugger, profiler, tracer, etc. To provide good performance, we cache write nodes that declare variables and use them in the interop contract.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final com.oracle.truffle.api.nodes.Node
    Find block of this node.
    protected final int
    Provide the index that determines variables on node enter.
    boolean
    hasScope(com.oracle.truffle.api.frame.Frame frame)
    We do provide a scope.
    final void
    Set the index to the the block's variables that determine variables belonging into this scope (excluding parent scopes) on node enter.
    final void
    Similar to setVisibleVariablesIndexOnEnter(int), but determines variables on node exit.

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SLScopedNode

      public SLScopedNode()
  • Method Details

    • hasScope

      public boolean hasScope(com.oracle.truffle.api.frame.Frame frame)
      We do provide a scope.
    • findBlock

      public final com.oracle.truffle.api.nodes.Node findBlock()
      Find block of this node. Traverse the parent chain and find the first SLBlockNode. If none is found, RootNode is returned.
      Returns:
      the block node, always non-null. Either SLBlockNode, or SLRootNode.
    • setVisibleVariablesIndexOnEnter

      public final void setVisibleVariablesIndexOnEnter(int index)
      Set the index to the the block's variables that determine variables belonging into this scope (excluding parent scopes) on node enter.
    • setVisibleVariablesIndexOnExit

      public final void setVisibleVariablesIndexOnExit(int index)
      Similar to setVisibleVariablesIndexOnEnter(int), but determines variables on node exit.
    • getVisibleVariablesIndexOnEnter

      protected final int getVisibleVariablesIndexOnEnter()
      Provide the index that determines variables on node enter.