[webkit-changes] [WebKit/WebKit] c0417a: [JSC] Implement `Array.prototype.with` in C++

SUZUKI Sosuke noreply at github.com
Wed Jan 1 21:52:59 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c0417a386c3062049eb1abec31004d7ecde8a4d1
      https://github.com/WebKit/WebKit/commit/c0417a386c3062049eb1abec31004d7ecde8a4d1
  Author: Sosuke Suzuki <aosukeke at gmail.com>
  Date:   2025-01-01 (Wed, 01 Jan 2025)

  Changed paths:
    A JSTests/microbenchmarks/array-prototype-with-contiguous.js
    A JSTests/microbenchmarks/array-prototype-with-double.js
    A JSTests/microbenchmarks/array-prototype-with-int32.js
    A JSTests/stress/array-prototype-with-fast.js
    M Source/JavaScriptCore/builtins/ArrayPrototype.js
    M Source/JavaScriptCore/runtime/ArrayPrototype.cpp
    M Source/JavaScriptCore/runtime/CommonIdentifiers.h
    M Source/JavaScriptCore/runtime/JSArray.cpp
    M Source/JavaScriptCore/runtime/JSArray.h

  Log Message:
  -----------
  [JSC] Implement `Array.prototype.with` in C++
https://bugs.webkit.org/show_bug.cgi?id=285241

Reviewed by Yusuke Suzuki.

This patch implements `Array.prototype.with` in C++.

When FLT JIT is enabled, this patch makes it 1.1x ~ 1.2x faster.

                                         TipOfTree                  Patched

array-prototype-with-double           36.5286+-2.3897           32.1912+-4.1588          might be 1.1347x faster
array-prototype-with-int32            40.6655+-2.3469     ^     32.3867+-3.1772        ^ definitely 1.2556x faster
array-prototype-with-contiguous       35.9778+-3.8082           31.4018+-2.0459          might be 1.1457x faster

When DFG/FTL JIT is disabled, this patch makes it 1.6x ~ 1.8x faster.

                                         TipOfTree                  Patched

array-prototype-with-double           62.2153+-1.6448     ^     34.3870+-3.5752        ^ definitely 1.8093x faster
array-prototype-with-int32            64.1046+-3.0605     ^     36.2413+-8.5023        ^ definitely 1.7688x faster
array-prototype-with-contiguous       64.4120+-6.8815     ^     38.3409+-5.3097        ^ definitely 1.6800x faster
array-prototype-with-fast-path         0.4758+-0.3046            0.2803+-0.0861          might be 1.6977x faster

* Source/JavaScriptCore/builtins/ArrayPrototype.js:
(toSpliced):
(with): Deleted.
* Source/JavaScriptCore/runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
(JSC::argumentUnclampedIndexFromStartOrEnd):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/CommonIdentifiers.h:

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



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


More information about the webkit-changes mailing list