Bug 188895 - YARR: Need to JIT compile a RegExp before using containsNestedSubpatterns flag
Summary: YARR: Need to JIT compile a RegExp before using containsNestedSubpatterns flag
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-23 11:33 PDT by Michael Saboff
Modified: 2018-08-23 12:58 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.71 KB, patch)
2018-08-23 11:58 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>