Ignore:
Timestamp:
Jan 22, 2015, 11:34:34 AM (10 years ago)
Author:
[email protected]
Message:

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

Broke JSC and bindings tests (Requested by ap_ 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/178894

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r178894 r178928  
    9898
    9999    if (LIKELY(property.isUInt32())) {
    100         uint32_t index = property.asUInt32();
    101         ASSERT_WITH_MESSAGE(index != PropertyName::NotAnIndex, "Since JSValue::isUInt32 returns true only when the boxed value is int32_t and positive, it doesn't return true for uint32_t max value that is PropertyName::NotAnIndex.");
    102         putByVal<strict, direct>(exec, baseValue, index, value);
     100        putByVal<strict, direct>(exec, baseValue, property.asUInt32(), value);
    103101        return;
    104102    }
     
    107105        double propertyAsDouble = property.asDouble();
    108106        uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble);
    109         if (propertyAsDouble == propertyAsUInt32 && propertyAsUInt32 != PropertyName::NotAnIndex) {
     107        if (propertyAsDouble == propertyAsUInt32) {
    110108            putByVal<strict, direct>(exec, baseValue, propertyAsUInt32, value);
    111109            return;
     
    125123    // Don't put to an object if toString throws an exception.
    126124    Identifier ident = property.toString(exec)->toIdentifier(exec);
    127     if (vm->exception())
    128         return;
    129 
    130     PutPropertySlot slot(baseValue, strict);
    131     if (direct) {
    132         PropertyName propertyName(ident);
    133         RELEASE_ASSERT(baseValue.isObject());
    134         if (Optional<uint32_t> index = propertyName.asIndex())
    135             asObject(baseValue)->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
    136         else
    137             asObject(baseValue)->putDirect(*vm, propertyName, value, slot);
    138     } else
    139         baseValue.put(exec, ident, value, slot);
     125    if (!vm->exception()) {
     126        PutPropertySlot slot(baseValue, strict);
     127        if (direct) {
     128            RELEASE_ASSERT(baseValue.isObject());
     129            asObject(baseValue)->putDirect(*vm, ident, value, slot);
     130        } else
     131            baseValue.put(exec, ident, value, slot);
     132    }
    140133}
    141134
Note: See TracChangeset for help on using the changeset viewer.