Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3f58e2018a6b5a953372488d2440129d59d3765e
https://github.com/WebKit/WebKit/commit/3f58e2018a6b5a953372488d2440129d59d3765e
Author: Yusuke Suzuki <[email protected]>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
A JSTests/microbenchmarks/regexp-empty-body-parens.js
A JSTests/microbenchmarks/regexp-fixed-count-capturing-parens.js
A JSTests/stress/yarr-quantified-empty-parentheses.js
M Source/JavaScriptCore/yarr/YarrJIT.cpp
Log Message:
-----------
[JSC] ParenthesesSubpatternFixedCount should support captures
https://bugs.webkit.org/show_bug.cgi?id=316599
rdar://179054696
Reviewed by Yijia Huang.
This patch expands the coverage of ParenthesesSubpatternFixedCount to
patterns having a capture.
Let's say /([a-z]){4}/, [a-z] is not having content backtracking so the
entire pattern ([a-z]){4} does not have backtracking: there is no way to
reduce the consumption / increase the consumption of characters to try
the different matchings. However because they have captures, we are
currently not applying ParenthesesSubpatternFixedCount optimization.
It is trivial to handle captures in ParenthesesSubpatternFixedCount
because we can just keep the last capture as a result since this
is FixedCount, so passing all iterations or nothing.
ToT
Patched
regexp-empty-body-parens 80.3693+-0.2860 ^
78.8855+-0.3478 ^ definitely 1.0188x faster
regexp-fixed-count-capturing-parens 195.9219+-0.6061 ^
80.0022+-1.1346 ^ definitely 2.4490x faster
Test: JSTests/stress/yarr-quantified-empty-parentheses.js
* JSTests/microbenchmarks/regexp-empty-body-parens.js: Added.
(re1):
(re2):
(re3):
(re4):
(re5):
(re6):
(re7.a):
(re8):
* JSTests/microbenchmarks/regexp-fixed-count-capturing-parens.js: Added.
(re1):
(re2):
(re3):
(re4):
* JSTests/stress/yarr-quantified-empty-parentheses.js: Added.
(shouldBe):
(test):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
Canonical link: https://commits.webkit.org/314853@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications