Chromium Code Reviews| Index: Source/wtf/text/StringImpl.h |
| diff --git a/Source/wtf/text/StringImpl.h b/Source/wtf/text/StringImpl.h |
| index 28a0095340766995c6054bb6c44b9dc22b1139ec..afc6d95aab8b704fb55085ac36e94c941e2ea468 100644 |
| --- a/Source/wtf/text/StringImpl.h |
| +++ b/Source/wtf/text/StringImpl.h |
| @@ -300,25 +300,7 @@ public: |
| return; |
| } |
|
abarth-chromium
2014/03/24 16:46:54
Should we remove this branch too?
Mikhail
2014/03/25 10:30:26
This makes a bit better assembly, on the other han
|
| - // FIXME: Is this implementation really faster than memcpy? |
| - if (numCharacters <= s_copyCharsInlineCutOff) { |
| - unsigned i = 0; |
| -#if (CPU(X86) || CPU(X86_64)) |
| - const unsigned charsPerInt = sizeof(uint32_t) / sizeof(T); |
| - |
| - if (numCharacters > charsPerInt) { |
| - unsigned stopCount = numCharacters & ~(charsPerInt - 1); |
| - |
| - const uint32_t* srcCharacters = reinterpret_cast<const uint32_t*>(source); |
| - uint32_t* destCharacters = reinterpret_cast<uint32_t*>(destination); |
| - for (unsigned j = 0; i < stopCount; i += charsPerInt, ++j) |
| - destCharacters[j] = srcCharacters[j]; |
| - } |
| -#endif |
| - for (; i < numCharacters; ++i) |
| - destination[i] = source[i]; |
| - } else |
| - memcpy(destination, source, numCharacters * sizeof(T)); |
| + memcpy(destination, source, numCharacters * sizeof(T)); |
| } |
| ALWAYS_INLINE static void copyChars(UChar* destination, const LChar* source, unsigned numCharacters) |
| @@ -440,9 +422,6 @@ private: |
| return sizeof(StringImpl) + length * sizeof(CharType); |
| } |
| - // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. |
|
abarth-chromium
2014/03/24 16:46:54
I take it this comment is no longer accurate? It
|
| - static const unsigned s_copyCharsInlineCutOff = 20; |
| - |
| template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacters(UCharPredicate); |
| template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> simplifyMatchedCharactersToSpace(UCharPredicate, StripBehavior); |
| NEVER_INLINE unsigned hashSlowCase() const; |