Bug 188895

Summary: YARR: Need to JIT compile a RegExp before using containsNestedSubpatterns flag
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, keith_miller, mark.lam, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Michael Saboff 2018-08-23 11:33:35 PDT
There is a slight bug in the RegExp JIT code where we use the m_containsNestedSubpatterns before the JIT compilation has set it.  The result is that this limits somewhat the regexps that can take advantage of JIT'ed greedy sub patterns.
Comment 1 Michael Saboff 2018-08-23 11:58:39 PDT
Created attachment 347944 [details]
Patch
Comment 2 Mark Lam 2018-08-23 12:05:15 PDT
Comment on attachment 347944 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=347944&action=review

r=me

> Source/JavaScriptCore/yarr/YarrJIT.cpp:3565
> +            codeBlock.setUsesPaternContextBuffer();

nit: "Patern" looks mis-spelled.  Maybe fix in a follow up patch since it's not related to this issue.
Comment 3 Michael Saboff 2018-08-23 12:16:22 PDT
Comment on attachment 347944 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=347944&action=review

>> Source/JavaScriptCore/yarr/YarrJIT.cpp:3565
>> +            codeBlock.setUsesPaternContextBuffer();
> 
> nit: "Patern" looks mis-spelled.  Maybe fix in a follow up patch since it's not related to this issue.

I fixed that in the patch I'm working on.  I can factor that out if you like.
Comment 4 Mark Lam 2018-08-23 12:42:52 PDT
(In reply to Michael Saboff from comment #3)
> Comment on attachment 347944 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=347944&action=review
> 
> >> Source/JavaScriptCore/yarr/YarrJIT.cpp:3565
> >> +            codeBlock.setUsesPaternContextBuffer();
> > 
> > nit: "Patern" looks mis-spelled.  Maybe fix in a follow up patch since it's not related to this issue.
> 
> I fixed that in the patch I'm working on.  I can factor that out if you like.

Either works for me.
Comment 5 WebKit Commit Bot 2018-08-23 12:57:52 PDT
Comment on attachment 347944 [details]
Patch

Clearing flags on attachment: 347944

Committed r235238: <https://trac.webkit.org/changeset/235238>
Comment 6 WebKit Commit Bot 2018-08-23 12:57:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-08-23 12:58:18 PDT
<rdar://problem/43654564>