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.
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):