<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163410] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163410">163410</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-02-04 15:40:42 -0800 (Tue, 04 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename the substring sharing StringImpl::create variants to better indicate what they do
https://bugs.webkit.org/show_bug.cgi?id=128214
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
* runtime/JSString.h:
(JSC::jsSingleCharacterSubstring):
(JSC::jsSubstring8):
(JSC::jsSubstring):
* runtime/SmallStrings.cpp:
(JSC::SmallStringsStorage::SmallStringsStorage):
* runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstrings):
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::replaceUsingStringSearch):
Source/WTF:
* wtf/text/AtomicString.cpp:
(WTF::SubstringTranslator::translate):
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::reifyString):
(WTF::StringBuilder::resize):
* wtf/text/StringImpl.h:
(WTF::StringImpl::createSubstringSharingImpl8):
(WTF::StringImpl::createSubstringSharingImpl):
* wtf/text/WTFString.cpp:
(WTF::String::substringSharingImpl):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringh">trunk/Source/JavaScriptCore/runtime/JSString.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSmallStringscpp">trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringPrototypecpp">trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextAtomicStringcpp">trunk/Source/WTF/wtf/text/AtomicString.cpp</a></li>
<li><a href="#trunkSourceWTFwtftextStringBuildercpp">trunk/Source/WTF/wtf/text/StringBuilder.cpp</a></li>
<li><a href="#trunkSourceWTFwtftextStringImplh">trunk/Source/WTF/wtf/text/StringImpl.h</a></li>
<li><a href="#trunkSourceWTFwtftextWTFStringcpp">trunk/Source/WTF/wtf/text/WTFString.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2014-02-04 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><ins>+ Rename the substring sharing StringImpl::create variants to better indicate what they do
+ https://bugs.webkit.org/show_bug.cgi?id=128214
+
+ Reviewed by Geoffrey Garen.
+
+ * runtime/JSString.h:
+ (JSC::jsSingleCharacterSubstring):
+ (JSC::jsSubstring8):
+ (JSC::jsSubstring):
+ * runtime/SmallStrings.cpp:
+ (JSC::SmallStringsStorage::SmallStringsStorage):
+ * runtime/StringPrototype.cpp:
+ (JSC::jsSpliceSubstrings):
+ (JSC::jsSpliceSubstringsWithSeparators):
+ (JSC::replaceUsingStringSearch):
+
+2014-02-04 Anders Carlsson <andersca@apple.com>
+
</ins><span class="cx"> Rename StringImpl::getCharacters to StringImpl::characters
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=128205
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.h (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.h        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/JavaScriptCore/runtime/JSString.h        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -360,7 +360,7 @@
</span><span class="cx"> UChar c = s.characterAt(offset);
</span><span class="cx"> if (c <= maxSingleCharacterString)
</span><span class="cx"> return vm->smallStrings.singleCharacterString(c);
</span><del>- return JSString::create(*vm, StringImpl::create(s.impl(), offset, 1));
</del><ins>+ return JSString::create(*vm, StringImpl::createSubstringSharingImpl(s.impl(), offset, 1));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline JSString* jsNontrivialString(VM* vm, const String& s)
</span><span class="lines">@@ -428,7 +428,7 @@
</span><span class="cx"> if (c <= maxSingleCharacterString)
</span><span class="cx"> return vm->smallStrings.singleCharacterString(c);
</span><span class="cx"> }
</span><del>- return JSString::createHasOtherOwner(*vm, StringImpl::create8(s.impl(), offset, length));
</del><ins>+ return JSString::createHasOtherOwner(*vm, StringImpl::createSubstringSharingImpl8(s.impl(), offset, length));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline JSString* jsSubstring(VM* vm, const String& s, unsigned offset, unsigned length)
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx"> if (c <= maxSingleCharacterString)
</span><span class="cx"> return vm->smallStrings.singleCharacterString(c);
</span><span class="cx"> }
</span><del>- return JSString::createHasOtherOwner(*vm, StringImpl::create(s.impl(), offset, length));
</del><ins>+ return JSString::createHasOtherOwner(*vm, StringImpl::createSubstringSharingImpl(s.impl(), offset, length));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline JSString* jsOwnedString(VM* vm, const String& s)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSmallStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> RefPtr<StringImpl> baseString = StringImpl::createUninitialized(singleCharacterStringCount, characterBuffer);
</span><span class="cx"> for (unsigned i = 0; i < singleCharacterStringCount; ++i) {
</span><span class="cx"> characterBuffer[i] = i;
</span><del>- m_reps[i] = StringImpl::create(baseString, i, 1);
</del><ins>+ m_reps[i] = StringImpl::createSubstringSharingImpl(baseString, i, 1);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx"> if (position <= 0 && length >= sourceSize)
</span><span class="cx"> return sourceVal;
</span><span class="cx"> // We could call String::substringSharingImpl(), but this would result in redundant checks.
</span><del>- return jsString(exec, StringImpl::create(source.impl(), std::max(0, position), std::min(sourceSize, length)));
</del><ins>+ return jsString(exec, StringImpl::createSubstringSharingImpl(source.impl(), std::max(0, position), std::min(sourceSize, length)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> int totalLength = 0;
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx"> if (position <= 0 && length >= sourceSize)
</span><span class="cx"> return sourceVal;
</span><span class="cx"> // We could call String::substringSharingImpl(), but this would result in redundant checks.
</span><del>- return jsString(exec, StringImpl::create(source.impl(), std::max(0, position), std::min(sourceSize, length)));
</del><ins>+ return jsString(exec, StringImpl::createSubstringSharingImpl(source.impl(), std::max(0, position), std::min(sourceSize, length)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Checked<int, RecordOverflow> totalLength = 0;
</span><span class="lines">@@ -650,14 +650,14 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> StringImpl* stringImpl = string.impl();
</span><del>- String leftPart(StringImpl::create(stringImpl, 0, matchStart));
</del><ins>+ String leftPart(StringImpl::createSubstringSharingImpl(stringImpl, 0, matchStart));
</ins><span class="cx">
</span><span class="cx"> size_t matchEnd = matchStart + searchString.impl()->length();
</span><span class="cx"> int ovector[2] = { static_cast<int>(matchStart), static_cast<int>(matchEnd)};
</span><span class="cx"> String middlePart = substituteBackreferences(replaceString, string, ovector, 0);
</span><span class="cx">
</span><span class="cx"> size_t leftLength = stringImpl->length() - matchEnd;
</span><del>- String rightPart(StringImpl::create(stringImpl, matchEnd, leftLength));
</del><ins>+ String rightPart(StringImpl::createSubstringSharingImpl(stringImpl, matchEnd, leftLength));
</ins><span class="cx"> return JSValue::encode(JSC::jsString(exec, leftPart, middlePart, rightPart));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/WTF/ChangeLog        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-02-04 Anders Carlsson <andersca@apple.com>
+
+ Rename the substring sharing StringImpl::create variants to better indicate what they do
+ https://bugs.webkit.org/show_bug.cgi?id=128214
+
+ Reviewed by Geoffrey Garen.
+
+ * wtf/text/AtomicString.cpp:
+ (WTF::SubstringTranslator::translate):
+ * wtf/text/StringBuilder.cpp:
+ (WTF::StringBuilder::reifyString):
+ (WTF::StringBuilder::resize):
+ * wtf/text/StringImpl.h:
+ (WTF::StringImpl::createSubstringSharingImpl8):
+ (WTF::StringImpl::createSubstringSharingImpl):
+ * wtf/text/WTFString.cpp:
+ (WTF::String::substringSharingImpl):
+
</ins><span class="cx"> 2014-02-04 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> WebCrypto HMAC verification uses a non-constant-time memcmp
</span></span></pre></div>
<a id="trunkSourceWTFwtftextAtomicStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/AtomicString.cpp (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/AtomicString.cpp        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/WTF/wtf/text/AtomicString.cpp        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx">
</span><span class="cx"> static void translate(StringImpl*& location, const SubstringLocation& buffer, unsigned hash)
</span><span class="cx"> {
</span><del>- location = &StringImpl::create(buffer.baseString, buffer.start, buffer.length).leakRef();
</del><ins>+ location = &StringImpl::createSubstringSharingImpl(buffer.baseString, buffer.start, buffer.length).leakRef();
</ins><span class="cx"> location->setHash(hash);
</span><span class="cx"> location->setIsAtomic(true);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringBuilder.cpp (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringBuilder.cpp        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/WTF/wtf/text/StringBuilder.cpp        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> if (m_length == m_buffer->length())
</span><span class="cx"> m_string = m_buffer.get();
</span><span class="cx"> else
</span><del>- m_string = StringImpl::create(m_buffer, 0, m_length);
</del><ins>+ m_string = StringImpl::createSubstringSharingImpl(m_buffer, 0, m_length);
</ins><span class="cx">
</span><span class="cx"> if (m_buffer->has16BitShadow() && m_valid16BitShadowLength < m_length)
</span><span class="cx"> m_buffer->upconvertCharacters(m_valid16BitShadowLength, m_length);
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> ASSERT(m_length == m_string.length());
</span><span class="cx"> ASSERT(newSize < m_string.length());
</span><span class="cx"> m_length = newSize;
</span><del>- m_string = StringImpl::create(m_string.impl(), 0, newSize);
</del><ins>+ m_string = StringImpl::createSubstringSharingImpl(m_string.impl(), 0, newSize);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Allocate a new 8 bit buffer, copying in currentCharacters (these may come from either m_string
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringImpl.h (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringImpl.h        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/WTF/wtf/text/StringImpl.h        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -342,7 +342,7 @@
</span><span class="cx"> WTF_EXPORT_STRING_API static PassRef<StringImpl> create(const LChar*);
</span><span class="cx"> ALWAYS_INLINE static PassRef<StringImpl> create(const char* s) { return create(reinterpret_cast<const LChar*>(s)); }
</span><span class="cx">
</span><del>- static ALWAYS_INLINE PassRef<StringImpl> create8(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
</del><ins>+ static ALWAYS_INLINE PassRef<StringImpl> createSubstringSharingImpl8(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(rep);
</span><span class="cx"> ASSERT(length <= rep->length());
</span><span class="lines">@@ -355,7 +355,7 @@
</span><span class="cx"> return adoptRef(*new StringImpl(rep->m_data8 + offset, length, ownerRep));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static ALWAYS_INLINE PassRef<StringImpl> create(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
</del><ins>+ static ALWAYS_INLINE PassRef<StringImpl> createSubstringSharingImpl(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(rep);
</span><span class="cx"> ASSERT(length <= rep->length());
</span></span></pre></div>
<a id="trunkSourceWTFwtftextWTFStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (163409 => 163410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/WTFString.cpp        2014-02-04 23:33:55 UTC (rev 163409)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp        2014-02-04 23:40:42 UTC (rev 163410)
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx">
</span><span class="cx"> if (!offset && length == stringLength)
</span><span class="cx"> return *this;
</span><del>- return String(StringImpl::create(m_impl, offset, length));
</del><ins>+ return String(StringImpl::createSubstringSharingImpl(m_impl, offset, length));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String String::lower() const
</span></span></pre>
</div>
</div>
</body>
</html>