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/JavaScriptCore.xcodeproj/project.pbxproj

    r57925 r57932  
    217217                86B99AB8117E391E00DF5A90 /* RopeImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */; };
    218218                86B99AB9117E391E00DF5A90 /* RopeImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AB7117E391E00DF5A90 /* RopeImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
     219                86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE1117E578100DF5A90 /* StringBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
     220                86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE2117E578100DF5A90 /* StringImplBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
    219221                86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; };
    220222                86CA032E1038E8440028A609 /* Executable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CA032D1038E8440028A609 /* Executable.cpp */; };
     
    758760                86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RopeImpl.cpp; sourceTree = "<group>"; };
    759761                86B99AB7117E391E00DF5A90 /* RopeImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RopeImpl.h; sourceTree = "<group>"; };
     762                86B99AE1117E578100DF5A90 /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = text/StringBuffer.h; sourceTree = "<group>"; };
     763                86B99AE2117E578100DF5A90 /* StringImplBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringImplBase.h; path = text/StringImplBase.h; sourceTree = "<group>"; };
    760764                86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssembler.h; sourceTree = "<group>"; };
    761765                86CA032D1038E8440028A609 /* Executable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Executable.cpp; sourceTree = "<group>"; };
     
    16781682                                86565740115BE3DA00291F40 /* CString.cpp */,
    16791683                                86565741115BE3DA00291F40 /* CString.h */,
     1684                                86B99AE1117E578100DF5A90 /* StringBuffer.h */,
    16801685                                868BFA05117CEFD100B908B1 /* StringHash.h */,
    16811686                                868BFA06117CEFD100B908B1 /* StringImpl.cpp */,
    16821687                                868BFA07117CEFD100B908B1 /* StringImpl.h */,
     1688                                86B99AE2117E578100DF5A90 /* StringImplBase.h */,
    16831689                                868BFA15117CF19900B908B1 /* WTFString.cpp */,
    16841690                                868BFA16117CF19900B908B1 /* WTFString.h */,
     
    20852091                                868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */,
    20862092                                86B99AB9117E391E00DF5A90 /* RopeImpl.h in Headers */,
     2093                                86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */,
     2094                                86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */,
    20872095                        );
    20882096                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.