WebKit Bugzilla
Attachment 370612 Details for
Bug 198065
: [YARR] Properly handle RegExp's that require large ParenContext space
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated patch in light of r245586
198065-2.patch (text/plain), 3.67 KB, created by
Michael Saboff
on 2019-05-24 17:59:55 PDT
(
hide
)
Description:
Updated patch in light of r245586
Filename:
MIME Type:
Creator:
Michael Saboff
Created:
2019-05-24 17:59:55 PDT
Size:
3.67 KB
patch
obsolete
>Index: JSTests/ChangeLog >=================================================================== >--- JSTests/ChangeLog (revision 245766) >+++ JSTests/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2019-05-24 Michael Saboff <msaboff@apple.com> >+ >+ [YARR] Properly handle RegExp's that require large ParenContext space >+ https://bugs.webkit.org/show_bug.cgi?id=198065 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ New test. >+ >+ * stress/regexp-large-paren-context.js: Added. >+ (testLargeRegExp): >+ > 2019-05-24 Justin Michaud <justin_michaud@apple.com> > > [WASM-References] Support Anyref in globals >Index: JSTests/stress/regexp-large-paren-context.js >=================================================================== >--- JSTests/stress/regexp-large-paren-context.js (nonexistent) >+++ JSTests/stress/regexp-large-paren-context.js (working copy) >@@ -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); >+ >+ >Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 245764) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-05-24 Michael Saboff <msaboff@apple.com> >+ >+ [YARR] Properly handle RegExp's that require large ParenContext space >+ https://bugs.webkit.org/show_bug.cgi?id=198065 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2019-05-23 Devin Rousso <drousso@apple.com> > > Web Inspector: Overlay: rulers/guides should be shown whenever element selection is enabled >Index: Source/JavaScriptCore/yarr/YarrJIT.cpp >=================================================================== >--- Source/JavaScriptCore/yarr/YarrJIT.cpp (revision 245764) >+++ Source/JavaScriptCore/yarr/YarrJIT.cpp (working copy) >@@ -228,9 +228,10 @@ class YarrGenerator : public YarrJITInfo > > parenContextSize = WTF::roundUpToMultipleOf<sizeof(uintptr_t)>(parenContextSize); > >- // Check that the paren context is a reasonable size. >- if (parenContextSize > VM::patternContextBufferSize) >- m_abortExecution.append(jump()); >+ if (parenContextSize > VM::patternContextBufferSize) { >+ m_failureReason = JITFailureReason::ParenthesisNestedTooDeep; >+ return; >+ } > > Jump emptyFreeList = branchTestPtr(Zero, freelistRegister); > move(freelistRegister, parenContextPointer); >@@ -3935,8 +3936,13 @@ public: > initCallFrame(); > > #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS) >- if (m_containsNestedSubpatterns) >+ if (m_containsNestedSubpatterns) { > initParenContextFreeList(); >+ if (m_failureReason) { >+ codeBlock.setFallBackWithFailureReason(*m_failureReason); >+ return; >+ } >+ } > #endif > > if (m_pattern.m_saveInitialStartValue) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
keith_miller
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198065
:
370296
| 370612