Changeset 36876 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Sep 24, 2008, 5:26:38 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Oliver Hunt.


  • inline JIT fast case of op_neq
  • remove extra level of function call indirection from slow cases of eq and neq


1% speedup on Richards

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases):
  • VM/Machine.cpp: (JSC::Machine::privateExecute): (JSC::Machine::cti_op_eq): (JSC::Machine::cti_op_neq):
  • kjs/operations.cpp: (JSC::equal): (JSC::equalSlowCase):
  • kjs/operations.h: (JSC::equalSlowCaseInline):
File:
1 edited

Legend:

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

    r36841 r36876  
    14181418        }
    14191419        CTI_COMPILE_BINARY_OP(op_less)
    1420         CTI_COMPILE_BINARY_OP(op_neq)
     1420        case op_neq: {
     1421            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     1422            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     1423            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
     1424            m_jit.cmpl_rr(X86::eax, X86::edx);
     1425
     1426            m_jit.setne_r(X86::eax);
     1427            m_jit.movzbl_rr(X86::eax, X86::eax);
     1428            emitTagAsBoolImmediate(X86::eax);
     1429
     1430            emitPutResult(instruction[i + 1].u.operand);
     1431
     1432            i += 4;
     1433            break;
     1434        }
    14211435        case op_post_dec: {
    14221436            int srcDst = instruction[i + 2].u.operand;
     
    21792193            break;
    21802194        }
     2195        case op_neq: {
     2196            m_jit.link(iter->from, m_jit.label());
     2197            emitPutArg(X86::eax, 0);
     2198            emitPutArg(X86::edx, 4);
     2199            emitCall(i, Machine::cti_op_neq);
     2200            emitPutResult(instruction[i + 1].u.operand);
     2201            i += 4;
     2202            break;
     2203        }
    21812204        CTI_COMPILE_BINARY_OP_SLOW_CASE(op_stricteq);
    21822205        CTI_COMPILE_BINARY_OP_SLOW_CASE(op_nstricteq);
Note: See TracChangeset for help on using the changeset viewer.