Ignore:
Timestamp:
May 11, 2010, 7:25:40 PM (15 years ago)
Author:
[email protected]
Message:

Patch by Gavin Barraclough.

Reviewed by Maciej Stachowiak.

Rest of REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
https://bugs.webkit.org/show_bug.cgi?id=38930
<rdar://problem/7937188>

Inline string functions that are commonly used in WTFString, CString, and AtomicString.

  • JavaScriptCore.exp: Remove exports of inline functions.
  • wtf/text/AtomicString.cpp:

(WebCore::AtomicString::addSlowCase): Rename add to addSlowCase, and inline the fast path

of add.

  • wtf/text/AtomicString.h:

(WebCore::AtomicString::add): Inline the fast path of add.

  • wtf/text/CString.cpp: Inline implementation of data and length in the header.
  • wtf/text/CString.h:

(WTF::CString::data): Inline implementation of data.
(WTF::CString::length): Inline implementation of length.

  • wtf/text/WTFString.cpp: Remove implementations of functions to be inlined.
  • wtf/text/WTFString.h:

(WebCore::String::String): Inline implementation.
(WebCore::String::length): Ditto.
(WebCore::String::characters): Ditto.
(WebCore::String::operator[]): Ditto.
(WebCore::String::isEmpty): Ditto.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/text/AtomicString.h

    r57914 r59196  
    118118    static PassRefPtr<StringImpl> add(const UChar*, unsigned length, unsigned existingHash);
    119119    static PassRefPtr<StringImpl> add(const UChar*);
    120     static PassRefPtr<StringImpl> add(StringImpl*);
     120    PassRefPtr<StringImpl> add(StringImpl* r)
     121    {
     122        if (!r || r->isAtomic())
     123            return r;
     124        return addSlowCase(r);
     125    }
     126    static PassRefPtr<StringImpl> addSlowCase(StringImpl*);
    121127};
    122128
Note: See TracChangeset for help on using the changeset viewer.