diff options
Diffstat (limited to 'JavaScriptCore/runtime/UStringImpl.h')
-rw-r--r-- | JavaScriptCore/runtime/UStringImpl.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/JavaScriptCore/runtime/UStringImpl.h b/JavaScriptCore/runtime/UStringImpl.h index abed637..bbea0aa 100644 --- a/JavaScriptCore/runtime/UStringImpl.h +++ b/JavaScriptCore/runtime/UStringImpl.h @@ -87,20 +87,16 @@ public: template<size_t inlineCapacity> static PassRefPtr<UStringImpl> adopt(Vector<UChar, inlineCapacity>& vector) { - if (unsigned length = vector.size()) + if (unsigned length = vector.size()) { + ASSERT(vector.data()); return adoptRef(new UStringImpl(vector.releaseBuffer(), length, BufferOwned)); + } return &empty(); } - static PassRefPtr<UStringImpl> create(const UChar* buffer, int length) - { - UChar* newBuffer; - if (PassRefPtr<UStringImpl> impl = tryCreateUninitialized(length, newBuffer)) { - copyChars(newBuffer, buffer, length); - return impl; - } - return &null(); - } + static PassRefPtr<UStringImpl> create(const char* c); + static PassRefPtr<UStringImpl> create(const char* c, int length); + static PassRefPtr<UStringImpl> create(const UChar* buffer, int length); static PassRefPtr<UStringImpl> create(PassRefPtr<UStringImpl> rep, int offset, int length) { @@ -180,7 +176,6 @@ public: static unsigned computeHash(const char* s, int length) { ASSERT(length >= 0); return WTF::stringHash(s, length); } static unsigned computeHash(const char* s) { return WTF::stringHash(s); } - static UStringImpl& null() { return *s_null; } static UStringImpl& empty() { return *s_empty; } ALWAYS_INLINE void checkConsistency() const @@ -288,7 +283,6 @@ private: mutable unsigned m_isIdentifier : 1; UntypedPtrAndBitfield m_dataBuffer; - JS_EXPORTDATA static UStringImpl* s_null; JS_EXPORTDATA static UStringImpl* s_empty; friend class JIT; |