Class ForNode

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

public final class ForNode extends StatementNode implements ResumableNode.WithObjectState
for(;condition;modify) {body} with per-iteration scope.
  • Method Details

    • createForRepeatingNode

      public static com.oracle.truffle.api.nodes.RepeatingNode createForRepeatingNode(JavaScriptNode condition, JavaScriptNode body, JavaScriptNode modify, IterationScopeNode copy, JavaScriptNode isFirstNode, JavaScriptNode setNotFirstNode)
    • createFor

      public static ForNode createFor(com.oracle.truffle.api.nodes.LoopNode loopNode)
    • 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 JavaScriptNode
    • getNodeObject

      public Object getNodeObject()
      Specified by:
      getNodeObject in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • materializeInstrumentableNodes

      public com.oracle.truffle.api.instrumentation.InstrumentableNode materializeInstrumentableNodes(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags)
      Specified by:
      materializeInstrumentableNodes in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • execute

      public Object execute(com.oracle.truffle.api.frame.VirtualFrame frame)
      Description copied from class: JavaScriptNode
      Executes this node using the specified context and frame and returns the result value.
      Specified by:
      execute in class JavaScriptNode
      Parameters:
      frame - the frame of the currently executing guest language method
      Returns:
      the value of the execution
    • executeVoid

      public void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame)
      Description copied from class: JavaScriptNode
      Like JavaScriptNode.execute(VirtualFrame) except that it throws away the result. A node can override this method if it has a better way to execute without producing a value.
      Overrides:
      executeVoid in class JavaScriptNode
      Parameters:
      frame - the frame of the currently executing guest language method
    • resume

      public Object resume(com.oracle.truffle.api.frame.VirtualFrame frame, int stateSlot)
      Specified by:
      resume in interface ResumableNode
    • isResultAlwaysOfType

      public boolean isResultAlwaysOfType(Class<?> clazz)
      Overrides:
      isResultAlwaysOfType in class JavaScriptNode
    • copyUninitialized

      protected JavaScriptNode copyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags)
      Overrides:
      copyUninitialized in class JavaScriptNode
    • getLoopNode

      public com.oracle.truffle.api.nodes.LoopNode getLoopNode()