Bug 174601 - [JSC] There should be a debug option to dump a compiled RegExp Pattern
Summary: [JSC] There should be a debug option to dump a compiled RegExp Pattern
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-17 17:12 PDT by Michael Saboff
Modified: 2017-07-18 09:25 PDT (History)
5 users (show)

See Also:


Attachments
Patch (14.13 KB, patch)
2017-07-17 17:23 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff
Updated patch - replaced U_FALLTHROUGH with FALLTHROUGH (14.13 KB, patch)
2017-07-17 19:10 PDT, Michael Saboff
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2017-07-17 17:12:07 PDT
To aid in debugging, it makes sense to add a JSC option to dump RegExp Patterns.  This is effectively the intermediate form before the pattern is consumed by the YARR interpreter or JIT.  This would be similar to the DFG, FTL, AIR & B3 IR dumping options.
Comment 1 Michael Saboff 2017-07-17 17:23:30 PDT
Created attachment 315736 [details]
Patch
Comment 2 Michael Saboff 2017-07-17 17:36:54 PDT
I replaced the "U_FALLTHROUGH" that Xcode recommended with "FALLTHROUGH" in my local tree.  That should fix the "jsc" build.
Comment 3 Michael Saboff 2017-07-17 19:10:32 PDT
Created attachment 315747 [details]
Updated patch - replaced U_FALLTHROUGH with FALLTHROUGH
Comment 4 Alex Christensen 2017-07-18 00:02:38 PDT
Comment on attachment 315747 [details]
Updated patch - replaced U_FALLTHROUGH with FALLTHROUGH

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

> Source/JavaScriptCore/runtime/Options.h:435
> +    v(bool, dumpCompiledRegExpPatterns, false, Normal, nullptr) \

Would it be useful to make this an option, not a compile time flag?  Could you use NDEBUG instead?

> Source/JavaScriptCore/yarr/YarrPattern.cpp:1004
> +

extra whitespace
Comment 5 Saam Barati 2017-07-18 00:52:57 PDT
Comment on attachment 315747 [details]
Updated patch - replaced U_FALLTHROUGH with FALLTHROUGH

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

>> Source/JavaScriptCore/runtime/Options.h:435
>> +    v(bool, dumpCompiledRegExpPatterns, false, Normal, nullptr) \
> 
> Would it be useful to make this an option, not a compile time flag?  Could you use NDEBUG instead?

Not sure I follow — these are runtime options. We tend to never turn on options that print things by default in any build style.
Comment 6 Michael Saboff 2017-07-18 09:25:43 PDT
Committed r219611: <http://trac.webkit.org/changeset/219611>