summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/wtf/text/StringImpl.cpp
diff options
context:
space:
mode:
authorNaiem Shaik <snaiem@codeaurora.org>2012-07-19 10:45:56 -0700
committerSteve Kondik <shade@chemlab.org>2013-01-20 18:38:33 -0800
commit0f5d4355d7a384679722338d55f65bbb92350cfc (patch)
treedf4a638aa4e81152ee68f0d523ed706128a251ff /Source/JavaScriptCore/wtf/text/StringImpl.cpp
parent8f6cf525ead3381029545c1d292c8586ec45ddb0 (diff)
downloadexternal_webkit-0f5d4355d7a384679722338d55f65bbb92350cfc.zip
external_webkit-0f5d4355d7a384679722338d55f65bbb92350cfc.tar.gz
external_webkit-0f5d4355d7a384679722338d55f65bbb92350cfc.tar.bz2
DOM Optimizations
DOM traversal optimizations DOM Core optimizations Prefetch optimization for DOM Tree Traversal Conflicts: Source/WebKit/android/jni/WebViewCore.cpp Change-Id: Icbb8a7229ee9cff1a5401b57c8181f18b9a6d6e0
Diffstat (limited to 'Source/JavaScriptCore/wtf/text/StringImpl.cpp')
-rw-r--r--Source/JavaScriptCore/wtf/text/StringImpl.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/wtf/text/StringImpl.cpp b/Source/JavaScriptCore/wtf/text/StringImpl.cpp
index 9afd1d2..826e749 100644
--- a/Source/JavaScriptCore/wtf/text/StringImpl.cpp
+++ b/Source/JavaScriptCore/wtf/text/StringImpl.cpp
@@ -148,7 +148,7 @@ SharedUChar* StringImpl::sharedBuffer()
if (ownership == BufferOwned) {
ASSERT(!m_sharedBuffer);
m_sharedBuffer = SharedUChar::create(new SharableUChar(m_data)).leakRef();
- m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared;
+ m_bufferOwnership = BufferShared;
}
ASSERT(bufferOwnership() == BufferShared);
@@ -193,6 +193,8 @@ PassRefPtr<StringImpl> StringImpl::lower()
{
// Note: This is a hot function in the Dromaeo benchmark, specifically the
// no-op code path up through the first 'return' statement.
+ if (isLower())
+ return this;
// First scan the string for uppercase and non-ASCII characters:
UChar ored = 0;
@@ -205,8 +207,10 @@ PassRefPtr<StringImpl> StringImpl::lower()
}
// Nothing to do if the string is all ASCII with no uppercase.
- if (noUpper && !(ored & ~0x7F))
+ if (noUpper && !(ored & ~0x7F)) {
+ setIsLower(true);
return this;
+ }
if (m_length > static_cast<unsigned>(numeric_limits<int32_t>::max()))
CRASH();
@@ -1060,7 +1064,7 @@ PassRefPtr<StringImpl> StringImpl::createWithTerminatingNullCharacter(const Stri
data[length] = 0;
terminatedString->m_length--;
terminatedString->m_hash = string.m_hash;
- terminatedString->m_refCountAndFlags |= s_refCountFlagHasTerminatingNullCharacter;
+ terminatedString->m_hasTerminatingNullCharacter = true;
return terminatedString.release();
}