Ignore:
Timestamp:
Sep 20, 2008, 10:54:23 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-20 Maciej Stachowiak <[email protected]>

Reviewed by Darin.



2.5% speedup on earley-boyer test

  • VM/Machine.cpp: (JSC::Machine::cti_op_stricteq): Use inline version of strictEqualSlowCase; remove unneeded exception check. (JSC::Machine::cti_op_nstricteq): ditto
  • kjs/operations.cpp: (JSC::strictEqual): Use strictEqualSlowCaseInline (JSC::strictEqualSlowCase): ditto
  • kjs/operations.h: (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined, since the extra function call indirection is a lose for CTI.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/operations.cpp

    r36509 r36727  
    108108        return false;
    109109
    110     return strictEqualSlowCase(v1, v2);
     110    return strictEqualSlowCaseInline(v1, v2);
    111111}
    112112
    113113bool strictEqualSlowCase(JSValue* v1, JSValue* v2)
    114114{
    115     ASSERT(!JSImmediate::areBothImmediate(v1, v2));
    116 
    117     if (JSImmediate::isEitherImmediate(v1, v2)) {
    118         // pointers can't be equal since one is immediate and one isn't
    119         ASSERT(v1 != v2);
    120         ASSERT(v1 == JSImmediate::zeroImmediate() || v2 == JSImmediate::zeroImmediate());
    121 
    122         // The reason we can't just return false here is that 0 === -0,
    123         // and while the former is an immediate number, the latter is not.
    124         if (v1 == JSImmediate::zeroImmediate())
    125             return static_cast<JSCell*>(v2)->isNumber() && static_cast<JSNumberCell*>(v2)->value() == 0;
    126         return static_cast<JSCell*>(v1)->isNumber() && static_cast<JSNumberCell*>(v1)->value() == 0;
    127     }
    128 
    129     if (static_cast<JSCell*>(v1)->isNumber()) {
    130         return static_cast<JSCell*>(v2)->isNumber()
    131             && static_cast<JSNumberCell*>(v1)->value() == static_cast<JSNumberCell*>(v2)->value();
    132     }
    133 
    134     if (static_cast<JSCell*>(v1)->isString()) {
    135         return static_cast<JSCell*>(v2)->isString()
    136             && static_cast<JSString*>(v1)->value() == static_cast<JSString*>(v2)->value();
    137     }
    138 
    139     return v1 == v2;
     115    return strictEqualSlowCaseInline(v1, v2);
    140116}
    141117
Note: See TracChangeset for help on using the changeset viewer.