Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4b8e37abf2836c3dda3db728c5e2e82de59c7a49
      
https://github.com/WebKit/WebKit/commit/4b8e37abf2836c3dda3db728c5e2e82de59c7a49
  Author: Tetsuharu Ohzeki <[email protected]>
  Date:   2026-07-22 (Wed, 22 Jul 2026)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSArray.cpp

  Log Message:
  -----------
  [JSC] Use pass-by-value for `resultIndex` argument of 
`JS::fastFlatIntoBuffer()`
https://bugs.webkit.org/show_bug.cgi?id=319673

Reviewed by Sosuke Suzuki.

This change is related to only the fast path of `Array#flat()`.
`resultIndex` is 8-bytes (`uint64_t`). It's enough small size.

Interestingly, this change has a side-effect which is a micro benchmark
progression on macOS arm64 at least.

                                             TipOfTree                  Patched

array-prototype-flat-depth-1-string      124.7313+-15.7674    ?    
126.7053+-14.0930       ? might be 1.0158x slower
array-prototype-flat-depth-1-double       85.8047+-8.6982     ?     
88.9680+-4.1780        ? might be 1.0369x slower
array-prototype-flat-large-nested         45.0930+-2.4765     ^     
27.1562+-1.0824        ^ definitely 1.6605x faster
array-prototype-flat-huge-arrays          10.5353+-1.8040           
10.0453+-1.7224          might be 1.0488x faster
array-prototype-flat-small-arrays          3.4522+-0.1238            
3.3026+-0.0755          might be 1.0453x faster
array-prototype-flat-depth-infinity      117.2919+-1.0095          
117.0930+-0.6006
array-prototype-flat-depth-2              94.7117+-1.3260     ?     
95.6852+-4.3372        ? might be 1.0103x slower
array-prototype-flat-depth-1-int32        85.2135+-4.3134     ?     
88.4635+-2.5566        ? might be 1.0381x slower
array-prototype-flat-depth-3             105.7020+-7.5027          
102.3541+-4.5175          might be 1.0327x faster
array-prototype-flat-sparse-array        152.1396+-3.2477     ?    
161.3152+-11.0580       ? might be 1.0603x slower
array-prototype-flat-depth-1-mixed        93.9877+-4.2939     ?     
94.3616+-4.7335        ?

<geometric>                               57.9736+-0.6088     ^     
55.5547+-0.9141        ^ definitely 1.0435x faster

No new tests.
It wlll be covered by exist test cases.

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



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

Reply via email to