Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a46d2fe1b35a6aec5aa3451331d7036dfd3818af
      
https://github.com/WebKit/WebKit/commit/a46d2fe1b35a6aec5aa3451331d7036dfd3818af
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-06-23 (Tue, 23 Jun 2026)

  Changed paths:
    A JSTests/microbenchmarks/regexp-prototype-symbol-match-primordial-check.js
    A JSTests/microbenchmarks/regexp-prototype-symbol-split-primordial-check.js
    A JSTests/microbenchmarks/string-replace-regexp-primordial-check.js
    A JSTests/stress/string-replace-regexp-with-own-property.js
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

  Log Message:
  -----------
  [JSC] Replace fixup-inserted RegExp primordial `TryGetById` chains with a 
single `CheckStructure`
https://bugs.webkit.org/show_bug.cgi?id=317627

Reviewed by Yusuke Suzuki.

addStringReplacePrimordialChecks and friends emit up to eleven
TryGetById+CheckIsConstant pairs to prove the RegExp receiver does not shadow
exec/flags/.../@@replace. Fixup-inserted TryGetByIds carry no bytecode profile,
so in FTL each one survives as an opaque IC patchpoint.

regExpPrimordialPropertiesWatchpoint already guarantees RegExp.prototype is
primordial, so a single CheckStructure against the original RegExp structure is
enough (matching RegExpObject::isSymbol*FastAndNonObservable). Fold the four
helpers into addRegExpPrimordialStructureCheck and add the missing BadCache bail
to StringPrototypeReplace{,All}Intrinsic / RegExpSearchIntrinsic.

                                                     prev                    
patched

regexp-prototype-symbol-match-primordial-check
                                              129.4573+-1.9302     ^     
80.9818+-1.7268        ^ definitely 1.5986x faster
regexp-prototype-symbol-split-primordial-check
                                               50.0416+-0.4732     ^     
39.4040+-0.4457        ^ definitely 1.2700x faster
string-replace-regexp-primordial-check        156.3021+-1.5530     ^    
102.9366+-0.8520        ^ definitely 1.5184x faster

Tests: JSTests/microbenchmarks/regexp-prototype-symbol-match-primordial-check.js
       JSTests/microbenchmarks/regexp-prototype-symbol-split-primordial-check.js
       JSTests/microbenchmarks/string-replace-regexp-primordial-check.js
       JSTests/stress/string-replace-regexp-with-own-property.js

* JSTests/microbenchmarks/regexp-prototype-symbol-match-primordial-check.js: 
Added.
(match):
* JSTests/microbenchmarks/regexp-prototype-symbol-split-primordial-check.js: 
Added.
(split):
* JSTests/microbenchmarks/string-replace-regexp-primordial-check.js: Added.
(replace):
* JSTests/stress/string-replace-regexp-with-own-property.js: Added.
(replace):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::addRegExpPrimordialStructureCheck):
(JSC::DFG::FixupPhase::addStringReplacePrimordialChecks): Deleted.
(JSC::DFG::FixupPhase::addStringMatchAndSearchPrimordialChecks): Deleted.
(JSC::DFG::FixupPhase::addRegExpSearchPrimordialChecks): Deleted.
(JSC::DFG::FixupPhase::addRegExpMatchPrimordialChecks): Deleted.
(JSC::DFG::FixupPhase::addRegExpSplitPrimordialChecks): Deleted.

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



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

Reply via email to