Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e289c324e666c229a72012180c87f9a3829f9982
https://github.com/WebKit/WebKit/commit/e289c324e666c229a72012180c87f9a3829f9982
Author: Yusuke Suzuki <[email protected]>
Date: 2022-09-21 (Wed, 21 Sep 2022)
Changed paths:
A JSTests/stress/string-replace-exit.js
A JSTests/stress/string-replace-exit2.js
M Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Log Message:
-----------
[JSC] DFG AI should attempt to remove @tryGetById for String.replace
https://bugs.webkit.org/show_bug.cgi?id=245418
Reviewed by Ross Kirsling.
@tryGetById is adhoc one: it is used only in builtin code and used in very
limited places.
So this patch introduces adhoc folding rules for @tryGetById to remove
TryGetById attached before
String.replace. Unfortunately these @tryGetById are not usually removed since
it is adhocly attached
in DFG fixup phase.
In this patch,
1. Ensure RegExp.prototype's properties via watchpoints.
2. Check structure in AI, and ensure that this structure is one for
RegExpObject, its [[Prototype]] is RegExp.prototype, it is cacheable,
and it does not have properties for particular names.
Then we fold TryGetById to RegExp's specific properties values. It eliminates
these TryGetById and improves String.replace in DFG / FTL
by 65% (e.g. string-replace).
ToT
Patched
string-replace-generic 33.0472+-0.1132 ^
31.9405+-0.1483 ^ definitely 1.0346x faster
string-replace 3.3774+-0.0951 ^
2.0387+-0.0476 ^ definitely 1.6566x faster
put-by-val-with-string-replace-and-transition
4.4385+-0.0233
4.4319+-0.0188
string-replace-benchmark 83.8759+-0.1186 ^
83.4655+-0.2393 ^ definitely 1.0049x faster
string-replace-string 380.3462+-0.7600
379.2646+-1.0203
string-replace-empty 3.2455+-0.0406 ^
2.0051+-0.1350 ^ definitely 1.6186x faster
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
Canonical link: https://commits.webkit.org/254717@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes