Changeset 37697 in webkit for trunk/JavaScriptCore/VM/Machine.cpp


Ignore:
Timestamp:
Oct 18, 2008, 10:17:49 PM (17 years ago)
Author:
Darin Adler
Message:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Oliver Hunt.

  • fix assertions I introduced with my casting changes

These were showing up as failures in the JavaScriptCore tests.

  • VM/Machine.cpp: (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that was at the top of the function, and instead cast at the point of use. (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to object after checking the construct type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37691 r37697  
    45414541    JSValuePtr baseVal = ARG_src2;
    45424542    JSValuePtr proto = ARG_src3;
    4543     JSCell* valueCell = asCell(value);
    4544     JSCell* baseCell = asCell(baseVal);
    4545     JSCell* protoCell = asCell(proto);
    45464543
    45474544    // at least one of these checks must have failed to get to the slow case
    4548     ASSERT(JSImmediate::isAnyImmediate(valueCell, baseCell, protoCell)
    4549            || !valueCell->isObject() || !baseCell->isObject() || !protoCell->isObject()
    4550            || (baseCell->structureID()->typeInfo().flags() & (ImplementsHasInstance | OverridesHasInstance)) != ImplementsHasInstance);
     4545    ASSERT(JSImmediate::isAnyImmediate(value, baseVal, proto)
     4546           || !value->isObject() || !baseVal->isObject() || !proto->isObject()
     4547           || (asObject(baseVal)->structureID()->typeInfo().flags() & (ImplementsHasInstance | OverridesHasInstance)) != ImplementsHasInstance);
    45514548
    45524549    if (!baseVal->isObject()) {
     
    45594556    }
    45604557
    4561     if (!baseCell->structureID()->typeInfo().implementsHasInstance())
     4558    if (!asObject(baseVal)->structureID()->typeInfo().implementsHasInstance())
    45624559        return jsBoolean(false);
    45634560
     
    45704567        return jsBoolean(false);
    45714568
    4572     JSValuePtr result = jsBoolean(asObject(baseCell)->hasInstance(callFrame, valueCell, protoCell));
     4569    JSValuePtr result = jsBoolean(asObject(baseVal)->hasInstance(callFrame, value, proto));
    45734570    VM_CHECK_EXCEPTION_AT_END();
    45744571
     
    49314928    ConstructType constructType = constrVal->getConstructData(constructData);
    49324929
    4933     JSObject* constructor = asObject(constrVal);
    4934 
    49354930    if (constructType == ConstructTypeHost) {
     4931        JSObject* constructor = asObject(constrVal);
     4932
    49364933        if (*ARG_profilerReference)
    49374934            (*ARG_profilerReference)->willExecute(callFrame, constructor);
Note: See TracChangeset for help on using the changeset viewer.