[JSC] Implement String.prototype.concat in JS builtins
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Jun 2017 05:18:25 +0000 (05:18 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Jun 2017 05:18:25 +0000 (05:18 +0000)
commit3ac2b5d76a91fa08ebbeab33eb89354bc6f849bd
tree9fead96abbe3408861dac20a621646ed6c0101fc
parent9a47e54ca371e03c2c5bf923ea410c8c182f4557
[JSC] Implement String.prototype.concat in JS builtins
https://bugs.webkit.org/show_bug.cgi?id=172798

Reviewed by Sam Weinig.

JSTests:

* microbenchmarks/string-concat-convert.js: Added.
(test):
* microbenchmarks/string-concat-long-convert.js: Added.
(test):
* microbenchmarks/string-concat-long.js: Added.
(test):
* microbenchmarks/string-concat.js: Added.
(test):

Source/JavaScriptCore:

Since we have highly effective + operation for strings,
implementing String.prototype.concat in JS simplifies the
implementation and improves performance by using speculated
types.

Added microbenchmarks show performance improvement.

string-concat-long-convert     1063.2787+-12.9101    ^    109.0855+-2.8083        ^ definitely 9.7472x faster
string-concat-convert          1111.1366+-12.2363    ^     99.3402+-1.9874        ^ definitely 11.1852x faster
string-concat                   131.7377+-3.8359     ^     54.3949+-0.9580        ^ definitely 2.4219x faster
string-concat-long               79.4726+-1.9644     ^     64.6301+-1.4941        ^ definitely 1.2297x faster

* builtins/StringPrototype.js:
(globalPrivate.stringConcatSlowPath):
(concat):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::stringProtoFuncConcat): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/microbenchmarks/string-concat-convert.js [new file with mode: 0644]
JSTests/microbenchmarks/string-concat-long-convert.js [new file with mode: 0644]
JSTests/microbenchmarks/string-concat-long.js [new file with mode: 0644]
JSTests/microbenchmarks/string-concat.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/StringPrototype.js
Source/JavaScriptCore/runtime/StringPrototype.cpp