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/jit/JITOperations.cpp

    r178894 r178928  
    5252#include "LegacyProfiler.h"
    5353#include "ObjectConstructor.h"
    54 #include "PropertyName.h"
    5554#include "Repatch.h"
    5655#include "RepatchBuffer.h"
     
    482481static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue subscript, JSValue value)
    483482{
    484     bool isStrictMode = callFrame->codeBlock()->isStrictMode();
    485483    if (LIKELY(subscript.isUInt32())) {
    486         uint32_t index = subscript.asUInt32();
    487         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.");
    488         baseObject->putDirectIndex(callFrame, index, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
    489         return;
    490     }
    491 
    492     if (subscript.isDouble()) {
    493         double subscriptAsDouble = subscript.asDouble();
    494         uint32_t subscriptAsUInt32 = static_cast<uint32_t>(subscriptAsDouble);
    495         if (subscriptAsDouble == subscriptAsUInt32 && subscriptAsUInt32 != PropertyName::NotAnIndex) {
    496             baseObject->putDirectIndex(callFrame, subscriptAsUInt32, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
    497             return;
    498         }
    499     }
    500 
    501     if (isName(subscript)) {
    502         PutPropertySlot slot(baseObject, isStrictMode);
     484        uint32_t i = subscript.asUInt32();
     485        baseObject->putDirectIndex(callFrame, i, value);
     486    } else if (isName(subscript)) {
     487        PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode());
    503488        baseObject->putDirect(callFrame->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot);
    504         return;
    505     }
    506 
    507     // Don't put to an object if toString throws an exception.
    508     Identifier property = subscript.toString(callFrame)->toIdentifier(callFrame);
    509     if (callFrame->vm().exception())
    510         return;
    511 
    512     PropertyName propertyName(property);
    513     if (Optional<uint32_t> index = propertyName.asIndex())
    514         baseObject->putDirectIndex(callFrame, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
    515     else {
    516         PutPropertySlot slot(baseObject, isStrictMode);
    517         baseObject->putDirect(callFrame->vm(), propertyName, value, slot);
     489    } else {
     490        Identifier property = subscript.toString(callFrame)->toIdentifier(callFrame);
     491        if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception.
     492            PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode());
     493            baseObject->putDirect(callFrame->vm(), property, value, slot);
     494        }
    518495    }
    519496}
Note: See TracChangeset for help on using the changeset viewer.