[webkit-changes] [WebKit/WebKit] 8ef7f3: [JSC] Use fast iteration for array destructuring

Yusuke Suzuki noreply at github.com
Tue Oct 18 10:28:47 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8ef7f33d95f58b1373f8e5eb962d1e9ffc6d917d
      https://github.com/WebKit/WebKit/commit/8ef7f33d95f58b1373f8e5eb962d1e9ffc6d917d
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2022-10-18 (Tue, 18 Oct 2022)

  Changed paths:
    A JSTests/microbenchmarks/map-iteration-and-array-destructuring.js
    M JSTests/stress/destructuring-assignment-accepts-iterables.js
    M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
    M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

  Log Message:
  -----------
  [JSC] Use fast iteration for array destructuring
https://bugs.webkit.org/show_bug.cgi?id=246672
rdar://101275126

Reviewed by Alexey Shvayka.

This patch integrates fast for-of iteration into Array destructuring so that we do not allocate iteration result objects for
optimized array iteration case. We already integrated it into for-of, but we should do that for array destructuring too.
This patch improves the attached microbenchmark by 2x.

                                                  ToT                     Patched

map-iteration-and-array-destructuring       24.9895+-0.1555     ^     12.4263+-0.0735        ^ definitely 2.0110x faster

* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnumeration):
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::ArrayPatternNode::bindValue const):

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




More information about the webkit-changes mailing list