Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e89865c7f8c39e5dec655cd574c732ab9edb67d2
      
https://github.com/WebKit/WebKit/commit/e89865c7f8c39e5dec655cd574c732ab9edb67d2
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

  Log Message:
  -----------
  [JSC] RestParameterNode should use direct binding when possible
https://bugs.webkit.org/show_bug.cgi?id=308817

Reviewed by Yusuke Suzuki.

`function f(...rest)` emits an extra mov because RestParameterNode::emit
always creates the rest array into a temporary and then binds it:

    [4] create_rest  loc7, 0
    [7] mov          loc5, loc7   // redundant

When the pattern is a simple local binding, we can emit create_rest
directly into the local register, mirroring what ObjectPatternNode
already does via writableDirectBindingIfPossible().

After this fix:

    [4] create_rest  loc5, 0

Complex patterns (`...[a, b]`, `...{length}`) and closure-captured
variables continue to use the temporary path.

* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::RestParameterNode::emit):

Canonical link: https://commits.webkit.org/308723@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to