Changeset 145500 in webkit


Ignore:
Timestamp:
Mar 12, 2013 1:53:41 AM (11 years ago)
Author:
Csaba Osztrogonác
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):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r145491 r145500  
     12013-03-12  Csaba Osztrogonác  <ossy@webkit.org>
     2
     3        REGRESSION(r145482): It broke 33 jsc tests and zillion layout tests on all platform
     4        https://bugs.webkit.org/show_bug.cgi?id=112112
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Rolling out https://trac.webkit.org/changeset/145482 to unbreak the bots.
     9
     10        * runtime/JSStringJoiner.cpp:
     11        (JSC::JSStringJoiner::build):
     12        * runtime/JSStringJoiner.h:
     13        (JSStringJoiner):
     14        (JSC::JSStringJoiner::JSStringJoiner):
     15        (JSC::JSStringJoiner::append):
     16
    1172013-03-12  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/JSStringJoiner.cpp

    r145482 r145500  
    103103        return jsEmptyString(exec);
    104104
    105     Checked<size_t, RecordOverflow> separatorLength = m_separator.length();
     105    size_t separatorLength = m_separator.length();
    106106    // FIXME: add special cases of joinStrings() for (separatorLength == 0) and (separatorLength == 1).
    107107    ASSERT(m_strings.size() > 0);
    108     Checked<size_t, RecordOverflow> totalSeparactorsLength = separatorLength * (m_strings.size() - 1);
    109     Checked<size_t, RecordOverflow> outputStringSize = totalSeparactorsLength + m_accumulatedStringsLength;
     108    size_t totalSeparactorsLength = separatorLength * (m_strings.size() - 1);
     109    size_t outputStringSize = totalSeparactorsLength + m_cumulatedStringsLength;
    110110
    111     size_t finalSize;
    112     if (outputStringSize.safeGet(finalSize))
    113         return throwOutOfMemoryError(exec);
    114        
    115111    if (!outputStringSize)
    116112        return jsEmptyString(exec);
     
    118114    RefPtr<StringImpl> outputStringImpl;
    119115    if (m_is8Bits)
    120         outputStringImpl = joinStrings<LChar>(m_strings, m_separator, finalSize);
     116        outputStringImpl = joinStrings<LChar>(m_strings, m_separator, outputStringSize);
    121117    else
    122         outputStringImpl = joinStrings<UChar>(m_strings, m_separator, finalSize);
     118        outputStringImpl = joinStrings<UChar>(m_strings, m_separator, outputStringSize);
    123119
    124120    if (!outputStringImpl)
  • trunk/Source/JavaScriptCore/runtime/JSStringJoiner.h

    r145482 r145500  
    4747    Vector<String> m_strings;
    4848
    49     Checked<unsigned, RecordOverflow> m_accumulatedStringsLength;
     49    unsigned m_cumulatedStringsLength;
    5050    bool m_isValid;
    5151    bool m_is8Bits;
     
    5454inline JSStringJoiner::JSStringJoiner(const String& separator, size_t stringCount)
    5555    : m_separator(separator)
     56    , m_cumulatedStringsLength(0)
    5657    , m_isValid(true)
    5758    , m_is8Bits(m_separator.is8Bit())
     
    6667        return;
    6768
    68     m_strings.append(str);
     69    m_strings.uncheckedAppend(str);
    6970    if (!str.isNull()) {
    70         m_accumulatedStringsLength += str.length();
     71        m_cumulatedStringsLength += str.length();
    7172        m_is8Bits = m_is8Bits && str.is8Bit();
    7273    }
Note: See TracChangeset for help on using the changeset viewer.