Bug 138608

Summary: RegExp.exec() should do a single pass match-and-gather.
Product: WebKit Reporter: Andreas Kling <kling>
Component: JavaScriptCoreAssignee: Andreas Kling <kling>
Status: NEW ---    
Severity: Normal CC: barraclough, buildbot, commit-queue, ggaren, rniwa
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
buildbot: commit-queue-
Archive of layout-test-results from ews102 for mac-mountainlion
none
Archive of layout-test-results from ews107 for mac-mountainlion-wk2 none

Description Andreas Kling 2014-11-11 02:27:57 PST
Combine the initial matching pass and gathering of subpatterns into a single pass.
Specialize RegExp.exec() and RegExp.test() separately: exec() is optimized for
clients that want the subpatterns, and test() is optimized for those who only care
if the expression matched anything.
Comment 1 Andreas Kling 2014-11-11 02:28:30 PST
Created attachment 241346 [details]
Patch
Comment 2 WebKit Commit Bot 2014-11-11 02:31:40 PST
Attachment 241346 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/RegExpObject.h:63:  The parameter name "exec" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/RegExpObject.h:63:  The parameter name "string" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/RegExpObject.h:91:  The parameter name "exec" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andreas Kling 2014-12-15 15:14:47 PST
Created attachment 243314 [details]
Patch
Comment 4 WebKit Commit Bot 2014-12-15 15:16:31 PST
Attachment 243314 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/RegExpObject.h:63:  The parameter name "exec" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/RegExpObject.h:63:  The parameter name "string" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/RegExpObject.h:91:  The parameter name "exec" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Geoffrey Garen 2014-12-15 15:26:24 PST
Comment on attachment 243314 [details]
Patch

I think you need to performMatch in order to set the named properties on the regexp constructor. If so, and this patch doesn't fail an existing test, you should add one.

Can we meaningfully combine createRegExpMatchesArrayOrNull and createRegExpMatchesArray? Is the only difference just that one might return null?
Comment 6 Build Bot 2014-12-15 16:05:19 PST
Comment on attachment 243314 [details]
Patch

Attachment 243314 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6001477617188864

New failing tests:
js/kde/RegExp.html
js/dom/regexp-caching.html
Comment 7 Build Bot 2014-12-15 16:05:22 PST
Created attachment 243327 [details]
Archive of layout-test-results from ews102 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 8 Build Bot 2014-12-15 16:06:30 PST
Comment on attachment 243314 [details]
Patch

Attachment 243314 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4841230588444672

New failing tests:
js/kde/RegExp.html
js/dom/regexp-caching.html
Comment 9 Build Bot 2014-12-15 16:06:33 PST
Created attachment 243328 [details]
Archive of layout-test-results from ews107 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5