Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[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
- Loading branch information