Class AccessArgumentsArrayDirectlyNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.JavaScriptNode
com.oracle.truffle.js.nodes.arguments.AccessArgumentsArrayDirectlyNode
All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public final class AccessArgumentsArrayDirectlyNode extends JavaScriptNode
This node accesses the arguments array optimistically directly as Object[], but can fall back to returning a JS Arguments Object. This node is used to avoid unnecessary allocation of the Arguments Object for the function.apply(this, arguments) call pattern where it would be immediately discarded.
See Also:
  • Constructor Details

    • AccessArgumentsArrayDirectlyNode

      public AccessArgumentsArrayDirectlyNode(JavaScriptNode writeArgumentsNode, JavaScriptNode readArgumentsNode, int leadingArgCount)
  • Method Details

    • 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
    • replaceWithDefaultArguments

      public void replaceWithDefaultArguments()
      Called when the arguments array can no longer be accessed directly.
    • copyUninitialized

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