Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 12bbbd4b4f3c62309dd8bbd5acd81e8e46b96aab
      
https://github.com/WebKit/WebKit/commit/12bbbd4b4f3c62309dd8bbd5acd81e8e46b96aab
  Author: Sosuke Suzuki <[email protected]>
  Date:   2025-11-11 (Tue, 11 Nov 2025)

  Changed paths:
    A JSTests/microbenchmarks/array-from-direct-arguments.js
    A JSTests/microbenchmarks/array-from-scoped-arguments.js
    A JSTests/stress/array-from-direct-arguments.js
    A JSTests/stress/array-from-scoped-arguments.js
    M Source/JavaScriptCore/builtins/ArrayConstructor.js
    M Source/JavaScriptCore/builtins/BuiltinNames.h
    M Source/JavaScriptCore/bytecode/LinkTimeConstant.h
    M Source/JavaScriptCore/runtime/ArrayConstructor.cpp
    M Source/JavaScriptCore/runtime/ArrayConstructor.h
    M Source/JavaScriptCore/runtime/ArrayPrototype.cpp
    M Source/JavaScriptCore/runtime/ArrayPrototype.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp

  Log Message:
  -----------
  [JSC] Add fast path for `Array.from(arguments)`
https://bugs.webkit.org/show_bug.cgi?id=302236

Reviewed by Yusuke Suzuki.

This patch changes to add fast path for `Array.from(arguments)`.

note: This patch only supports `DirectArguments` and `ScopedArguments`.
I'll add support for `ClonedArguments` in next patch.

                                        TipOfTree                  Patched

array-from-scoped-arguments           9.1958+-0.1530     ^      3.6832+-0.2937  
      ^ definitely 2.4967x faster
array-from-direct-arguments           8.2003+-0.1391     ^      2.8755+-0.0549  
      ^ definitely 2.8518x faster

Test: JSTests/microbenchmarks/array-from-direct-arguments.js

* JSTests/microbenchmarks/array-from-direct-arguments.js: Added.
(test):
* JSTests/microbenchmarks/array-from-scoped-arguments.js: Added.
(test):
* JSTests/stress/array-from-direct-arguments.js: Added.
(shouldBe):
(test):
(noInline):
* JSTests/stress/array-from-scoped-arguments.js: Added.
(shouldBe):
(test):
(noInline):
* Source/JavaScriptCore/builtins/ArrayConstructor.js:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/runtime/ArrayConstructor.cpp:
(JSC::tryCreateArrayFromArguments):
(JSC::tryCreateArrayFromScopedArguments):
(JSC::tryCreateArrayFromDirectArguments):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/ArrayConstructor.h:
* Source/JavaScriptCore/runtime/ArrayPrototype.cpp:
* Source/JavaScriptCore/runtime/ArrayPrototype.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

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



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

Reply via email to