Ignore:
Timestamp:
Dec 18, 2009, 2:59:18 PM (15 years ago)
Author:
[email protected]
Message:

Add createNonCopying method to UString to make replace constructor passed bool,
to make behaviour more explicit. Add createFromUTF8 to UString (wrapping method
on UString::Rep), since other cases of transliteration (e.g. from ascii) are
performed in UString constructors. Add/use setHash & size() accessors on Rep,
rather than accessing _hash/len directly.

Reviewed by Sam Weinig.

  • API/JSClassRef.cpp:

(OpaqueJSClass::OpaqueJSClass):

  • API/OpaqueJSString.cpp:

(OpaqueJSString::ustring):

(JSC::arrayProtoFuncToString):

  • runtime/Identifier.cpp:

(JSC::Identifier::equal):
(JSC::CStringTranslator::translate):
(JSC::UCharBufferTranslator::translate):
(JSC::Identifier::addSlowCase):

  • runtime/JSString.cpp:

(JSC::JSString::resolveRope):

  • runtime/JSString.h:

(JSC::JSString::Rope::Fiber::refAndGetLength):
(JSC::JSString::Rope::append):

  • runtime/StringBuilder.h:

(JSC::StringBuilder::release):

  • runtime/StringConstructor.cpp:

(JSC::stringFromCharCodeSlowCase):

  • runtime/StringPrototype.cpp:

(JSC::substituteBackreferencesSlow):
(JSC::stringProtoFuncToLowerCase):
(JSC::stringProtoFuncToUpperCase):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncLink):

  • runtime/UString.cpp:

(JSC::UString::UString):
(JSC::UString::createNonCopying):
(JSC::UString::createFromUTF8):

  • runtime/UString.h:

(JSC::UString::Rep::setHash):
(JSC::UString::~UString):
(JSC::makeString):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSClassRef.cpp

    r52334 r52346  
    5353    , hasInstance(definition->hasInstance)
    5454    , convertToType(definition->convertToType)
    55     , m_className(UString::Rep::createFromUTF8(definition->className))
     55    , m_className(UString::createFromUTF8(definition->className).rep()->ref())
    5656    , m_staticValues(0)
    5757    , m_staticFunctions(0)
     
    6262        m_staticValues = new OpaqueJSClassStaticValuesTable();
    6363        while (staticValue->name) {
    64             m_staticValues->add(UString::Rep::createFromUTF8(staticValue->name),
     64            m_staticValues->add(UString::createFromUTF8(staticValue->name).rep()->ref(),
    6565                              new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes));
    6666            ++staticValue;
     
    7171        m_staticFunctions = new OpaqueJSClassStaticFunctionsTable();
    7272        while (staticFunction->name) {
    73             m_staticFunctions->add(UString::Rep::createFromUTF8(staticFunction->name),
     73            m_staticFunctions->add(UString::createFromUTF8(staticFunction->name).rep()->ref(),
    7474                                 new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes));
    7575            ++staticFunction;
Note: See TracChangeset for help on using the changeset viewer.