Ignore:
Timestamp:
Jun 12, 2009, 5:41:03 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-06-12 David Levin <[email protected]>

Reviewed by Darin Adler.

UString shouldn't create sharedBuffer for SmallStrings.
https://bugs.webkit.org/show_bug.cgi?id=26360

The methods changed are not used by JSC, so there is no JS perf impact. However,
there is a potential DOM perf impact, so I re-ran several of the tests that
I ran previously and ensured that the perf stay the same which caused me to
adjust the minLengthToShare.

  • JavaScriptCore.exp:
  • runtime/UString.cpp: (JSC::UString::Rep::sharedBuffer):

Determines if the buffer being shared is big enough before doing so.
Previously, BaseString::sharedBuffer was called but it would only know
the length of the base string (BaseString::len) which may not be the same
as the string being shared (Rep::len).

(JSC::UString::BaseString::sharedBuffer):

This is now only be used by Rep::sharedBuffer. which does the length check.

  • runtime/UString.h:

WebCore:

2009-06-12 David Levin <[email protected]>

Reviewed by Darin Adler.

UString shouldn't create sharedBuffer for SmallStrings.
https://bugs.webkit.org/show_bug.cgi?id=26347

Change the call to use the method UString::Rep::sharedBuffer due
to changes in UString.

No noticable change in behavior, so no test.

  • platform/text/StringImpl.cpp: (WebCore::StringImpl::create):
File:
1 edited

Legend:

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

    r44325 r44641  
    108108            static PassRefPtr<Rep> create(UChar*, int, PassRefPtr<SharedUChar>);
    109109
     110            SharedUChar* sharedBuffer();
    110111            void destroy();
    111112
     
    193194            bool isShared() { return rc != 1 || isBufferReadOnly(); }
    194195            void setSharedBuffer(PassRefPtr<SharedUChar>);
    195             SharedUChar* sharedBuffer();
    196196
    197197            bool isBufferReadOnly()
     
    225225            }
    226226
     227            SharedUChar* sharedBuffer();
    227228            bool slowIsBufferReadOnly();
    228229
Note: See TracChangeset for help on using the changeset viewer.