Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0206365a0d08367d32abb77c39420dac472924b4
      
https://github.com/WebKit/WebKit/commit/0206365a0d08367d32abb77c39420dac472924b4
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-27 (Wed, 27 May 2026)

  Changed paths:
    A JSTests/stress/map-set-for-of-fast-iterator-storage.js
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

  Log Message:
  -----------
  [JSC] Set storage of JSMapIterator / JSSetIterator creation in DFG / FTL
https://bugs.webkit.org/show_bug.cgi?id=315648
rdar://178032814

Reviewed by Yijia Huang.

Let's set storage of JSMapIterator / JSSetIterator for FastMap / FastSet
iteration in DFG / FTL. While nullptr works, setting this avoids calling
an operation at the first call of `next()`, and it is more aligned to
C++ code.

                                         ToT                     Patched

    for-of-map-entries-small        9.8359+-0.0752     ^      9.5363+-0.0646    
    ^ definitely 1.0314x faster
    set-for-of                      1.0529+-0.0154     ?      1.0660+-0.0151    
    ? might be 1.0124x slower
    for-of-set-values               2.5517+-0.0118     ?      2.5590+-0.0140    
    ?
    for-of-map-entries              8.8384+-0.0613     ^      8.7312+-0.0372    
    ^ definitely 1.0123x faster
    map-for-of                      1.8168+-0.0151     ?      1.8186+-0.0154    
    ?
    for-of-set-values-small         3.2684+-0.0242     ^      3.0344+-0.0113    
    ^ definitely 1.0771x faster

    <geometric>                     3.3387+-0.0128     ^      3.2830+-0.0104    
    ^ definitely 1.0170x faster

Test: JSTests/stress/map-set-for-of-fast-iterator-storage.js

* JSTests/stress/map-set-for-of-fast-iterator-storage.js: Added.
(shouldBe):
(forOfMap):
(testEmptyMap):
(testNonEmptyMap):
(testMapWithDeletions):
(testEmptySet):
(testNonEmptySet):
(testSetWithDeletions):
(testMapMutationDuringIteration):
(testSetMutationDuringIteration):
(testReusedEmptyMap):
(testReusedEmptySet):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIteratorOpen):

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



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

Reply via email to