Ignore:
Timestamp:
May 25, 2009, 9:21:32 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-05-25 David Levin <[email protected]>

Reviewed by Maciej Stachowiak and Oliver Hunt.

https://bugs.webkit.org/show_bug.cgi?id=25126
Allow the buffer underlying UString to be shared.

In order to not grow the underlying size of any structure,
there is a union in the Rep string which holds

+ m_sharedBuffer -- a pointer to the shared ref counted buffer

if the class is BaseString and the buffer is being shared OR

+ m_baseString -- the BaseString if the class is only UString::Rep

but not a UString::BaseString

Ideally, m_sharedBuffer would be a RefPtr, but it cannot be because
it is in a union.

No change in sunspider perf.

  • JavaScriptCore.vcproj/WTF/WTF.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/UString.cpp: (JSC::UString::Rep::share): (JSC::UString::Rep::destroy): (JSC::UString::BaseString::sharedBuffer): (JSC::UString::BaseString::setSharedBuffer): (JSC::UString::BaseString::slowIsBufferReadOnly): (JSC::expandCapacity): (JSC::UString::Rep::reserveCapacity): (JSC::UString::expandPreCapacity): (JSC::concatenate): (JSC::UString::append):
  • runtime/UString.h: (JSC::UString::Rep::Rep): (JSC::UString::Rep::): (JSC::UString::BaseString::isShared): (JSC::UString::BaseString::isBufferReadOnly): (JSC::UString::Rep::baseString):
  • wtf/CrossThreadRefCounted.h: (WTF::CrossThreadRefCounted::isShared):
  • wtf/OwnFastMallocPtr.h: Added. (WTF::OwnFastMallocPtr::OwnFastMallocPtr): (WTF::OwnFastMallocPtr::~OwnFastMallocPtr): (WTF::OwnFastMallocPtr::get): (WTF::OwnFastMallocPtr::release):

JavaScriptGlue:

2009-05-25 David Levin <[email protected]>

Reviewed by Maciej Stachowiak and Oliver Hunt.

https://bugs.webkit.org/show_bug.cgi?id=25126

Added forwarding headers.

  • ForwardingHeaders/wtf/CrossThreadRefCounted.h: Added.
  • ForwardingHeaders/wtf/OwnFastMallocPtr.h: Added.

WebCore:

2009-05-25 David Levin <[email protected]>

Reviewed by Maciej Stachowiak and Oliver Hunt.

Added forwarding headers.

  • ForwardingHeaders/wtf/CrossThreadRefCounted.h: Added.
  • ForwardingHeaders/wtf/OwnFastMallocPtr.h: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r44095 r44145  
    4343                0B330C270F38C62300692DE3 /* TypeTraits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B330C260F38C62300692DE3 /* TypeTraits.cpp */; };
    4444                0B4D7E630F319AC800AD7E58 /* TypeTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B4D7E620F319AC800AD7E58 /* TypeTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
     45                0BDFFAE00FC6192900D69EF4 /* CrossThreadRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */; settings = {ATTRIBUTES = (Private, ); }; };
     46                0BDFFAE10FC6193100D69EF4 /* OwnFastMallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4547                140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */; };
    4648                140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    456458                0B330C260F38C62300692DE3 /* TypeTraits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypeTraits.cpp; sourceTree = "<group>"; };
    457459                0B4D7E620F319AC800AD7E58 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; };
     460                0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnFastMallocPtr.h; sourceTree = "<group>"; };
     461                0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadRefCounted.h; sourceTree = "<group>"; };
    458462                140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasePrivate.h; sourceTree = "<group>"; };
    459463                141211020A48780900480255 /* minidom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = minidom.c; path = tests/minidom.c; sourceTree = "<group>"; };
     
    11621166                                A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */,
    11631167                                A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */,
     1168                                0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */,
    11641169                                180B9AEF0F16C569009BDBC5 /* CurrentTime.cpp */,
    11651170                                180B9AF00F16C569009BDBC5 /* CurrentTime.h */,
     
    11931198                                C0A2723F0E509F1E00E96E15 /* NotFound.h */,
    11941199                                9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */,
     1200                                0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */,
    11951201                                9303F567099118FA00AD71B8 /* OwnPtr.h */,
    11961202                                440B7AED0FAF7FCB0073323E /* OwnPtrCommon.h */,
     
    18301836                                93052C350FB792190048FDC3 /* ParserArena.h in Headers */,
    18311837                                960626960FB8EC02009798AB /* JITStubCall.h in Headers */,
     1838                                0BDFFAE00FC6192900D69EF4 /* CrossThreadRefCounted.h in Headers */,
     1839                                0BDFFAE10FC6193100D69EF4 /* OwnFastMallocPtr.h in Headers */,
    18321840                        );
    18331841                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.