Bug 138608 - RegExp.exec() should do a single pass match-and-gather.
Summary: RegExp.exec() should do a single pass match-and-gather.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2014-11-11 02:27 PST by Andreas Kling
Modified: 2014-12-16 00:31 PST (History)
5 users (show)

See Also:


Attachments
Patch (6.43 KB, patch)
2014-11-11 02:28 PST, Andreas Kling
no flags Details | Formatted Diff | Diff
Patch (7.14 KB, patch)
2014-12-15 15:14 PST, Andreas Kling
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-mountainlion (524.57 KB, application/zip)
2014-12-15 16:05 PST, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-mountainlion-wk2 (517.95 KB, application/zip)
2014-12-15 16:06 PST, Build Bot
no flags Details

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