Ignore:
Timestamp:
Dec 21, 2009, 4:38:24 PM (15 years ago)
Author:
[email protected]
Message:

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):

  • runtime/UString.cpp:

(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):

  • runtime/UString.h:

(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.
    • add forwarding header.

WebCore:

  • ForwardingHeaders/runtime/UStringImpl.h: Added.
    • add forwarding header.
  • platform/text/StringImpl.cpp:

(WebCore::StringImpl::ustring):

  • order of arguments to UString::Rep constructor for shared strings changed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r52334 r52463  
    208208                869083160E6518D7000D36ED /* WREC.h in Headers */ = {isa = PBXBuildFile; fileRef = 869083140E6518D7000D36ED /* WREC.h */; settings = {ATTRIBUTES = (Private, ); }; };
    209209                8698B86910D44D9400D8D01B /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698B86810D44D9400D8D01B /* StringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
     210                8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698BB3710D86BAF00D8D01B /* UStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
     211                8698BB3A10D86BAF00D8D01B /* UStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8698BB3810D86BAF00D8D01B /* UStringImpl.cpp */; };
    210212                869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; };
    211213                86A90ED00EE7D51F00AB350D /* JITArithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */; };
     
    735737                869083140E6518D7000D36ED /* WREC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WREC.h; sourceTree = "<group>"; };
    736738                8698B86810D44D9400D8D01B /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; };
     739                8698BB3710D86BAF00D8D01B /* UStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringImpl.h; sourceTree = "<group>"; };
     740                8698BB3810D86BAF00D8D01B /* UStringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UStringImpl.cpp; sourceTree = "<group>"; };
    737741                869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = "<group>"; };
    738742                86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic.cpp; sourceTree = "<group>"; };
     
    16111615                                F692A8850255597D01FF60F7 /* UString.cpp */,
    16121616                                F692A8860255597D01FF60F7 /* UString.h */,
     1617                                8698BB3810D86BAF00D8D01B /* UStringImpl.cpp */,
     1618                                8698BB3710D86BAF00D8D01B /* UStringImpl.h */,
    16131619                                14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */,
    16141620                                14035DB010DBFB2A00FFFFE7 /* WeakGCPtr.h */,
     
    20282034                                1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */,
    20292035                                8698B86910D44D9400D8D01B /* StringBuilder.h in Headers */,
     2036                                8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */,
    20302037                                14035DB110DBFB2A00FFFFE7 /* WeakGCPtr.h in Headers */,
    20312038                        );
     
    24732480                                A7C2217810C7479400F97913 /* JSZombie.cpp in Sources */,
    24742481                                655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */,
     2482                                8698BB3A10D86BAF00D8D01B /* UStringImpl.cpp in Sources */,
    24752483                        );
    24762484                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.