Changeset 39261 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Dec 12, 2008, 5:39:38 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-12 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

Move slow-cases of JIT code generation over to the MacroAssembler interface.

  • assembler/MacroAssembler.h: (JSC::MacroAssembler::Label::Label): (JSC::MacroAssembler::jae32): (JSC::MacroAssembler::jg32): (JSC::MacroAssembler::jzPtr):
  • jit/JIT.cpp: (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): (JSC::JIT::emitGetVariableObjectRegister): (JSC::JIT::emitPutVariableObjectRegister):
  • jit/JIT.h: (JSC::SlowCaseEntry::SlowCaseEntry): (JSC::JIT::getSlowCase): (JSC::JIT::linkSlowCase):
  • jit/JITArithmetic.cpp: (JSC::JIT::compileBinaryArithOpSlowCase):
  • jit/JITCall.cpp: (JSC::JIT::compileOpCallInitializeCallFrame): (JSC::JIT::compileOpCall): (JSC::JIT::compileOpCallSlowCase):
  • jit/JITInlineMethods.h: (JSC::JIT::emitJumpSlowCaseIfNotJSCell): (JSC::JIT::linkSlowCaseIfNotJSCell):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdSlowCase):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r39252 r39261  
    13671367}
    13681368
    1369 #define CTI_COMPILE_BINARY_OP_SLOW_CASE(name) \
    1370     case name: { \
    1371         __ link(iter->from, __ label()); \
    1372         emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx); \
    1373         emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx); \
    1374         emitCTICall(i, Interpreter::cti_##name); \
    1375         emitPutVirtualRegister(instruction[i + 1].u.operand); \
    1376         i += 4; \
    1377         break; \
    1378     }
    1379    
    13801369void JIT::privateCompileSlowCases()
    13811370{
     
    13841373
    13851374    Instruction* instruction = m_codeBlock->instructions().begin();
    1386     for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end(); ++iter) {
     1375    for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end();) {
    13871376        // FIXME: enable peephole optimizations for slow cases when applicable
    13881377        killLastResultRegister();
     
    13951384        switch (OpcodeID opcodeID = m_interpreter->getOpcodeID(instruction[i].u.opcode)) {
    13961385        case op_convert_this: {
    1397             __ link(iter->from, __ label());
    1398             __ link((++iter)->from, __ label());
     1386            linkSlowCase(iter);
     1387            linkSlowCase(iter);
    13991388            emitPutCTIArg(X86::eax, 0);
    14001389            emitCTICall(i, Interpreter::cti_op_convert_this);
     
    14081397            unsigned src2 = instruction[i + 3].u.operand;
    14091398            if (JSValue* value = getConstantImmediateNumericArg(src1)) {
    1410                 JmpSrc notImm = iter->from;
    1411                 __ link((++iter)->from, __ label());
    1412                 __ subl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
    1413                 __ link(notImm, __ label());
     1399                Jump notImm = getSlowCase(iter);
     1400                linkSlowCase(iter);
     1401                sub32(Imm32(getDeTaggedConstantImmediate(value)), X86::eax);
     1402                notImm.link(this);
    14141403                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    14151404                emitPutCTIArg(X86::eax, 4);
     
    14171406                emitPutVirtualRegister(dst);
    14181407            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    1419                 JmpSrc notImm = iter->from;
    1420                 __ link((++iter)->from, __ label());
    1421                 __ subl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
    1422                 __ link(notImm, __ label());
     1408                Jump notImm = getSlowCase(iter);
     1409                linkSlowCase(iter);
     1410                sub32(Imm32(getDeTaggedConstantImmediate(value)), X86::eax);
     1411                notImm.link(this);
    14231412                emitPutCTIArg(X86::eax, 0);
    14241413                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
     
    14271416            } else {
    14281417                OperandTypes types = OperandTypes::fromInt(instruction[i + 4].u.operand);
    1429                 if (types.first().mightBeNumber() && types.second().mightBeNumber())
    1430                     compileBinaryArithOpSlowCase(op_add, iter, dst, src1, src2, types, i);
    1431                 else
    1432                     ASSERT_NOT_REACHED();
     1418                ASSERT(types.first().mightBeNumber() && types.second().mightBeNumber());
     1419                compileBinaryArithOpSlowCase(op_add, iter, dst, src1, src2, types, i);
    14331420            }
    14341421
     
    14371424        }
    14381425        case op_construct_verify: {
    1439             __ link(iter->from, __ label());
    1440             __ link((++iter)->from, __ label());
     1426            linkSlowCase(iter);
     1427            linkSlowCase(iter);
    14411428            emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    14421429            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    14471434        case op_get_by_val: {
    14481435            // The slow case that handles accesses to arrays (below) may jump back up to here.
    1449             JmpDst beginGetByValSlow = __ label();
    1450 
    1451             JmpSrc notImm = iter->from;
    1452             __ link((++iter)->from, __ label());
    1453             __ link((++iter)->from, __ label());
     1436            Label beginGetByValSlow(this);
     1437
     1438            Jump notImm = getSlowCase(iter);
     1439            linkSlowCase(iter);
     1440            linkSlowCase(iter);
    14541441            emitFastArithIntToImmNoCheck(X86::edx);
    1455             __ link(notImm, __ label());
     1442            notImm.link(this);
    14561443            emitPutCTIArg(X86::eax, 0);
    14571444            emitPutCTIArg(X86::edx, 4);
    14581445            emitCTICall(i, Interpreter::cti_op_get_by_val);
    14591446            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1460             __ link(__ jmp(), m_labels[i + 4]);
     1447            __ link(jump(), m_labels[i + 4]);
    14611448
    14621449            // This is slow case that handles accesses to arrays above the fast cut-off.
    14631450            // First, check if this is an access to the vector
    1464             __ link((++iter)->from, __ label());
    1465             __ cmpl_rm(X86::edx, FIELD_OFFSET(ArrayStorage, m_vectorLength), X86::ecx);
    1466             __ link(__ jbe(), beginGetByValSlow);
     1451            linkSlowCase(iter);
     1452            jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength)), beginGetByValSlow);
    14671453
    14681454            // okay, missed the fast region, but it is still in the vector.  Get the value.
    1469             __ movl_mr(FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::ecx);
     1455            loadPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), X86::ecx);
    14701456            // Check whether the value loaded is zero; if so we need to return undefined.
    1471             __ testl_rr(X86::ecx, X86::ecx);
    1472             __ link(__ je(), beginGetByValSlow);
    1473             __ movl_rr(X86::ecx, X86::eax);
     1457            jzPtr(X86::ecx, beginGetByValSlow);
     1458            move(X86::ecx, X86::eax);
    14741459            emitPutVirtualRegister(instruction[i + 1].u.operand, X86::eax);
    14751460
     
    14841469        case op_rshift: {
    14851470            unsigned src2 = instruction[i + 3].u.operand;
    1486             __ link(iter->from, __ label());
     1471            linkSlowCase(iter);
    14871472            if (getConstantImmediateNumericArg(src2))
    14881473                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
    14891474            else {
    1490                 __ link((++iter)->from, __ label());
     1475                linkSlowCase(iter);
    14911476                emitPutCTIArg(X86::ecx, 4);
    14921477            }
     
    14991484        }
    15001485        case op_lshift: {
    1501             JmpSrc notImm1 = iter->from;
    1502             JmpSrc notImm2 = (++iter)->from;
    1503             __ link((++iter)->from, __ label());
     1486            Jump notImm1 = getSlowCase(iter);
     1487            Jump notImm2 = getSlowCase(iter);
     1488            linkSlowCase(iter);
    15041489            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::ecx, i);
    1505             __ link(notImm1, __ label());
    1506             __ link(notImm2, __ label());
     1490            notImm1.link(this);
     1491            notImm2.link(this);
    15071492            emitPutCTIArg(X86::eax, 0);
    15081493            emitPutCTIArg(X86::ecx, 4);
     
    15161501            JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
    15171502            if (src2imm) {
    1518                 __ link(iter->from, __ label());
     1503                linkSlowCase(iter);
    15191504                emitPutCTIArg(X86::eax, 0);
    15201505                emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx);
    15211506                emitCTICall(i, Interpreter::cti_op_loop_if_less);
    1522                 __ testl_rr(X86::eax, X86::eax);
    1523                 __ link(__ jne(), m_labels[i + 3 + target]);
     1507                __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
    15241508            } else {
    1525                 __ link(iter->from, __ label());
    1526                 __ link((++iter)->from, __ label());
     1509                linkSlowCase(iter);
     1510                linkSlowCase(iter);
    15271511                emitPutCTIArg(X86::eax, 0);
    15281512                emitPutCTIArg(X86::edx, 4);
    15291513                emitCTICall(i, Interpreter::cti_op_loop_if_less);
    1530                 __ testl_rr(X86::eax, X86::eax);
    1531                 __ link(__ jne(), m_labels[i + 3 + target]);
     1514                __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
    15321515            }
    15331516            i += OPCODE_LENGTH(op_loop_if_less);
     
    15481531            JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
    15491532            if (src2imm) {
    1550                 __ link(iter->from, __ label());
     1533                linkSlowCase(iter);
    15511534                emitPutCTIArg(X86::eax, 0);
    15521535                emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx);
    15531536                emitCTICall(i, Interpreter::cti_op_loop_if_lesseq);
    1554                 __ testl_rr(X86::eax, X86::eax);
    1555                 __ link(__ jne(), m_labels[i + 3 + target]);
     1537                __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
    15561538            } else {
    1557                 __ link(iter->from, __ label());
    1558                 __ link((++iter)->from, __ label());
     1539                linkSlowCase(iter);
     1540                linkSlowCase(iter);
    15591541                emitPutCTIArg(X86::eax, 0);
    15601542                emitPutCTIArg(X86::edx, 4);
    15611543                emitCTICall(i, Interpreter::cti_op_loop_if_lesseq);
    1562                 __ testl_rr(X86::eax, X86::eax);
    1563                 __ link(__ jne(), m_labels[i + 3 + target]);
     1544                __ link(jnz32(X86::eax), m_labels[i + 3 + target]);
    15641545            }
    15651546            i += OPCODE_LENGTH(op_loop_if_lesseq);
     
    15681549        case op_pre_inc: {
    15691550            unsigned srcDst = instruction[i + 1].u.operand;
    1570             JmpSrc notImm = iter->from;
    1571             __ link((++iter)->from, __ label());
    1572             __ subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    1573             __ link(notImm, __ label());
     1551            Jump notImm = getSlowCase(iter);
     1552            linkSlowCase(iter);
     1553            sub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax);
     1554            notImm.link(this);
    15741555            emitPutCTIArg(X86::eax, 0);
    15751556            emitCTICall(i, Interpreter::cti_op_pre_inc);
     
    15801561        case op_put_by_val: {
    15811562            // Normal slow cases - either is not an immediate imm, or is an array.
    1582             JmpSrc notImm = iter->from;
    1583             __ link((++iter)->from, __ label());
    1584             __ link((++iter)->from, __ label());
     1563            Jump notImm = getSlowCase(iter);
     1564            linkSlowCase(iter);
     1565            linkSlowCase(iter);
    15851566            emitFastArithIntToImmNoCheck(X86::edx);
    1586             __ link(notImm, __ label());
     1567            notImm.link(this);
    15871568            emitGetVirtualRegister(instruction[i + 3].u.operand, X86::ecx, i);
    15881569            emitPutCTIArg(X86::eax, 0);
     
    15901571            emitPutCTIArg(X86::ecx, 8);
    15911572            emitCTICall(i, Interpreter::cti_op_put_by_val);
    1592             __ link(__ jmp(), m_labels[i + 4]);
     1573            __ link(jump(), m_labels[i + 4]);
    15931574
    15941575            // slow cases for immediate int accesses to arrays
    1595             __ link((++iter)->from, __ label());
    1596             __ link((++iter)->from, __ label());
     1576            linkSlowCase(iter);
     1577            linkSlowCase(iter);
    15971578            emitGetVirtualRegister(instruction[i + 3].u.operand, X86::ecx, i);
    15981579            emitPutCTIArg(X86::eax, 0);
     
    16051586        }
    16061587        case op_loop_if_true: {
    1607             __ link(iter->from, __ label());
     1588            linkSlowCase(iter);
    16081589            emitPutCTIArg(X86::eax, 0);
    16091590            emitCTICall(i, Interpreter::cti_op_jtrue);
    1610             __ testl_rr(X86::eax, X86::eax);
    16111591            unsigned target = instruction[i + 2].u.operand;
    1612             __ link(__ jne(), m_labels[i + 2 + target]);
     1592            __ link(jnz32(X86::eax), m_labels[i + 2 + target]);
    16131593            i += OPCODE_LENGTH(op_loop_if_true);
    16141594            break;
     
    16161596        case op_pre_dec: {
    16171597            unsigned srcDst = instruction[i + 1].u.operand;
    1618             JmpSrc notImm = iter->from;
    1619             __ link((++iter)->from, __ label());
    1620             __ addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    1621             __ link(notImm, __ label());
     1598            Jump notImm = getSlowCase(iter);
     1599            linkSlowCase(iter);
     1600            add32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax);
     1601            notImm.link(this);
    16221602            emitPutCTIArg(X86::eax, 0);
    16231603            emitCTICall(i, Interpreter::cti_op_pre_dec);
     
    16301610            JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
    16311611            if (src2imm) {
    1632                 __ link(iter->from, __ label());
     1612                linkSlowCase(iter);
    16331613                emitPutCTIArg(X86::edx, 0);
    16341614                emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 4, X86::ecx);
    16351615                emitCTICall(i, Interpreter::cti_op_jless);
    1636                 __ testl_rr(X86::eax, X86::eax);
    1637                 __ link(__ je(), m_labels[i + 3 + target]);
     1616                __ link(jz32(X86::eax), m_labels[i + 3 + target]);
    16381617            } else {
    1639                 __ link(iter->from, __ label());
    1640                 __ link((++iter)->from, __ label());
     1618                linkSlowCase(iter);
     1619                linkSlowCase(iter);
    16411620                emitPutCTIArg(X86::eax, 0);
    16421621                emitPutCTIArg(X86::edx, 4);
    16431622                emitCTICall(i, Interpreter::cti_op_jless);
    1644                 __ testl_rr(X86::eax, X86::eax);
    1645                 __ link(__ je(), m_labels[i + 3 + target]);
     1623                __ link(jz32(X86::eax), m_labels[i + 3 + target]);
    16461624            }
    16471625            i += OPCODE_LENGTH(op_jnless);
     
    16491627        }
    16501628        case op_not: {
    1651             __ link(iter->from, __ label());
    1652             __ xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax);
     1629            linkSlowCase(iter);
     1630            xor32(Imm32(JSImmediate::FullTagTypeBool), X86::eax);
    16531631            emitPutCTIArg(X86::eax, 0);
    16541632            emitCTICall(i, Interpreter::cti_op_not);
     
    16581636        }
    16591637        case op_jfalse: {
    1660             __ link(iter->from, __ label());
     1638            linkSlowCase(iter);
    16611639            emitPutCTIArg(X86::eax, 0);
    16621640            emitCTICall(i, Interpreter::cti_op_jtrue);
    1663             __ testl_rr(X86::eax, X86::eax);
    16641641            unsigned target = instruction[i + 2].u.operand;
    1665             __ link(__ je(), m_labels[i + 2 + target]); // inverted!
     1642            __ link(jz32(X86::eax), m_labels[i + 2 + target]); // inverted!
    16661643            i += OPCODE_LENGTH(op_jfalse);
    16671644            break;
     
    16691646        case op_post_inc: {
    16701647            unsigned srcDst = instruction[i + 2].u.operand;
    1671             __ link(iter->from, __ label());
    1672             __ link((++iter)->from, __ label());
     1648            linkSlowCase(iter);
     1649            linkSlowCase(iter);
    16731650            emitPutCTIArg(X86::eax, 0);
    16741651            emitCTICall(i, Interpreter::cti_op_post_inc);
     
    16791656        }
    16801657        case op_bitnot: {
    1681             __ link(iter->from, __ label());
     1658            linkSlowCase(iter);
    16821659            emitPutCTIArg(X86::eax, 0);
    16831660            emitCTICall(i, Interpreter::cti_op_bitnot);
     
    16871664        }
    16881665        case op_bitand: {
     1666            linkSlowCase(iter);
    16891667            unsigned src1 = instruction[i + 2].u.operand;
    16901668            unsigned src2 = instruction[i + 3].u.operand;
    16911669            unsigned dst = instruction[i + 1].u.operand;
    16921670            if (getConstantImmediateNumericArg(src1)) {
    1693                 __ link(iter->from, __ label());
    16941671                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    16951672                emitPutCTIArg(X86::eax, 4);
     
    16971674                emitPutVirtualRegister(dst);
    16981675            } else if (getConstantImmediateNumericArg(src2)) {
    1699                 __ link(iter->from, __ label());
    17001676                emitPutCTIArg(X86::eax, 0);
    17011677                emitPutCTIArgFromVirtualRegister(src2, 4, X86::ecx);
     
    17031679                emitPutVirtualRegister(dst);
    17041680            } else {
    1705                 __ link(iter->from, __ label());
    17061681                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
    17071682                emitPutCTIArg(X86::edx, 4);
     
    17131688        }
    17141689        case op_jtrue: {
    1715             __ link(iter->from, __ label());
     1690            linkSlowCase(iter);
    17161691            emitPutCTIArg(X86::eax, 0);
    17171692            emitCTICall(i, Interpreter::cti_op_jtrue);
    1718             __ testl_rr(X86::eax, X86::eax);
    17191693            unsigned target = instruction[i + 2].u.operand;
    1720             __ link(__ jne(), m_labels[i + 2 + target]);
     1694            __ link(jnz32(X86::eax), m_labels[i + 2 + target]);
    17211695            i += OPCODE_LENGTH(op_jtrue);
    17221696            break;
     
    17241698        case op_post_dec: {
    17251699            unsigned srcDst = instruction[i + 2].u.operand;
    1726             __ link(iter->from, __ label());
    1727             __ link((++iter)->from, __ label());
     1700            linkSlowCase(iter);
     1701            linkSlowCase(iter);
    17281702            emitPutCTIArg(X86::eax, 0);
    17291703            emitCTICall(i, Interpreter::cti_op_post_dec);
     
    17341708        }
    17351709        case op_bitxor: {
    1736             __ link(iter->from, __ label());
     1710            linkSlowCase(iter);
    17371711            emitPutCTIArg(X86::eax, 0);
    17381712            emitPutCTIArg(X86::edx, 4);
     
    17431717        }
    17441718        case op_bitor: {
    1745             __ link(iter->from, __ label());
     1719            linkSlowCase(iter);
    17461720            emitPutCTIArg(X86::eax, 0);
    17471721            emitPutCTIArg(X86::edx, 4);
     
    17521726        }
    17531727        case op_eq: {
    1754             __ link(iter->from, __ label());
     1728            linkSlowCase(iter);
    17551729            emitPutCTIArg(X86::eax, 0);
    17561730            emitPutCTIArg(X86::edx, 4);
     
    17611735        }
    17621736        case op_neq: {
    1763             __ link(iter->from, __ label());
     1737            linkSlowCase(iter);
    17641738            emitPutCTIArg(X86::eax, 0);
    17651739            emitPutCTIArg(X86::edx, 4);
     
    17701744        }
    17711745        case op_stricteq: {
    1772             __ link(iter->from, __ label());
    1773             __ link((++iter)->from, __ label());
    1774             __ link((++iter)->from, __ label());
     1746            linkSlowCase(iter);
     1747            linkSlowCase(iter);
     1748            linkSlowCase(iter);
    17751749            emitPutCTIArg(X86::eax, 0);
    17761750            emitPutCTIArg(X86::edx, 4);
     
    17811755        }
    17821756        case op_nstricteq: {
    1783             __ link(iter->from, __ label());
    1784             __ link((++iter)->from, __ label());
    1785             __ link((++iter)->from, __ label());
     1757            linkSlowCase(iter);
     1758            linkSlowCase(iter);
     1759            linkSlowCase(iter);
    17861760            emitPutCTIArg(X86::eax, 0);
    17871761            emitPutCTIArg(X86::edx, 4);
     
    17921766        }
    17931767        case op_instanceof: {
    1794             __ link(iter->from, __ label());
    1795             __ link((++iter)->from, __ label());
    1796             __ link((++iter)->from, __ label());
     1768            linkSlowCase(iter);
     1769            linkSlowCase(iter);
     1770            linkSlowCase(iter);
    17971771            emitPutCTIArgFromVirtualRegister(instruction[i + 2].u.operand, 0, X86::ecx);
    17981772            emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 4, X86::ecx);
     
    18041778        }
    18051779        case op_mod: {
    1806             JmpSrc notImm1 = iter->from;
    1807             JmpSrc notImm2 = (++iter)->from;
    1808             __ link((++iter)->from, __ label());
     1780            Jump notImm1 = getSlowCase(iter);
     1781            Jump notImm2 = getSlowCase(iter);
     1782            linkSlowCase(iter);
    18091783            emitFastArithReTagImmediate(X86::eax);
    18101784            emitFastArithReTagImmediate(X86::ecx);
    1811             __ link(notImm1, __ label());
    1812             __ link(notImm2, __ label());
     1785            notImm1.link(this);
     1786            notImm2.link(this);
    18131787            emitPutCTIArg(X86::eax, 0);
    18141788            emitPutCTIArg(X86::ecx, 4);
     
    18261800            int32_t value;
    18271801            if (src1Value && ((value = JSImmediate::intValue(src1Value)) > 0)) {
    1828                 __ link(iter->from, __ label());
    1829                 __ link((++iter)->from, __ label());
     1802                linkSlowCase(iter);
     1803                linkSlowCase(iter);
    18301804                // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
    18311805                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
     
    18341808                emitPutVirtualRegister(dst);
    18351809            } else if (src2Value && ((value = JSImmediate::intValue(src2Value)) > 0)) {
    1836                 __ link(iter->from, __ label());
    1837                 __ link((++iter)->from, __ label());
     1810                linkSlowCase(iter);
     1811                linkSlowCase(iter);
    18381812                // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
    18391813                emitPutCTIArgFromVirtualRegister(src1, 0, X86::ecx);
     
    18551829        }
    18561830        case op_to_jsnumber: {
    1857             if (linkSlowCaseIfNotJSCell(iter, instruction[i + 2].u.operand))
    1858                 ++iter;
    1859             __ link(iter->from, __ label());
     1831            linkSlowCaseIfNotJSCell(iter, instruction[i + 2].u.operand);
     1832            linkSlowCase(iter);
    18601833
    18611834            emitPutCTIArg(X86::eax, 0);
     
    18721845        }
    18731846
    1874         ASSERT_WITH_MESSAGE((iter + 1) == m_slowCases.end() || firstTo != (iter + 1)->to,"Not enough jumps linked in slow case codegen.");
    1875         ASSERT_WITH_MESSAGE(firstTo == iter->to, "Too many jumps linked in slow case codegen.");
    1876 
    1877         __ link(__ jmp(), m_labels[i]);
     1847        ASSERT_WITH_MESSAGE(iter == m_slowCases.end() || firstTo != iter->to,"Not enough jumps linked in slow case codegen.");
     1848        ASSERT_WITH_MESSAGE(firstTo == (iter - 1)->to, "Too many jumps linked in slow case codegen.");
     1849
     1850        __ link(jump(), m_labels[i]);
    18781851    }
    18791852
     
    18851858{
    18861859#if ENABLE(CODEBLOCK_SAMPLING)
    1887         __ movl_i32m(reinterpret_cast<unsigned>(m_codeBlock), m_interpreter->sampler()->codeBlockSlot());
     1860        storePtr(ImmPtr(m_codeBlock), m_interpreter->sampler()->codeBlockSlot());
    18881861#endif
    18891862#if ENABLE(OPCODE_SAMPLING)
    1890         __ movl_i32m(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin()), m_interpreter->sampler()->sampleSlot());
     1863        store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin())), m_interpreter->sampler()->sampleSlot());
    18911864#endif
    18921865
     
    18951868    emitPutToCallFrameHeader(X86::ecx, RegisterFile::ReturnPC);
    18961869
    1897     JmpSrc slowRegisterFileCheck;
    1898     JmpDst afterRegisterFileCheck;
     1870    Jump slowRegisterFileCheck;
     1871    Label afterRegisterFileCheck;
    18991872    if (m_codeBlock->codeType() == FunctionCode) {
    19001873        // In the case of a fast linked call, we do not set this up in the caller.
     
    19031876        emitGetCTIParam(CTI_ARGS_registerFile, X86::eax);
    19041877        __ leal_mr(m_codeBlock->m_numCalleeRegisters * sizeof(Register), X86::edi, X86::edx);
    1905         __ cmpl_mr(FIELD_OFFSET(RegisterFile, m_end), X86::eax, X86::edx);
    1906         slowRegisterFileCheck = __ jg();
    1907         afterRegisterFileCheck = __ label();
     1878        slowRegisterFileCheck = jg32(X86::edx, Address(X86::eax, FIELD_OFFSET(RegisterFile, m_end)));
     1879        afterRegisterFileCheck = Label(this);
    19081880    }
    19091881
     
    19131885
    19141886    if (m_codeBlock->codeType() == FunctionCode) {
    1915         __ link(slowRegisterFileCheck, __ label());
     1887        slowRegisterFileCheck.link(this);
    19161888        emitCTICall(0, Interpreter::cti_register_file_check);
    1917         JmpSrc backToBody = __ jmp();
    1918         __ link(backToBody, afterRegisterFileCheck);
     1889        jump(afterRegisterFileCheck);
    19191890    }
    19201891
     
    21712142void JIT::emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst)
    21722143{
    2173     __ movl_mr(FIELD_OFFSET(JSVariableObject, d), variableObject, dst);
    2174     __ movl_mr(FIELD_OFFSET(JSVariableObject::JSVariableObjectData, registers), dst, dst);
    2175     __ movl_mr(index * sizeof(Register), dst, dst);
     2144    loadPtr(Address(variableObject, FIELD_OFFSET(JSVariableObject, d)), dst);
     2145    loadPtr(Address(dst, FIELD_OFFSET(JSVariableObject::JSVariableObjectData, registers)), dst);
     2146    loadPtr(Address(dst, index * sizeof(Register)), dst);
    21762147}
    21772148
    21782149void JIT::emitPutVariableObjectRegister(RegisterID src, RegisterID variableObject, int index)
    21792150{
    2180     __ movl_mr(FIELD_OFFSET(JSVariableObject, d), variableObject, variableObject);
    2181     __ movl_mr(FIELD_OFFSET(JSVariableObject::JSVariableObjectData, registers), variableObject, variableObject);
    2182     __ movl_rm(src, index * sizeof(Register), variableObject);
     2151    loadPtr(Address(variableObject, FIELD_OFFSET(JSVariableObject, d)), variableObject);
     2152    loadPtr(Address(variableObject, FIELD_OFFSET(JSVariableObject::JSVariableObjectData, registers)), variableObject);
     2153    storePtr(src, Address(variableObject, index * sizeof(Register)));
    21832154}
    21842155
Note: See TracChangeset for help on using the changeset viewer.