Ignore:
Timestamp:
Apr 20, 2010, 3:34:52 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Bug 37895 - Share common code from UStringImplBase with StringImpl

Reviewed by Oliver Hunt.

The implementation of StringImpl & UStringImpl is very similar. Restructure
StringImpl to match UStringImpl, moving the flags and length into a base class,
so that this can be shared between both string types to increase code reuse.

(JSC::RopeImpl::RopeImpl):

  • runtime/UStringImpl.h:

(JSC::UStringImpl::UStringImpl):

  • wtf/text/StringImpl.h:

(WebCore::StringImpl::StringImpl):
(WebCore::StringImpl::characters):

  • wtf/text/StringImplBase.h: Copied from JavaScriptCore/runtime/UStringImpl.h.

(WTF::StringImplBase::length):
(WTF::StringImplBase::operator new):
(WTF::StringImplBase::StringImplBase):

JavaScriptGlue: Bug 37895 - Share common code from UStringImplBase with StringImpl
Add forwarding header.

Reviewed by Oliver Hunt.

  • ForwardingHeaders/wtf/text/StringImplBase.h: Added.

WebCore: Bug 37895 - Share common code from UStringImplBase with StringImpl
Add forwarding header.

Reviewed by Oliver Hunt.

  • ForwardingHeaders/wtf/text/StringImplBase.h: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/RopeImpl.h

    r57912 r57932  
    3131namespace JSC {
    3232
    33 class RopeImpl : public UStringImplBase {
     33class RopeImpl : public StringImplBase {
    3434public:
    3535    // A RopeImpl is composed from a set of smaller strings called Fibers.
    3636    // Each Fiber in a rope is either UStringImpl or another RopeImpl.
    37     typedef UStringImplBase* Fiber;
     37    typedef StringImplBase* Fiber;
    3838
    3939    // Creates a RopeImpl comprising of 'fiberCount' Fibers.
     
    7373
    7474private:
    75     RopeImpl(unsigned fiberCount) : UStringImplBase(ConstructNonStringImpl), m_fiberCount(fiberCount) {}
     75    RopeImpl(unsigned fiberCount) : StringImplBase(ConstructNonStringImpl), m_fiberCount(fiberCount) {}
    7676
    7777    void destructNonRecursive();
Note: See TracChangeset for help on using the changeset viewer.