Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r245815 - [YARR] Properly handle RegExp's that require large Pa…
…renContext space https://bugs.webkit.org/show_bug.cgi?id=198065 Reviewed by Keith Miller. JSTests: New test. * stress/regexp-large-paren-context.js: Added. (testLargeRegExp): Source/JavaScriptCore: Changed what happens when we exceed VM::patternContextBufferSize when compiling a RegExp that needs ParenCOntextSpace to fail the RegExp JIT compilation and fall back to the YARR interpreter. This can save large amounts of JIT memory for a JIT'ed function that cannot ever succeed. * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::initParenContextFreeList): (JSC::Yarr::YarrGenerator::compile):
- Loading branch information
1 parent
ca5abfc
commit 065089c
Showing
4 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Test the regular expresions that need lots of parenthesis context space work. | ||
// This includes falling back to the interpreter. | ||
|
||
function testLargeRegExp(terms) | ||
{ | ||
let s = ''; | ||
for (let i = 0; i < terms; i++) { | ||
s += '(?:a){0,2}'; | ||
} | ||
|
||
let r = new RegExp(s); | ||
for (let i = 0; i < 10; i++) | ||
''.match(r); | ||
} | ||
|
||
testLargeRegExp(127); | ||
testLargeRegExp(128); | ||
testLargeRegExp(255); | ||
testLargeRegExp(256); | ||
testLargeRegExp(1000); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters