Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0012e6118d87c33aaae3c342375566b32762093c
https://github.com/WebKit/WebKit/commit/0012e6118d87c33aaae3c342375566b32762093c
Author: Anand Srinivasan <[email protected]>
Date: 2026-06-30 (Tue, 30 Jun 2026)
Changed paths:
A JSTests/stress/regexp-many-non-greedy-paren-groups.js
M Source/JavaScriptCore/runtime/OptionsList.h
M Source/JavaScriptCore/yarr/YarrJIT.cpp
M Source/JavaScriptCore/yarr/YarrJIT.h
Log Message:
-----------
Add size limit to Yarr generated code
https://bugs.webkit.org/show_bug.cgi?id=314589
rdar://176137052
Reviewed by Yusuke Suzuki.
Patterns with many sequential non-greedy quantified parenthesized groups
(e.g. (?:a){0,2}? repeated thousands of times) cause O(N^2) code emission
in saveParenContext/restoreParenContext, as each group saves/restores all
frame slots for the entire pattern. This patch adds a code size limit in
VM options above which the code bails out to the interpreter.
Test: JSTests/stress/regexp-many-non-greedy-paren-groups.js
* JSTests/stress/regexp-many-non-greedy-paren-groups.js: Added.
(testLargeNonGreedyParens):
* Source/JavaScriptCore/runtime/OptionsList.h:
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
(JSC::Yarr::dumpCompileFailure):
* Source/JavaScriptCore/yarr/YarrJIT.h:
Originally-landed-as: 305413.923@safari-7624-branch (e6d449d59b50).
rdar://180427748
Canonical link: https://commits.webkit.org/316157@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications