Changeset 86330 in webkit
- Timestamp:
- May 12, 2011 5:07:24 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r86318 r86330 1 2011-05-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Darin Adler. 4 5 String operator+ reallocates unnecessarily when concatting > 2 strings 6 https://bugs.webkit.org/show_bug.cgi?id=58420 7 8 Provide a faster String append operator. 9 Up until now, "String operator+(const String& a, const String& b)" copied String a into a temporary 10 object, and used a.append(b), which reallocates a new buffer of aLength+bLength. When concatting 11 N strings using operator+, this leads to N-1 reallocations. 12 13 Replace this with a flexible operator+ implementation, that avoids these reallocations. 14 When concatting a 'String' with any string type (char*, UChar, Vector<char>, String, AtomicString, etc..) 15 a StringAppend<String, T> object is created, which holds the intermediate string objects, and delays 16 creation of the final string, until operator String() is invoked. 17 18 template<typename T> 19 StringAppend<String, T> operator+(const String& string1, T string2) 20 { 21 return StringAppend<String, T>(string1, string2); 22 } 23 24 template<typename U, typename V, typename W> 25 StringAppend<U, StringAppend<V, W> > operator+(U string1, const StringAppend<V, W>& string2) 26 { 27 return StringAppend<U, StringAppend<V, W> >(string1, string2); 28 } 29 30 When concatting three strings - "String a, b, c; String result = a + b + c;" following happens: 31 first a StringAppend<String, String> object is created by operator+(const String& string1, String string2). 32 Then operator+(String string1, const StringAppend<String, String>& string2) is invoked, which returns 33 a StringAppend<String, StringAppend<String, String> > object. 34 Then operator String() is invoked, which allocates a StringImpl object, once, large enough to hold the 35 final string - it uses tryMakeString provided by StringConcatenate.h under the hoods, which guards us 36 against too big string allocations, etc. 37 38 Note that the second template, defines a recursive way to concat an arbitary number of strings 39 into a single String with just one allocation. 40 41 * GNUmakefile.list.am: Add StringOperators.h to build. 42 * JavaScriptCore.exp: Export WTF::emptyString(). Remove no longer needed symbols. 43 * JavaScriptCore.gypi: Add StringOperators.h to build. 44 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto. 45 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. 46 * wtf/text/AtomicString.h: Pull in StringConcatenate.h at the end of the file. 47 * wtf/text/StringConcatenate.h: Conditionally include AtomicString.h to avoid a cyclic dependency. Pull in StringOperators.h at the end of the file. 48 * wtf/text/StringOperators.h: Added. This is never meant to be included directly, including either WTFString.h or AtomicString.h automatically pulls in this file. 49 (WTF::StringAppend::StringAppend): 50 (WTF::StringAppend::operator String): 51 (WTF::StringAppend::operator AtomicString): 52 (WTF::StringAppend::writeTo): 53 (WTF::StringAppend::length): 54 (WTF::operator+): 55 * wtf/text/WTFString.cpp: Remove operator+ implementations that use String::append(). 56 (WTF::emptyString): Add new shared empty string free function. 57 * wtf/text/WTFString.h: Replace operator+ implementations by StringAppend template solution. Pull in AtomicString.h at the end of the file. 58 1 59 2011-05-12 Philippe Normand <pnormand@igalia.com> 2 60 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r86209 r86330 526 526 Source/JavaScriptCore/wtf/text/StringImpl.cpp \ 527 527 Source/JavaScriptCore/wtf/text/StringImpl.h \ 528 Source/JavaScriptCore/wtf/text/StringOperators.h \ 528 529 Source/JavaScriptCore/wtf/text/StringStatics.cpp \ 529 530 Source/JavaScriptCore/wtf/text/TextPosition.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r86300 r86330 373 373 __ZN3WTF11OSAllocator18releaseDecommittedEPvm 374 374 __ZN3WTF11commentAtomE 375 __ZN3WTF11emptyStringEv 375 376 __ZN3WTF11currentTimeEv 376 377 __ZN3WTF11dtoaRoundDPEPcdiRbRiRj … … 511 512 __ZN3WTFeqERKNS_12AtomicStringERKNS_6VectorItLm0EEE 512 513 __ZN3WTFeqERKNS_7CStringES2_ 513 __ZN3WTFplEPKcRKNS_6StringE514 __ZN3WTFplERKNS_6StringEPKc515 __ZN3WTFplERKNS_6StringES2_516 514 __ZNK3JSC10JSFunction23isHostFunctionNonInlineEv 517 515 __ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_10JSFunctionE -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r86209 r86330 225 225 'wtf/text/StringImpl.h', 226 226 'wtf/text/StringImplBase.h', 227 'wtf/text/StringOperators.h', 227 228 'wtf/text/TextPosition.h', 228 229 'wtf/text/WTFString.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
r85253 r86330 497 497 </File> 498 498 <File 499 RelativePath="..\..\wtf\text\StringOperators.h" 500 > 501 </File> 502 <File 499 503 RelativePath="..\..\wtf\text\StringStatics.cpp" 500 504 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r86209 r86330 224 224 65FDE49C0BDD1D4A00E80111 /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B808E7EECC0023E5F6 /* Assertions.cpp */; }; 225 225 7186A6EC13100BA5004479E1 /* HexNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 7186A6E813100B57004479E1 /* HexNumber.h */; settings = {ATTRIBUTES = (Private, ); }; }; 226 71DA9D82134F3F3D00B767E7 /* StringOperators.h in Headers */ = {isa = PBXBuildFile; fileRef = 718A8482134F3A1200B87529 /* StringOperators.h */; settings = {ATTRIBUTES = (Private, ); }; }; 226 227 76FB9F0F12E851860051A2EB /* SHA1.h in Headers */ = {isa = PBXBuildFile; fileRef = 76FB9F0E12E851860051A2EB /* SHA1.h */; settings = {ATTRIBUTES = (Private, ); }; }; 227 228 76FB9F1112E851960051A2EB /* SHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76FB9F1012E851960051A2EB /* SHA1.cpp */; }; … … 910 911 704FD35305697E6D003DBED9 /* BooleanObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = BooleanObject.h; sourceTree = "<group>"; tabWidth = 8; }; 911 912 7186A6E813100B57004479E1 /* HexNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexNumber.h; sourceTree = "<group>"; }; 913 718A8482134F3A1200B87529 /* StringOperators.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringOperators.h; path = text/StringOperators.h; sourceTree = "<group>"; }; 912 914 76FB9F0E12E851860051A2EB /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = "<group>"; }; 913 915 76FB9F1012E851960051A2EB /* SHA1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SHA1.cpp; sourceTree = "<group>"; }; … … 2033 2035 868BFA07117CEFD100B908B1 /* StringImpl.h */, 2034 2036 86B99AE2117E578100DF5A90 /* StringImplBase.h */, 2037 718A8482134F3A1200B87529 /* StringOperators.h */, 2035 2038 8626BECE11928E3900782FAB /* StringStatics.cpp */, 2036 2039 F3BD31D0126730180065467F /* TextPosition.h */, … … 2530 2533 868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */, 2531 2534 86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */, 2535 71DA9D82134F3F3D00B767E7 /* StringOperators.h in Headers */, 2532 2536 BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */, 2533 2537 BC18C4690E16F5CD00B34460 /* StringObjectThatMasqueradesAsUndefined.h in Headers */, -
trunk/Source/JavaScriptCore/wtf/text/AtomicString.h
r83407 r86330 202 202 #endif 203 203 204 #include "StringConcatenate.h" 204 205 #endif // AtomicString_h -
trunk/Source/JavaScriptCore/wtf/text/StringConcatenate.h
r82931 r86330 27 27 #define StringConcatenate_h 28 28 29 #include <wtf/text/WTFString.h> 29 #ifndef WTFString_h 30 #include "AtomicString.h" 31 #endif 30 32 31 33 namespace WTF { … … 183 185 private: 184 186 const String& m_buffer; 187 }; 188 189 template<> 190 class StringTypeAdapter<AtomicString> { 191 public: 192 StringTypeAdapter<AtomicString>(const AtomicString& string) 193 : m_adapter(string.string()) 194 { 195 } 196 197 unsigned length() { return m_adapter.length(); } 198 void writeTo(UChar* destination) { m_adapter.writeTo(destination); } 199 200 private: 201 StringTypeAdapter<String> m_adapter; 185 202 }; 186 203 … … 581 598 using WTF::makeString; 582 599 600 #include "StringOperators.h" 583 601 #endif -
trunk/Source/JavaScriptCore/wtf/text/WTFString.cpp
r80012 r86330 132 132 } 133 133 134 String operator+(const String& a, const String& b)135 {136 if (a.isEmpty())137 return b;138 if (b.isEmpty())139 return a;140 String c = a;141 c += b;142 return c;143 }144 145 String operator+(const String& s, const char* cs)146 {147 return s + String(cs);148 }149 150 String operator+(const char* cs, const String& s)151 {152 return String(cs) + s;153 }154 155 134 int codePointCompare(const String& a, const String& b) 156 135 { … … 972 951 } 973 952 953 const String& emptyString() 954 { 955 DEFINE_STATIC_LOCAL(String, emptyString, (StringImpl::empty())); 956 return emptyString; 957 } 958 974 959 } // namespace WTF 975 960 -
trunk/Source/JavaScriptCore/wtf/text/WTFString.h
r83637 r86330 357 357 #endif 358 358 359 String operator+(const String&, const String&);360 String operator+(const String&, const char*);361 String operator+(const char*, const String&);362 363 359 inline String& operator+=(String& a, const String& b) { a.append(b); return a; } 364 360 … … 502 498 template <> struct VectorTraits<String> : SimpleClassVectorTraits { }; 503 499 500 // Shared global empty string. 501 const String& emptyString(); 502 504 503 } 505 504 506 505 using WTF::CString; 507 506 using WTF::String; 507 using WTF::emptyString; 508 508 using WTF::append; 509 509 using WTF::appendNumber; … … 529 529 using WTF::reverseFind; 530 530 531 #endif 531 #include "AtomicString.h" 532 #endif -
trunk/Source/WebCore/ChangeLog
r86327 r86330 1 2011-05-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Darin Adler. 4 5 String operator+ reallocates unnecessary when concatting > 2 strings 6 https://bugs.webkit.org/show_bug.cgi?id=58420 7 8 Provide a faster String append operator. See Source/JavaScriptCore/ChangeLog for details. 9 10 * dom/XMLDocumentParserLibxml2.cpp: 11 (WebCore::handleElementAttributes): 12 * editing/MarkupAccumulator.cpp: 13 (WebCore::MarkupAccumulator::shouldAddNamespaceElement): 14 * html/HTMLAnchorElement.cpp: 15 (WebCore::HTMLAnchorElement::hash): 16 (WebCore::HTMLAnchorElement::search): 17 * html/ImageInputType.cpp: 18 (WebCore::ImageInputType::appendFormData): 19 * html/parser/HTMLTreeBuilder.cpp: 20 * loader/CrossOriginAccessControl.cpp: 21 (WebCore::passesAccessControlCheck): 22 * page/Location.cpp: 23 (WebCore::Location::search): 24 (WebCore::Location::hash): 25 * page/NavigatorBase.cpp: 26 (WebCore::NavigatorBase::platform): 27 * platform/chromium/ClipboardChromium.cpp: 28 (WebCore::writeImageToDataObject): 29 * platform/gtk/PasteboardHelper.cpp: 30 (WebCore::PasteboardHelper::fillSelectionData): 31 * platform/network/cf/ResourceHandleCFNet.cpp: 32 (WebCore::encodeBasicAuthorization): 33 * platform/network/cf/SocketStreamHandleCFNet.cpp: 34 (WebCore::SocketStreamHandle::copyCFStreamDescription): 35 * platform/network/mac/ResourceHandleMac.mm: 36 (WebCore::encodeBasicAuthorization): 37 * workers/WorkerLocation.cpp: 38 (WebCore::WorkerLocation::search): 39 (WebCore::WorkerLocation::hash): 40 1 41 2011-05-06 Yury Semikhatsky <yurys@chromium.org> 2 42 -
trunk/Source/WebCore/dom/XMLDocumentParserLibxml2.cpp
r85800 r86330 740 740 String attrPrefix = toString(attributes[i].prefix); 741 741 AtomicString attrURI = attrPrefix.isEmpty() ? AtomicString() : toAtomicString(attributes[i].uri); 742 AtomicString attrQName = attrPrefix.isEmpty() ? toAtomicString(attributes[i].localname) : AtomicString(attrPrefix + ":" + toString(attributes[i].localname));742 AtomicString attrQName = attrPrefix.isEmpty() ? toAtomicString(attributes[i].localname) : attrPrefix + ":" + toString(attributes[i].localname); 743 743 744 744 newElement->setAttributeNS(attrURI, attrQName, attrValue, ec, scriptingPermission); -
trunk/Source/WebCore/editing/MarkupAccumulator.cpp
r85244 r86330 211 211 // Don't add namespace attribute if it is already defined for this elem. 212 212 const AtomicString& prefix = element->prefix(); 213 AtomicString attr = !prefix.isEmpty() ? "xmlns:" + prefix : "xmlns"; 214 return !element->hasAttribute(attr); 213 if (prefix.isEmpty()) 214 return !element->hasAttribute(xmlnsAtom); 215 216 DEFINE_STATIC_LOCAL(String, xmlnsWithColon, ("xmlns:")); 217 return !element->hasAttribute(xmlnsWithColon + prefix); 215 218 } 216 219 -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r85484 r86330 306 306 { 307 307 String fragmentIdentifier = href().fragmentIdentifier(); 308 return fragmentIdentifier.isEmpty() ? "": "#" + fragmentIdentifier;308 return fragmentIdentifier.isEmpty() ? emptyString() : "#" + fragmentIdentifier; 309 309 } 310 310 … … 443 443 { 444 444 String query = href().query(); 445 return query.isEmpty() ? "": "?" + query;445 return query.isEmpty() ? emptyString() : "?" + query; 446 446 } 447 447 -
trunk/Source/WebCore/html/ImageInputType.cpp
r74895 r86330 58 58 return false; 59 59 const AtomicString& name = element()->name(); 60 encoding.appendData(name.isEmpty() ? "x" : (name + ".x"), m_clickLocation.x()); 61 encoding.appendData(name.isEmpty() ? "y" : (name + ".y"), m_clickLocation.y()); 62 if (!name.isEmpty() && !element()->value().isEmpty()) 60 if (name.isEmpty()) { 61 encoding.appendData("x", m_clickLocation.x()); 62 encoding.appendData("y", m_clickLocation.y()); 63 return true; 64 } 65 66 DEFINE_STATIC_LOCAL(String, dotXString, (".x")); 67 DEFINE_STATIC_LOCAL(String, dotYString, (".y")); 68 encoding.appendData(name + dotXString, m_clickLocation.x()); 69 encoding.appendData(name + dotYString, m_clickLocation.y()); 70 71 if (!!element()->value().isEmpty()) 63 72 encoding.appendData(name, element()->value()); 64 73 return true; -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
r85903 r86330 670 670 QualifiedName* name = names[i]; 671 671 const AtomicString& localName = name->localName(); 672 AtomicString prefixColonLocalName (prefix + ":" + localName);672 AtomicString prefixColonLocalName = prefix + ':' + localName; 673 673 QualifiedName nameWithPrefix(prefix, localName, name->namespaceURI()); 674 674 map->add(prefixColonLocalName, nameWithPrefix); -
trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp
r73447 r86330 110 110 RefPtr<SecurityOrigin> accessControlOrigin = SecurityOrigin::createFromString(accessControlOriginString); 111 111 if (!accessControlOrigin->isSameSchemeHostPort(securityOrigin)) { 112 errorDescription = (accessControlOriginString == "*") ? "Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true." 113 : "Origin " + securityOrigin->toString() + " is not allowed by Access-Control-Allow-Origin."; 112 if (accessControlOriginString == "*") 113 errorDescription = "Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true."; 114 else 115 errorDescription = "Origin " + securityOrigin->toString() + " is not allowed by Access-Control-Allow-Origin."; 114 116 return false; 115 117 } -
trunk/Source/WebCore/page/Location.cpp
r85484 r86330 121 121 122 122 const KURL& url = this->url(); 123 return url.query().isEmpty() ? "": "?" + url.query();123 return url.query().isEmpty() ? emptyString() : "?" + url.query(); 124 124 } 125 125 … … 137 137 138 138 const String& fragmentIdentifier = url().fragmentIdentifier(); 139 return fragmentIdentifier.isEmpty() ? "": "#" + fragmentIdentifier;139 return fragmentIdentifier.isEmpty() ? emptyString() : "#" + fragmentIdentifier; 140 140 } 141 141 -
trunk/Source/WebCore/page/NavigatorBase.cpp
r85300 r86330 87 87 { 88 88 #if OS(LINUX) 89 if ( String("") != WEBCORE_NAVIGATOR_PLATFORM)89 if (!String(WEBCORE_NAVIGATOR_PLATFORM).isEmpty()) 90 90 return WEBCORE_NAVIGATOR_PLATFORM; 91 91 struct utsname osname; 92 DEFINE_STATIC_LOCAL(String, platformName, (uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : ""));92 DEFINE_STATIC_LOCAL(String, platformName, (uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : emptyString())); 93 93 return platformName; 94 94 #else -
trunk/Source/WebCore/platform/chromium/ClipboardChromium.cpp
r85064 r86330 231 231 String extension = MIMETypeRegistry::getPreferredExtensionForMIMEType( 232 232 cachedImage->response().mimeType()); 233 dataObject->setFileExtension(extension.isEmpty() ? "": "." + extension);233 dataObject->setFileExtension(extension.isEmpty() ? emptyString() : "." + extension); 234 234 String title = element->getAttribute(altAttr); 235 235 if (title.isEmpty()) -
trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp
r75009 r86330 163 163 // Some Linux applications refuse to accept pasted markup unless it is 164 164 // prefixed by a content-type meta tag. 165 CString markup = (gMarkupPrefix + dataObject->markup()).utf8();165 CString markup = String(gMarkupPrefix + dataObject->markup()).utf8(); 166 166 gtk_selection_data_set(selectionData, markupAtom, 8, 167 167 reinterpret_cast<const guchar*>(markup.data()), markup.length() + 1); -
trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r86285 r86330 127 127 static String encodeBasicAuthorization(const String& user, const String& password) 128 128 { 129 return base64Encode( (user + ":" + password).utf8());129 return base64Encode(String(user + ":" + password).utf8()); 130 130 } 131 131 -
trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
r85036 r86330 373 373 { 374 374 SocketStreamHandle* handle = static_cast<SocketStreamHandle*>(info); 375 return ("WebKit socket stream, " + handle->m_url.string()).createCFString();375 return String("WebKit socket stream, " + handle->m_url.string()).createCFString(); 376 376 } 377 377 -
trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
r86309 r86330 140 140 static String encodeBasicAuthorization(const String& user, const String& password) 141 141 { 142 return base64Encode( (user + ":" + password).utf8());142 return base64Encode(String(user + ":" + password).utf8()); 143 143 } 144 144 -
trunk/Source/WebCore/workers/WorkerLocation.cpp
r57101 r86330 67 67 String WorkerLocation::search() const 68 68 { 69 return m_url.query().isEmpty() ? "": "?" + m_url.query();69 return m_url.query().isEmpty() ? emptyString() : "?" + m_url.query(); 70 70 } 71 71 72 72 String WorkerLocation::hash() const 73 73 { 74 return m_url.fragmentIdentifier().isEmpty() ? "": "#" + m_url.fragmentIdentifier();74 return m_url.fragmentIdentifier().isEmpty() ? emptyString() : "#" + m_url.fragmentIdentifier(); 75 75 } 76 76 -
trunk/Source/WebKit/chromium/ChangeLog
r86325 r86330 1 2011-05-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Darin Adler. 4 5 String operator+ reallocates unnecessarily when concatting > 2 strings 6 https://bugs.webkit.org/show_bug.cgi?id=58420 7 8 Provide a faster String append operator. See Source/JavaScriptCore/ChangeLog for details. 9 10 * src/WebAccessibilityObject.cpp: 11 (WebKit::WebAccessibilityObject::keyboardShortcut): Cast to String first, before trying to convert to platform dependant type. 12 * src/WebHTTPLoadInfo.cpp: 13 (WebKit::addHeader): Don't pass WebString to makeString, explicit cast to String first. 14 * tests/IDBLevelDBCodingTest.cpp: Cast to String first, to avoid conflicting with gtests global templatified operator+. 15 (IDBLevelDBCoding::TEST): 16 1 17 2011-05-10 Tony Gentilcore <tonyg@chromium.org> 2 18 -
trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp
r80890 r86330 424 424 } 425 425 426 return modifierString + accessKey;426 return String(modifierString + accessKey); 427 427 } 428 428 -
trunk/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp
r83987 r86330 106 106 pair<HTTPHeaderMap::iterator, bool> result = map->add(name, value); 107 107 if (!result.second) 108 result.first->second += String("\n") + value;108 result.first->second += "\n" + String(value); 109 109 } 110 110 -
trunk/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp
r85844 r86330 181 181 182 182 v = encodeString(String(testStringA)); 183 EXPECT_EQ( testStringA, decodeString(v.data(), v.data() + v.size()));183 EXPECT_EQ(String(testStringA), decodeString(v.data(), v.data() + v.size())); 184 184 185 185 v = encodeString(String(testStringB)); 186 EXPECT_EQ( testStringB, decodeString(v.data(), v.data() + v.size()));186 EXPECT_EQ(String(testStringB), decodeString(v.data(), v.data() + v.size())); 187 187 } 188 188 -
trunk/Source/WebKit/mac/ChangeLog
r86325 r86330 1 2011-05-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Darin Adler. 4 5 String operator+ reallocates unnecessarily when concatting > 2 strings 6 https://bugs.webkit.org/show_bug.cgi?id=58420 7 8 Provide a faster String append operator. See Source/JavaScriptCore/ChangeLog for details. 9 10 * WebView/WebFrame.mm: Explicitely cast to Strings first, so operator NSString*() can be invoked. 11 (-[WebFrame _stringWithDocumentTypeStringAndMarkupString:]): 12 1 13 2011-05-10 Tony Gentilcore <tonyg@chromium.org> 2 14 -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r86325 r86330 494 494 - (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString 495 495 { 496 return _private->coreFrame->documentTypeString() + markupString;496 return String(_private->coreFrame->documentTypeString() + String(markupString)); 497 497 } 498 498 -
trunk/Source/WebKit/win/AccessibleBase.cpp
r82120 r86330 376 376 accessKeyModifiers += "Win+"; 377 377 } 378 *shortcut = BString( accessKeyModifiers + accessKey).release();378 *shortcut = BString(String(accessKeyModifiers + accessKey)).release(); 379 379 return S_OK; 380 380 } -
trunk/Source/WebKit/win/ChangeLog
r86287 r86330 1 2011-05-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Darin Adler. 4 5 String operator+ reallocates unnecessarily when concatting > 2 strings 6 https://bugs.webkit.org/show_bug.cgi?id=58420 7 8 Provide a faster String append operator. See Source/JavaScriptCore/ChangeLog for details. 9 10 * AccessibleBase.cpp: 11 (AccessibleBase::get_accKeyboardShortcut): Explicitely cast to Strings first, so operator BString() can be invoked. 12 1 13 2011-05-11 Dmitry Lomov <dslomov@google.com> 2 14
Note: See TracChangeset
for help on using the changeset viewer.