Class SwitchNode

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

public final class SwitchNode extends StatementNode implements ResumableNode.WithObjectState
Switch.
switch (switchExpression) {
case caseExpression: [statements];
default: [statements]
}
  • Method Details

    • create

      public static SwitchNode create(JavaScriptNode[] declarations, JavaScriptNode[] caseExpressions, int[] jumptable, JavaScriptNode[] statements)
    • 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
    • resume

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

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