Class SLBlockNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.BlockNode.ElementExecutor<SLStatementNode>, com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public final class SLBlockNode extends SLStatementNode implements com.oracle.truffle.api.nodes.BlockNode.ElementExecutor<SLStatementNode>
A statement node that just executes a list of other statements.
  • Constructor Details

  • Method Details

    • executeVoid

      public void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame)
      Execute all block statements. The block node makes sure that full unrolling of the loop is triggered during compilation. This allows the SLStatementNode.executeVoid(com.oracle.truffle.api.frame.VirtualFrame) method of all children to be inlined.
      Specified by:
      executeVoid in class SLStatementNode
    • getStatements

      public List<SLStatementNode> getStatements()
    • executeVoid

      public void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame, SLStatementNode node, int index, int argument)
      Truffle nodes don't have a fixed execute signature. The BlockNode.ElementExecutor interface tells the framework how block element nodes should be executed. The executor allows to add a custom exception handler for each element, e.g. to handle a specific ControlFlowException or to pass a customizable argument, that allows implement startsWith semantics if needed. For SL we don't need to pass any argument as we just have plain block nodes, therefore we pass BlockNode.NO_ARGUMENT. In our case the executor does not need to remember any state so we reuse a singleton instance.
      Specified by:
      executeVoid in interface com.oracle.truffle.api.nodes.BlockNode.ElementExecutor<SLStatementNode>
    • getDeclaredLocalVariables

      public SLWriteLocalVariableNode[] getDeclaredLocalVariables()
      All declared local variables accessible in this block. Variables declared in parent blocks are included.
    • getParentBlockIndex

      public int getParentBlockIndex()