Ignore:
Timestamp:
Sep 29, 2017, 11:49:37 AM (8 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r222563, r222565, and r222581.
https://bugs.webkit.org/show_bug.cgi?id=177675

"It causes a crash when playing youtube videos" (Requested by
saamyjoon on #webkit).

Reverted changesets:

"[DFG] Support ArrayPush with multiple args"
https://bugs.webkit.org/show_bug.cgi?id=175823
http://trac.webkit.org/changeset/222563

"Unreviewed, build fix after r222563"
https://bugs.webkit.org/show_bug.cgi?id=175823
http://trac.webkit.org/changeset/222565

"Unreviewed, fix x86 breaking due to exhausted registers"
https://bugs.webkit.org/show_bug.cgi?id=175823
http://trac.webkit.org/changeset/222581

File:
1 edited

Legend:

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

    r222563 r222658  
    870870    NativeCallFrameTracer tracer(vm, exec);
    871871   
    872     array->pushInline(exec, JSValue::decode(encodedValue));
     872    array->push(exec, JSValue::decode(encodedValue));
    873873    return JSValue::encode(jsNumber(array->length()));
    874874}
     
    879879    NativeCallFrameTracer tracer(vm, exec);
    880880   
    881     array->pushInline(exec, JSValue(JSValue::EncodeAsDouble, value));
    882     return JSValue::encode(jsNumber(array->length()));
    883 }
    884 
    885 EncodedJSValue JIT_OPERATION operationArrayPushMultiple(ExecState* exec, JSArray* array, void* buffer, int32_t elementCount)
    886 {
    887     VM& vm = exec->vm();
    888     NativeCallFrameTracer tracer(&vm, exec);
    889     auto scope = DECLARE_THROW_SCOPE(vm);
    890 
    891     // We assume that multiple JSArray::push calls with ArrayWithInt32/ArrayWithContiguous do not cause JS traps.
    892     // If it can cause any JS interactions, we can call the caller JS function of this function and overwrite the
    893     // content of ScratchBuffer. If the IndexingType is now ArrayWithInt32/ArrayWithContiguous, we can ensure
    894     // that there is no indexed accessors in this object and its prototype chain.
    895     //
    896     // ArrayWithArrayStorage is also OK. It can have indexed accessors. But if you define an indexed accessor, the array's length
    897     // becomes larger than that index. So Array#push never overlaps with this accessor. So accessors are never called unless
    898     // the IndexingType is ArrayWithSlowPutArrayStorage which could have an indexed accessor in a prototype chain.
    899     RELEASE_ASSERT(!shouldUseSlowPut(array->indexingType()));
    900 
    901     EncodedJSValue* values = static_cast<EncodedJSValue*>(buffer);
    902     for (int32_t i = 0; i < elementCount; ++i) {
    903         array->pushInline(exec, JSValue::decode(values[i]));
    904         RETURN_IF_EXCEPTION(scope, encodedJSValue());
    905     }
    906     return JSValue::encode(jsNumber(array->length()));
    907 }
    908 
    909 EncodedJSValue JIT_OPERATION operationArrayPushDoubleMultiple(ExecState* exec, JSArray* array, void* buffer, int32_t elementCount)
    910 {
    911     VM& vm = exec->vm();
    912     NativeCallFrameTracer tracer(&vm, exec);
    913     auto scope = DECLARE_THROW_SCOPE(vm);
    914 
    915     // We assume that multiple JSArray::push calls with ArrayWithDouble do not cause JS traps.
    916     // If it can cause any JS interactions, we can call the caller JS function of this function and overwrite the
    917     // content of ScratchBuffer. If the IndexingType is now ArrayWithDouble, we can ensure
    918     // that there is no indexed accessors in this object and its prototype chain.
    919     ASSERT(array->indexingType() == ArrayWithDouble);
    920 
    921     double* values = static_cast<double*>(buffer);
    922     for (int32_t i = 0; i < elementCount; ++i) {
    923         array->pushInline(exec, JSValue(JSValue::EncodeAsDouble, values[i]));
    924         RETURN_IF_EXCEPTION(scope, encodedJSValue());
    925     }
     881    array->push(exec, JSValue(JSValue::EncodeAsDouble, value));
    926882    return JSValue::encode(jsNumber(array->length()));
    927883}
Note: See TracChangeset for help on using the changeset viewer.