Optimization for String.prototype.replace([RegExp], ""), this improves v8-regexp by ~3%.
Created attachment 103133 [details] The patch
Attachment 103133 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/runtime/StringPrototype.cpp:267: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/JavaScriptCore/runtime/StringPrototype.cpp:271: Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5] Source/JavaScriptCore/runtime/StringPrototype.cpp:380: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 3 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 103133 [details] The patch View in context: https://bugs.webkit.org/attachment.cgi?id=103133&action=review >> Source/JavaScriptCore/runtime/StringPrototype.cpp:271 >> + PassRefPtr<StringImpl> impl = StringImpl::tryCreateUninitialized(totalLength, buffer); > > Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5] This is copy and pasted, but very wrong. Please us a RefPtr and fix the other spot.
Fixed in r92540