diff options
Diffstat (limited to 'JavaScriptCore/wtf/text/AtomicString.h')
-rw-r--r-- | JavaScriptCore/wtf/text/AtomicString.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/JavaScriptCore/wtf/text/AtomicString.h b/JavaScriptCore/wtf/text/AtomicString.h index 9db70f4..5bb2cf9 100644 --- a/JavaScriptCore/wtf/text/AtomicString.h +++ b/JavaScriptCore/wtf/text/AtomicString.h @@ -38,7 +38,7 @@ namespace WebCore { struct AtomicStringHash; -class AtomicString : public FastAllocBase { +class AtomicString { public: static void init(); @@ -117,7 +117,13 @@ private: static PassRefPtr<StringImpl> add(const UChar*, unsigned length); static PassRefPtr<StringImpl> add(const UChar*, unsigned length, unsigned existingHash); static PassRefPtr<StringImpl> add(const UChar*); - static PassRefPtr<StringImpl> add(StringImpl*); + ALWAYS_INLINE PassRefPtr<StringImpl> add(StringImpl* r) + { + if (!r || r->isAtomic()) + return r; + return addSlowCase(r); + } + static PassRefPtr<StringImpl> addSlowCase(StringImpl*); }; inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); } |