Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc5da5a661a3dda8b8edd19f903fed3de7c35f4b
      
https://github.com/WebKit/WebKit/commit/cc5da5a661a3dda8b8edd19f903fed3de7c35f4b
  Author: Sosuke Suzuki <[email protected]>
  Date:   2025-12-21 (Sun, 21 Dec 2025)

  Changed paths:
    A JSTests/microbenchmarks/string-prototype-includes-constant-folding.js
    A 
JSTests/microbenchmarks/string-prototype-includes-with-index-with-one-char.js
    A JSTests/microbenchmarks/string-prototype-includes-with-index.js
    A JSTests/microbenchmarks/string-prototype-includes-with-one-char.js
    A JSTests/microbenchmarks/string-prototype-includes.js
    A JSTests/stress/string-prototype-includes-constant-folding.js
    A JSTests/stress/string-prototype-includes-with-index-with-one-char.js
    A JSTests/stress/string-prototype-includes-with-index.js
    A JSTests/stress/string-prototype-includes-with-one-char.js
    A JSTests/stress/string-prototype-includes.js
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/runtime/Intrinsic.h
    M Source/JavaScriptCore/runtime/StringPrototype.cpp

  Log Message:
  -----------
  [JSC] Handle `String.prototype.includes` in DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=304138

Reviewed by Yusuke Suzuki.

This patch adds support for `String.prototype.includes` in DFG/FTL using C++
operations like `String.prototype.indexOf`.

This patch makes `String.prototype.includes` 1.2x to 1.4x faster in the 
following
microbenchmarks. Furthermore, it improves even more significantly when folding 
is
effective.

                                                  TipOfTree                  
Patched

string-prototype-includes-with-index-with-one-char
                                               74.6933+-36.5188          
65.5386+-26.0564         might be 1.1397x faster
string-prototype-includes                      70.8373+-31.3757          
69.8322+-33.4859         might be 1.0144x faster
string-prototype-includes-with-index          113.6356+-70.8584          
73.4337+-24.0293         might be 1.5475x faster
string-prototype-includes-constant-folding
                                               84.4210+-17.2479    ^      
8.6475+-4.8715        ^ definitely 9.7625x faster
string-prototype-includes-with-one-char        52.5742+-20.4285          
36.3516+-12.4097         might be 1.4463x faster

Tests: JSTests/stress/string-includes.js

* JSTests/microbenchmarks/string-prototype-includes-constant-folding.js: Added.
(testConstantFound):
(testConstantNotFound):
(testConstantWithIndex):
(testConstantOneChar):
(testConstantOneCharWithIndex):
* 
JSTests/microbenchmarks/string-prototype-includes-with-index-with-one-char.js: 
Added.
(test):
(makeString):
* JSTests/microbenchmarks/string-prototype-includes-with-index.js: Added.
(test):
(makeString):
* JSTests/microbenchmarks/string-prototype-includes-with-one-char.js: Added.
(test):
(makeString):
* JSTests/microbenchmarks/string-prototype-includes.js: Added.
(test):
(makeString):
* JSTests/stress/string-prototype-includes-constant-folding.js: Added.
(shouldBe):
(testConstantFound):
(testConstantNotFound):
(testConstantWithIndex):
(testConstantWithIndexNotFound):
(testConstantOneChar):
(testConstantOneCharNotFound):
(testConstantOneCharWithIndex):
(testConstantOneCharWithIndexNotFound):
* JSTests/stress/string-prototype-includes-with-index-with-one-char.js: Added.
(shouldBe):
(test):
(makeString):
* JSTests/stress/string-prototype-includes-with-index.js: Added.
(shouldBe):
(test):
(makeString):
* JSTests/stress/string-prototype-includes-with-one-char.js: Added.
(shouldBe):
(test):
(makeString):
* JSTests/stress/string-prototype-includes.js: Added.
(shouldBe):
(test):
(makeString):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/runtime/Intrinsic.h:
* Source/JavaScriptCore/runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

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



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

Reply via email to