Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b68f6434c4f5badc76a61b2c1a778a86855a87e3
      
https://github.com/WebKit/WebKit/commit/b68f6434c4f5badc76a61b2c1a778a86855a87e3
  Author: Sosuke Suzuki <[email protected]>
  Date:   2025-02-04 (Tue, 04 Feb 2025)

  Changed paths:
    A JSTests/microbenchmarks/array-prototype-indexOf-string-16.js
    A JSTests/microbenchmarks/array-prototype-indexOf-string.js
    A JSTests/stress/array-prototype-indexOf-string-16.js
    A JSTests/stress/array-prototype-indexOf-string-8.js
    A JSTests/stress/array-prototype-indexOf-string-obj.js
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

  Log Message:
  -----------
  [JSC] Optimize 8bit string array search by `Array#indexOf` in DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=286244

Reviewed by Yusuke Suzuki.

The DFG and FTL for `Array#indexOf` calls `operationArrayIndexOfString`
to search string  from array of strings. However, for arrays of 8-bit
strings, this can be more optimized.

                                           TipOfTree                  Patched

array-prototype-indexOf-string          80.1512+-1.4965     ^     
49.4774+-1.6997        ^ definitely 1.6200x faster
array-prototype-indexOf-string-16       84.6494+-0.0597           
83.0947+-2.7614          might be 1.0187x faster

* JSTests/microbenchmarks/array-prototype-indexOf-string-16.js: Added.
* JSTests/microbenchmarks/array-prototype-indexOf-string.js: Added.
* JSTests/stress/array-prototype-indexOf-string-16.js: Added.
(shouldBe):
(test1):
(test2):
* JSTests/stress/array-prototype-indexOf-string-8.js: Added.
(shouldBe):
(test1):
(test2):
* JSTests/stress/array-prototype-indexOf-string-obj.js: Added.
(shouldBe):
(test1):
(test2):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArrayIndexOf):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to