Title: [145500] trunk/Source/_javascript_Core
Revision
145500
Author
[email protected]
Date
2013-03-12 01:53:41 -0700 (Tue, 12 Mar 2013)

Log Message

REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
https://bugs.webkit.org/show_bug.cgi?id=112112

Reviewed by Oliver Hunt.

Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.

* runtime/JSStringJoiner.cpp:
(JSC::JSStringJoiner::build):
* runtime/JSStringJoiner.h:
(JSStringJoiner):
(JSC::JSStringJoiner::JSStringJoiner):
(JSC::JSStringJoiner::append):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (145499 => 145500)


--- trunk/Source/_javascript_Core/ChangeLog	2013-03-12 08:43:05 UTC (rev 145499)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-03-12 08:53:41 UTC (rev 145500)
@@ -1,3 +1,19 @@
+2013-03-12  Csaba Osztrogonác  <[email protected]>
+
+        REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
+        https://bugs.webkit.org/show_bug.cgi?id=112112
+
+        Reviewed by Oliver Hunt.
+
+        Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.
+
+        * runtime/JSStringJoiner.cpp:
+        (JSC::JSStringJoiner::build):
+        * runtime/JSStringJoiner.h:
+        (JSStringJoiner):
+        (JSC::JSStringJoiner::JSStringJoiner):
+        (JSC::JSStringJoiner::append):
+
 2013-03-12  Filip Pizlo  <[email protected]>
 
         DFG prediction propagation phase should not rerun forward propagation if double voting has already converged

Modified: trunk/Source/_javascript_Core/runtime/JSStringJoiner.cpp (145499 => 145500)


--- trunk/Source/_javascript_Core/runtime/JSStringJoiner.cpp	2013-03-12 08:43:05 UTC (rev 145499)
+++ trunk/Source/_javascript_Core/runtime/JSStringJoiner.cpp	2013-03-12 08:53:41 UTC (rev 145500)
@@ -102,24 +102,20 @@
     if (!m_strings.size())
         return jsEmptyString(exec);
 
-    Checked<size_t, RecordOverflow> separatorLength = m_separator.length();
+    size_t separatorLength = m_separator.length();
     // FIXME: add special cases of joinStrings() for (separatorLength == 0) and (separatorLength == 1).
     ASSERT(m_strings.size() > 0);
-    Checked<size_t, RecordOverflow> totalSeparactorsLength = separatorLength * (m_strings.size() - 1);
-    Checked<size_t, RecordOverflow> outputStringSize = totalSeparactorsLength + m_accumulatedStringsLength;
+    size_t totalSeparactorsLength = separatorLength * (m_strings.size() - 1);
+    size_t outputStringSize = totalSeparactorsLength + m_cumulatedStringsLength;
 
-    size_t finalSize;
-    if (outputStringSize.safeGet(finalSize))
-        return throwOutOfMemoryError(exec);
-        
     if (!outputStringSize)
         return jsEmptyString(exec);
 
     RefPtr<StringImpl> outputStringImpl;
     if (m_is8Bits)
-        outputStringImpl = joinStrings<LChar>(m_strings, m_separator, finalSize);
+        outputStringImpl = joinStrings<LChar>(m_strings, m_separator, outputStringSize);
     else
-        outputStringImpl = joinStrings<UChar>(m_strings, m_separator, finalSize);
+        outputStringImpl = joinStrings<UChar>(m_strings, m_separator, outputStringSize);
 
     if (!outputStringImpl)
         return throwOutOfMemoryError(exec);

Modified: trunk/Source/_javascript_Core/runtime/JSStringJoiner.h (145499 => 145500)


--- trunk/Source/_javascript_Core/runtime/JSStringJoiner.h	2013-03-12 08:43:05 UTC (rev 145499)
+++ trunk/Source/_javascript_Core/runtime/JSStringJoiner.h	2013-03-12 08:53:41 UTC (rev 145500)
@@ -46,13 +46,14 @@
     String m_separator;
     Vector<String> m_strings;
 
-    Checked<unsigned, RecordOverflow> m_accumulatedStringsLength;
+    unsigned m_cumulatedStringsLength;
     bool m_isValid;
     bool m_is8Bits;
 };
 
 inline JSStringJoiner::JSStringJoiner(const String& separator, size_t stringCount)
     : m_separator(separator)
+    , m_cumulatedStringsLength(0)
     , m_isValid(true)
     , m_is8Bits(m_separator.is8Bit())
 {
@@ -65,9 +66,9 @@
     if (!m_isValid)
         return;
 
-    m_strings.append(str);
+    m_strings.uncheckedAppend(str);
     if (!str.isNull()) {
-        m_accumulatedStringsLength += str.length();
+        m_cumulatedStringsLength += str.length();
         m_is8Bits = m_is8Bits && str.is8Bit();
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to