https://bugs.webkit.org/show_bug.cgi?id=32831
Replace UString::Rep implementation, following introduction of ropes to JSC.
Reviewed by Darin Adler.
JavaScriptCore:
- Remove redundant overcapacity mechanisms.
- Reduce memory cost of Rep's.
- Add an inline storage mechanism akin to that in WebCore's StringImpl.
~1% Sunspider progression.
(JSC::JSString::resolveRope):
- runtime/SmallStrings.cpp:
(JSC::SmallStringsStorage::SmallStringsStorage):
(JSC::initializeUString):
(JSC::createRep):
(JSC::UString::createFromUTF8):
(JSC::UString::createUninitialized):
(JSC::UString::spliceSubstringsWithSeparators):
(JSC::UString::replaceRange):
(JSC::UString::ascii):
(JSC::UString::operator=):
(JSC::UString::toStrictUInt32):
(JSC::equal):
(JSC::UString::isEmpty):
(JSC::UString::cost):
(JSC::makeString):
- runtime/UStringImpl.cpp: Added.
(JSC::UStringImpl::baseSharedBuffer):
(JSC::UStringImpl::sharedBuffer):
(JSC::UStringImpl::destroy):
(JSC::UStringImpl::computeHash):
- runtime/UStringImpl.h: Added.
(JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
(JSC::UntypedPtrAndBitfield::asPtr):
(JSC::UntypedPtrAndBitfield::operator&=):
(JSC::UntypedPtrAndBitfield::operator|=):
(JSC::UntypedPtrAndBitfield::operator&):
(JSC::UStringImpl::create):
(JSC::UStringImpl::createCopying):
(JSC::UStringImpl::createUninitialized):
(JSC::UStringImpl::data):
(JSC::UStringImpl::size):
(JSC::UStringImpl::cost):
(JSC::UStringImpl::hash):
(JSC::UStringImpl::computedHash):
(JSC::UStringImpl::setHash):
(JSC::UStringImpl::identifierTable):
(JSC::UStringImpl::setIdentifierTable):
(JSC::UStringImpl::ref):
(JSC::UStringImpl::deref):
(JSC::UStringImpl::allocChars):
(JSC::UStringImpl::copyChars):
(JSC::UStringImpl::computeHash):
(JSC::UStringImpl::null):
(JSC::UStringImpl::empty):
(JSC::UStringImpl::checkConsistency):
(JSC::UStringImpl::):
(JSC::UStringImpl::UStringImpl):
(JSC::UStringImpl::operator new):
(JSC::UStringImpl::bufferOwnerString):
(JSC::UStringImpl::bufferOwnership):
(JSC::UStringImpl::isStatic):
JavaScriptGlue:
- ForwardingHeaders/wtf/PossiblyNull.h: Added.
WebCore:
- ForwardingHeaders/runtime/UStringImpl.h: Added.
- platform/text/StringImpl.cpp:
(WebCore::StringImpl::ustring):
- order of arguments to UString::Rep constructor for shared strings changed.