-
aroben@apple.com authored
Fixes <http://webkit.org/b/63330> Concatenating string literals and WTF::Strings using operator+ is suboptimal Reviewed by Darin Adler. Source/JavaScriptCore: * wtf/text/StringConcatenate.h: (WTF::StringTypeAdapter<String>::writeTo): Added a macro that can be used for testing how many WTF::Strings get copied while evaluating an operator+ expression. * wtf/text/StringOperators.h: (WTF::operator+): Changed the overload that takes a StringAppend to take it on the left-hand side, since operator+ is left-associative. Having the StringAppend on the right-hand side was causing us to make intermediate WTF::Strings when evaluating expressions that contained multiple calls to operator+. Added some more overloads for that take a left-hand side of const char* to resolve overload ambiguity for certain expressions. Added overloads that take a left-hand side of const UChar* (matching the const char* overloads) so that wide string literals don't first have to be converted to a WTF::String in operator+ expressions. Source/WebKit2: Export some symbols needed by TestWebKitAPI * win/WebKit2.def: Tools: Test that no intermediate WTF::Strings are created when concatenating with string literals * TestWebKitAPI/Tests/WTF/StringOperators.cpp: Added. (TestWebKitAPI::TEST): Test that a bunch of different string concatenation expressions don't create any intermediate WTF::Strings while they're being evaluated. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added new file. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@90813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6b68717e