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/runtime/JSString.h

    r52082 r52346  
    9797                    if (isString()) {
    9898                        UString::Rep* rep = string();
    99                         return rep->ref()->len;
     99                        return rep->ref()->size();
    100100                    } else {
    101101                        Rope* r = rope();
     
    136136                UString::Rep* rep = string.rep();
    137137                m_fibers[index++] = Fiber(rep);
    138                 m_stringLength += rep->ref()->len;
     138                m_stringLength += rep->ref()->size();
    139139            }
    140140            void append(unsigned& index, JSString* jsString)
Note: See TracChangeset for help on using the changeset viewer.