Ignore:
Timestamp:
Apr 21, 2010, 12:13:50 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.

Reviewed by Oliver Hunt, Darin Adler.

JSC::UStringImpl and WebCore::StringImpl (soon to be renamed to
WTF::StringImpl) are almost identical. Remove duplication of code by unifying
the two, move missing features from UStringImpl into StringImpl & delete the
class UStringImpl.

  • API/JSClassRef.cpp:
  • API/JSContextRef.cpp:
  • GNUmakefile.am:
  • JavaScriptCore.exp:
  • JavaScriptCore.pro:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/EvalCodeCache.h:
  • bytecode/JumpTable.cpp:
  • profiler/ProfileNode.cpp:
  • runtime/Identifier.cpp:

(JSC::Identifier::add):

  • runtime/Identifier.h:

(JSC::Identifier::equal):

  • runtime/UString.cpp:
  • runtime/UString.h:

(WTF::):

  • runtime/UStringImpl.cpp: Removed.
  • runtime/UStringImpl.h:
  • wtf/text/StringHash.h:

(WebCore::StringHash::equal):
(WebCore::CaseFoldingHash::equal):

  • wtf/text/StringImpl.cpp:

(WebCore::StringImpl::~StringImpl):
(WebCore::StringImpl::empty):
(WebCore::StringImpl::sharedBuffer):
(WebCore::equal):

  • wtf/text/StringImpl.h:

(WebCore::StringImpl::StringImpl):
(WebCore::StringImpl::create):
(WebCore::StringImpl::tryCreateUninitialized):
(WebCore::StringImpl::cost):
(WebCore::StringImpl::isIdentifier):
(WebCore::StringImpl::setIsIdentifier):
(WebCore::StringImpl::computeHash):
(WebCore::StringImpl::copyChars):
(WebCore::StringImpl::):

JavaScriptGlue: Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
Add forwarding header.

Reviewed by Oliver Hunt, Darin Adler.

  • ForwardingHeaders/wtf/ASCIICType.h: Added.
  • ForwardingHeaders/wtf/text/StringImpl.h: Added.

WebCore: Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
Add include for StringHash.h.

Reviewed by Oliver Hunt, Darin Adler.

  • WebCore.xcodeproj/project.pbxproj:
  • bridge/c/c_class.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Identifier.cpp

    r57879 r58001  
    3030#include <wtf/HashSet.h>
    3131#include <wtf/WTFThreadData.h>
     32#include <wtf/text/StringHash.h>
    3233
    3334using WTF::ThreadSpecific;
     
    101102}
    102103
    103 struct CStringTranslator {
     104struct IdentifierCStringTranslator {
    104105    static unsigned hash(const char* c)
    105106    {
     
    140141        return iter->second;
    141142
    142     pair<HashSet<UString::Rep*>::iterator, bool> addResult = identifierTable.add<const char*, CStringTranslator>(c);
     143    pair<HashSet<UString::Rep*>::iterator, bool> addResult = identifierTable.add<const char*, IdentifierCStringTranslator>(c);
    143144
    144145    // If the string is newly-translated, then we need to adopt it.
     
    161162};
    162163
    163 struct UCharBufferTranslator {
     164struct IdentifierUCharBufferTranslator {
    164165    static unsigned hash(const UCharBuffer& buf)
    165166    {
     
    193194        return UString::Rep::empty();
    194195    UCharBuffer buf = {s, length};
    195     pair<HashSet<UString::Rep*>::iterator, bool> addResult = globalData->identifierTable->add<UCharBuffer, UCharBufferTranslator>(buf);
     196    pair<HashSet<UString::Rep*>::iterator, bool> addResult = globalData->identifierTable->add<UCharBuffer, IdentifierUCharBufferTranslator>(buf);
    196197
    197198    // If the string is newly-translated, then we need to adopt it.
Note: See TracChangeset for help on using the changeset viewer.