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.
Created attachment 241346 [details] Patch
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.
Created attachment 243314 [details] Patch
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 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 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
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 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
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