Ignore:
Timestamp:
Jan 20, 2015, 2:43:06 PM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r178751.
https://bugs.webkit.org/show_bug.cgi?id=140694

Caused 32-bit JSC test failures (Requested by JoePeck on
#webkit).

Reverted changeset:

"put_by_val_direct need to check the property is index or not
for using putDirect / putDirectIndex"
https://bugs.webkit.org/show_bug.cgi?id=140426
http://trac.webkit.org/changeset/178751

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/PropertyName.h

    r178751 r178756  
    2929#include "Identifier.h"
    3030#include "PrivateName.h"
    31 #include <wtf/Optional.h>
    3231
    3332namespace JSC {
    3433
    3534template <typename CharType>
    36 ALWAYS_INLINE Optional<uint32_t> toUInt32FromCharacters(const CharType* characters, unsigned length)
     35ALWAYS_INLINE uint32_t toUInt32FromCharacters(const CharType* characters, unsigned length)
    3736{
    3837    // An empty string is not a number.
    3938    if (!length)
    40         return Nullopt;
     39        return UINT_MAX;
    4140
    4241    // Get the first character, turning it into a digit.
    4342    uint32_t value = characters[0] - '0';
    4443    if (value > 9)
    45         return Nullopt;
     44        return UINT_MAX;
    4645   
    4746    // Check for leading zeros. If the first characher is 0, then the
    4847    // length of the string must be one - e.g. "042" is not equal to "42".
    4948    if (!value && length > 1)
    50         return Nullopt;
     49        return UINT_MAX;
    5150   
    5251    while (--length) {
    5352        // Multiply value by 10, checking for overflow out of 32 bits.
    5453        if (value > 0xFFFFFFFFU / 10)
    55             return Nullopt;
     54            return UINT_MAX;
    5655        value *= 10;
    5756       
     
    5958        uint32_t newValue = *(++characters) - '0';
    6059        if (newValue > 9)
    61             return Nullopt;
     60            return UINT_MAX;
    6261       
    6362        // Add in the old value, checking for overflow out of 32 bits.
    6463        newValue += value;
    6564        if (newValue < value)
    66             return Nullopt;
     65            return UINT_MAX;
    6766        value = newValue;
    6867    }
    69 
    70     if (value == UINT_MAX)
    71         return Nullopt;
     68   
    7269    return value;
    7370}
    7471
    75 ALWAYS_INLINE Optional<uint32_t> toUInt32FromStringImpl(StringImpl* impl)
     72ALWAYS_INLINE uint32_t toUInt32FromStringImpl(StringImpl* impl)
    7673{
    7774    if (impl->is8Bit())
     
    113110    static const uint32_t NotAnIndex = UINT_MAX;
    114111
    115     Optional<uint32_t> asIndex()
     112    uint32_t asIndex()
    116113    {
    117         return m_impl ? toUInt32FromStringImpl(m_impl) : Nullopt;
     114        return m_impl ? toUInt32FromStringImpl(m_impl) : NotAnIndex;
    118115    }
    119 
     116   
    120117    void dump(PrintStream& out) const
    121118    {
Note: See TracChangeset for help on using the changeset viewer.