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


Ignore:
Timestamp:
Sep 21, 2008, 4:08:15 PM (17 years ago)
Author:
Darin Adler
Message:

2008-09-21 Darin Adler <Darin Adler>

Reviewed by Maciej Stachowiak.

  • VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
  • VM/CTI.cpp: Updated for new name. (JSC::CTI::privateCompileMainPass): Added op_eq. (JSC::CTI::privateCompileSlowCases): Added op_eq.
  • VM/Machine.cpp: (JSC::Machine::cti_op_eq): Removed fast case, since it's now compiled.
File:
1 edited

Legend:

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

    r36738 r36746  
    335335}
    336336
    337 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImm(X86Assembler::RegisterID reg, unsigned opcodeIndex)
     337ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNum(X86Assembler::RegisterID reg, unsigned opcodeIndex)
    338338{
    339339    m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, reg);
     
    341341}
    342342
    343 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImms(X86Assembler::RegisterID reg1, X86Assembler::RegisterID reg2, unsigned opcodeIndex)
     343ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNums(X86Assembler::RegisterID reg1, X86Assembler::RegisterID reg2, unsigned opcodeIndex)
    344344{
    345345    m_jit.movl_rr(reg1, X86::ecx);
    346346    m_jit.andl_rr(reg2, X86::ecx);
    347     emitJumpSlowCaseIfNotImm(X86::ecx, opcodeIndex);
     347    emitJumpSlowCaseIfNotImmNum(X86::ecx, opcodeIndex);
    348348}
    349349
     
    578578                if (JSImmediate::isNumber(value)) {
    579579                    emitGetArg(src1, X86::eax);
    580                     emitJumpSlowCaseIfNotImm(X86::eax, i);
     580                    emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    581581                    m_jit.addl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
    582582                    m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
     
    588588                emitGetArg(src1, X86::eax);
    589589                emitGetArg(src2, X86::edx);
    590                 emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     590                emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
    591591                emitFastArithDeTagImmediate(X86::eax);
    592592                m_jit.addl_rr(X86::edx, X86::eax);
     
    624624            int srcDst = instruction[i + 1].u.operand;
    625625            emitGetArg(srcDst, X86::eax);
    626             emitJumpSlowCaseIfNotImm(X86::eax, i);
     626            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    627627            m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    628628            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
     
    646646            if (src2imm) {
    647647                emitGetArg(instruction[i + 1].u.operand, X86::edx);
    648                 emitJumpSlowCaseIfNotImm(X86::edx, i);
     648                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    649649                m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx);
    650650                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target));
     
    652652                emitGetArg(instruction[i + 1].u.operand, X86::eax);
    653653                emitGetArg(instruction[i + 2].u.operand, X86::edx);
    654                 emitJumpSlowCaseIfNotImm(X86::eax, i);
    655                 emitJumpSlowCaseIfNotImm(X86::edx, i);
     654                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     655                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    656656                m_jit.cmpl_rr(X86::edx, X86::eax);
    657657                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target));
     
    667667            if (src2imm) {
    668668                emitGetArg(instruction[i + 1].u.operand, X86::edx);
    669                 emitJumpSlowCaseIfNotImm(X86::edx, i);
     669                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    670670                m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx);
    671671                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJle(), i + 3 + target));
     
    673673                emitGetArg(instruction[i + 1].u.operand, X86::eax);
    674674                emitGetArg(instruction[i + 2].u.operand, X86::edx);
    675                 emitJumpSlowCaseIfNotImm(X86::eax, i);
    676                 emitJumpSlowCaseIfNotImm(X86::edx, i);
     675                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     676                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    677677                m_jit.cmpl_rr(X86::edx, X86::eax);
    678678                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJle(), i + 3 + target));
     
    775775                if (JSImmediate::isNumber(value)) {
    776776                    emitGetArg(nonconstant, X86::eax);
    777                     emitJumpSlowCaseIfNotImm(X86::eax, i);
     777                    emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    778778                    emitFastArithImmToInt(X86::eax);
    779779                    m_jit.imull_i32r( X86::eax, getDeTaggedConstantImmediate(value), X86::eax);
     
    788788            emitGetArg(src1, X86::eax);
    789789            emitGetArg(src2, X86::edx);
    790             emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     790            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
    791791            emitFastArithDeTagImmediate(X86::eax);
    792792            emitFastArithImmToInt(X86::edx);
     
    937937            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    938938            emitGetArg(instruction[i + 3].u.operand, X86::edx);
    939             emitJumpSlowCaseIfNotImm(X86::edx, i);
     939            emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    940940            emitFastArithImmToInt(X86::edx);
    941941            m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
     
    968968            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    969969            emitGetArg(instruction[i + 3].u.operand, X86::edx);
    970             emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     970            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
    971971            m_jit.subl_rr(X86::edx, X86::eax);
    972972            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
     
    979979            emitGetArg(instruction[i + 1].u.operand, X86::eax);
    980980            emitGetArg(instruction[i + 2].u.operand, X86::edx);
    981             emitJumpSlowCaseIfNotImm(X86::edx, i);
     981            emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    982982            emitFastArithImmToInt(X86::edx);
    983983            m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
     
    10881088            int srcDst = instruction[i + 1].u.operand;
    10891089            emitGetArg(srcDst, X86::eax);
    1090             emitJumpSlowCaseIfNotImm(X86::eax, i);
     1090            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    10911091            m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    10921092            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
     
    11001100            if (src2imm) {
    11011101                emitGetArg(instruction[i + 1].u.operand, X86::edx);
    1102                 emitJumpSlowCaseIfNotImm(X86::edx, i);
     1102                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    11031103                m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx);
    11041104                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target));
     
    11061106                emitGetArg(instruction[i + 1].u.operand, X86::eax);
    11071107                emitGetArg(instruction[i + 2].u.operand, X86::edx);
    1108                 emitJumpSlowCaseIfNotImm(X86::eax, i);
    1109                 emitJumpSlowCaseIfNotImm(X86::edx, i);
     1108                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     1109                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    11101110                m_jit.cmpl_rr(X86::edx, X86::eax);
    11111111                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target));
     
    11461146            emitGetArg(srcDst, X86::eax);
    11471147            m_jit.movl_rr(X86::eax, X86::edx);
    1148             emitJumpSlowCaseIfNotImm(X86::eax, i);
     1148            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    11491149            m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx);
    11501150            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
     
    11771177            break;
    11781178        }
    1179         CTI_COMPILE_BINARY_OP(op_eq)
     1179        case op_eq: {
     1180            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     1181            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     1182            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
     1183            m_jit.cmpl_rr(X86::edx, X86::eax);
     1184            m_jit.sete_r(X86::eax);
     1185            m_jit.movzbl_rr(X86::eax, X86::eax);
     1186            emitTagAsBoolImmediate(X86::eax);
     1187            emitPutResult(instruction[i + 1].u.operand);
     1188            i += 4;
     1189            break;
     1190        }
    11801191        case op_lshift: {
    11811192            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    11821193            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
    1183             emitJumpSlowCaseIfNotImm(X86::eax, i);
    1184             emitJumpSlowCaseIfNotImm(X86::ecx, i);
     1194            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     1195            emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
    11851196            emitFastArithImmToInt(X86::eax);
    11861197            emitFastArithImmToInt(X86::ecx);
     
    11971208            if (JSValue* value = getConstantImmediateNumericArg(src1)) {
    11981209                emitGetArg(src2, X86::eax);
    1199                 emitJumpSlowCaseIfNotImm(X86::eax, i);
     1210                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    12001211                m_jit.andl_i32r(reinterpret_cast<unsigned>(value), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
    12011212                emitPutResult(dst);
    12021213            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    12031214                emitGetArg(src1, X86::eax);
    1204                 emitJumpSlowCaseIfNotImm(X86::eax, i);
     1215                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    12051216                m_jit.andl_i32r(reinterpret_cast<unsigned>(value), X86::eax);
    12061217                emitPutResult(dst);
     
    12091220                emitGetArg(src2, X86::edx);
    12101221                m_jit.andl_rr(X86::edx, X86::eax);
    1211                 emitJumpSlowCaseIfNotImm(X86::eax, i);
     1222                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    12121223                emitPutResult(dst);
    12131224            }
     
    12181229            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    12191230            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
    1220             emitJumpSlowCaseIfNotImm(X86::eax, i);
    1221             emitJumpSlowCaseIfNotImm(X86::ecx, i);
     1231            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     1232            emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
    12221233            emitFastArithImmToInt(X86::ecx);
    12231234            m_jit.sarl_CLr(X86::eax);
     
    12291240        case op_bitnot: {
    12301241            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    1231             emitJumpSlowCaseIfNotImm(X86::eax, i);
     1242            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    12321243            m_jit.xorl_i8r(~JSImmediate::TagBitTypeInteger, X86::eax);
    12331244            emitPutResult(instruction[i + 1].u.operand);
     
    12561267            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    12571268            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
    1258             emitJumpSlowCaseIfNotImm(X86::eax, i);
    1259             emitJumpSlowCaseIfNotImm(X86::ecx, i);
     1269            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
     1270            emitJumpSlowCaseIfNotImmNum(X86::ecx, i);
    12601271            emitFastArithDeTagImmediate(X86::eax);
    12611272            emitFastArithDeTagImmediate(X86::ecx);
     
    12931304            emitGetArg(srcDst, X86::eax);
    12941305            m_jit.movl_rr(X86::eax, X86::edx);
    1295             emitJumpSlowCaseIfNotImm(X86::eax, i);
     1306            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    12961307            m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx);
    12971308            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
     
    13051316            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    13061317            emitGetArg(instruction[i + 3].u.operand, X86::edx);
    1307             emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     1318            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
    13081319            m_jit.xorl_rr(X86::edx, X86::eax);
    13091320            emitFastArithReTagImmediate(X86::eax);
     
    13231334            emitGetArg(instruction[i + 2].u.operand, X86::eax);
    13241335            emitGetArg(instruction[i + 3].u.operand, X86::edx);
    1325             emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     1336            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
    13261337            m_jit.orl_rr(X86::edx, X86::eax);
    13271338            emitPutResult(instruction[i + 1].u.operand);
     
    20312042            break;
    20322043        }
     2044        case op_eq:
     2045            m_jit.link(iter->from, m_jit.label());
     2046            emitPutArg(X86::eax, 0);
     2047            emitPutArg(X86::edx, 4);
     2048            emitCall(i, Machine::cti_op_eq);
     2049            emitPutResult(instruction[i + 1].u.operand);
     2050            i += 4;
     2051            break;
    20332052        CTI_COMPILE_BINARY_OP_SLOW_CASE(op_stricteq);
    20342053
Note: See TracChangeset for help on using the changeset viewer.