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/JSObject.cpp

    r178751 r178756  
    340340    // Try indexed put first. This is required for correctness, since loads on property names that appear like
    341341    // valid indices will never look in the named property storage.
    342     if (Optional<uint32_t> index = propertyName.asIndex()) {
    343         putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode());
     342    unsigned i = propertyName.asIndex();
     343    if (i != PropertyName::NotAnIndex) {
     344        putByIndex(thisObject, exec, i, value, slot.isStrictMode());
    344345        return;
    345346    }
     
    11981199    ASSERT(value.isGetterSetter() && (attributes & Accessor));
    11991200
    1200     if (Optional<uint32_t> index = propertyName.asIndex()) {
    1201         putDirectIndex(exec, index.value(), value, attributes, PutDirectIndexLikePutDirect);
     1201    unsigned index = propertyName.asIndex();
     1202    if (index != PropertyName::NotAnIndex) {
     1203        putDirectIndex(exec, index, value, attributes, PutDirectIndexLikePutDirect);
    12021204        return;
    12031205    }
     
    12081210void JSObject::putDirectCustomAccessor(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes)
    12091211{
    1210     ASSERT(!propertyName.asIndex());
     1212    ASSERT(propertyName.asIndex() == PropertyName::NotAnIndex);
    12111213
    12121214    PutPropertySlot slot(this);
     
    12561258    JSObject* thisObject = jsCast<JSObject*>(cell);
    12571259   
    1258     if (Optional<uint32_t> index = propertyName.asIndex())
    1259         return thisObject->methodTable(exec->vm())->deletePropertyByIndex(thisObject, exec, index.value());
     1260    unsigned i = propertyName.asIndex();
     1261    if (i != PropertyName::NotAnIndex)
     1262        return thisObject->methodTable(exec->vm())->deletePropertyByIndex(thisObject, exec, i);
    12601263
    12611264    if (!thisObject->staticFunctionsReified())
     
    25002503void JSObject::putDirectMayBeIndex(ExecState* exec, PropertyName propertyName, JSValue value)
    25012504{
    2502     if (Optional<uint32_t> index = propertyName.asIndex())
    2503         putDirectIndex(exec, index.value(), value);
     2505    unsigned asIndex = propertyName.asIndex();
     2506    if (asIndex == PropertyName::NotAnIndex)
     2507        putDirect(exec->vm(), propertyName, value);
    25042508    else
    2505         putDirect(exec->vm(), propertyName, value);
     2509        putDirectIndex(exec, asIndex, value);
    25062510}
    25072511
     
    26562660{
    26572661    // If it's an array index, then use the indexed property storage.
    2658     if (Optional<uint32_t> index = propertyName.asIndex()) {
     2662    unsigned index = propertyName.asIndex();
     2663    if (index != PropertyName::NotAnIndex) {
    26592664        // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments.
    26602665        // d. Reject if succeeded is false.
     
    26632668        // e.ii. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", oldLenDesc, and false as arguments. This call will always return true.
    26642669        // f. Return true.
    2665         return object->defineOwnIndexedProperty(exec, index.value(), descriptor, throwException);
     2670        return object->defineOwnIndexedProperty(exec, index, descriptor, throwException);
    26662671    }
    26672672   
Note: See TracChangeset for help on using the changeset viewer.