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


Ignore:
Timestamp:
Sep 9, 2008, 6:11:55 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-09 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Bug 20755: Create an X86 namespace for register names and other things
<https://bugs.webkit.org/show_bug.cgi?id=20755>

Create an X86 namespace to put X86 register names. Perhaps I will move
opcode names here later as well.

  • VM/CTI.cpp: (JSC::CTI::emitGetArg): (JSC::CTI::emitGetPutArg): (JSC::CTI::emitPutArg): (JSC::CTI::emitPutArgConstant): (JSC::CTI::emitPutCTIParam): (JSC::CTI::emitGetCTIParam): (JSC::CTI::emitPutToCallFrameHeader): (JSC::CTI::emitGetFromCallFrameHeader): (JSC::CTI::emitPutResult): (JSC::CTI::emitDebugExceptionCheck): (JSC::CTI::emitJumpSlowCaseIfNotImms): (JSC::CTI::compileOpCall): (JSC::CTI::emitSlowScriptCheck): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile): (JSC::CTI::privateCompileGetByIdSelf): (JSC::CTI::privateCompileGetByIdProto): (JSC::CTI::privateCompileGetByIdChain): (JSC::CTI::privateCompilePutByIdReplace): (JSC::CTI::privateArrayLengthTrampoline): (JSC::CTI::privateStringLengthTrampoline): (JSC::CTI::compileRegExp):
  • VM/CTI.h:
  • masm/X86Assembler.h: (JSC::X86::): (JSC::X86Assembler::emitModRm_rm): (JSC::X86Assembler::emitModRm_rm_Unchecked): (JSC::X86Assembler::emitModRm_rmsib):
  • wrec/WREC.cpp: (JSC::WRECGenerator::generateNonGreedyQuantifier): (JSC::WRECGenerator::generateGreedyQuantifier): (JSC::WRECGenerator::generateParentheses): (JSC::WRECGenerator::generateBackreference): (JSC::WRECGenerator::gernerateDisjunction):
  • wrec/WREC.h:
File:
1 edited

Legend:

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

    r36301 r36307  
    115115        m_jit.movl_i32r(reinterpret_cast<unsigned>(js), dst);
    116116    } else
    117         m_jit.movl_mr(src * sizeof(Register), MacroAssembler::edi, dst);
     117        m_jit.movl_mr(src * sizeof(Register), X86::edi, dst);
    118118}
    119119
     
    123123    if (src < m_codeBlock->constantRegisters.size()) {
    124124        JSValue* js = m_codeBlock->constantRegisters[src].jsValue(m_exec);
    125         m_jit.movl_i32m(reinterpret_cast<unsigned>(js), offset + sizeof(void*), MacroAssembler::esp);
     125        m_jit.movl_i32m(reinterpret_cast<unsigned>(js), offset + sizeof(void*), X86::esp);
    126126    } else {
    127         m_jit.movl_mr(src * sizeof(Register), MacroAssembler::edi, scratch);
    128         m_jit.movl_rm(scratch, offset + sizeof(void*), MacroAssembler::esp);
     127        m_jit.movl_mr(src * sizeof(Register), X86::edi, scratch);
     128        m_jit.movl_rm(scratch, offset + sizeof(void*), X86::esp);
    129129    }
    130130}
     
    133133ALWAYS_INLINE void CTI::emitPutArg(MacroAssembler::RegisterID src, unsigned offset)
    134134{
    135     m_jit.movl_rm(src, offset + sizeof(void*), MacroAssembler::esp);
     135    m_jit.movl_rm(src, offset + sizeof(void*), X86::esp);
    136136}
    137137
    138138ALWAYS_INLINE void CTI::emitPutArgConstant(unsigned value, unsigned offset)
    139139{
    140     m_jit.movl_i32m(value, offset + sizeof(void*), MacroAssembler::esp);
     140    m_jit.movl_i32m(value, offset + sizeof(void*), X86::esp);
    141141}
    142142
     
    152152ALWAYS_INLINE void CTI::emitPutCTIParam(MacroAssembler::RegisterID from, unsigned name)
    153153{
    154     m_jit.movl_rm(from, name * sizeof(void*), MacroAssembler::esp);
     154    m_jit.movl_rm(from, name * sizeof(void*), X86::esp);
    155155}
    156156
    157157ALWAYS_INLINE void CTI::emitGetCTIParam(unsigned name, MacroAssembler::RegisterID to)
    158158{
    159     m_jit.movl_mr(name * sizeof(void*), MacroAssembler::esp, to);
     159    m_jit.movl_mr(name * sizeof(void*), X86::esp, to);
    160160}
    161161
    162162ALWAYS_INLINE void CTI::emitPutToCallFrameHeader(MacroAssembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry)
    163163{
    164     m_jit.movl_rm(from, -((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - entry) * sizeof(Register), MacroAssembler::edi);
     164    m_jit.movl_rm(from, -((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - entry) * sizeof(Register), X86::edi);
    165165}
    166166
    167167ALWAYS_INLINE void CTI::emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, MacroAssembler::RegisterID to)
    168168{
    169     m_jit.movl_mr(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - entry) * sizeof(Register), MacroAssembler::edi, to);
     169    m_jit.movl_mr(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - entry) * sizeof(Register), X86::edi, to);
    170170}
    171171
    172172ALWAYS_INLINE void CTI::emitPutResult(unsigned dst, MacroAssembler::RegisterID from)
    173173{
    174     m_jit.movl_rm(from, dst * sizeof(Register), MacroAssembler::edi);
     174    m_jit.movl_rm(from, dst * sizeof(Register), X86::edi);
    175175    // FIXME: #ifndef NDEBUG, Write the correct m_type to the register.
    176176}
     
    200200ALWAYS_INLINE void CTI::emitDebugExceptionCheck()
    201201{
    202     emitGetCTIParam(CTI_ARGS_exec, MacroAssembler::ecx);
    203     m_jit.cmpl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), MacroAssembler::ecx);
     202    emitGetCTIParam(CTI_ARGS_exec, X86::ecx);
     203    m_jit.cmpl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), X86::ecx);
    204204    MacroAssembler::JmpSrc noException = m_jit.emitUnlinkedJe();
    205205    m_jit.emitInt3();
     
    311311ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImms(MacroAssembler::RegisterID reg1, MacroAssembler::RegisterID reg2, unsigned opcodeIndex)
    312312{
    313     m_jit.movl_rr(reg1, MacroAssembler::ecx);
    314     m_jit.andl_rr(reg2, MacroAssembler::ecx);
    315     emitJumpSlowCaseIfNotImm(MacroAssembler::ecx, opcodeIndex);
     313    m_jit.movl_rr(reg1, X86::ecx);
     314    m_jit.andl_rr(reg2, X86::ecx);
     315    emitJumpSlowCaseIfNotImm(X86::ecx, opcodeIndex);
    316316}
    317317
     
    367367#define CTI_COMPILE_BINARY_OP(name) \
    368368    case name: { \
    369         emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx); \
    370         emitGetPutArg(instruction[i + 3].u.operand, 4, MacroAssembler::ecx); \
     369        emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \
     370        emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); \
    371371        emitCall(i, Machine::cti_##name); \
    372372        emitPutResult(instruction[i + 1].u.operand); \
     
    394394            emitPutArgConstant(reinterpret_cast<unsigned>(m_exec->globalThisValue()), 4);
    395395        } else
    396             emitGetPutArg(thisVal, 4, MacroAssembler::ecx);
     396            emitGetPutArg(thisVal, 4, X86::ecx);
    397397    }
    398398
    399399    MacroAssembler::JmpSrc wasEval;
    400400    if (type == OpCallEval) {
    401         emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     401        emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    402402        emitCall(i, Machine::cti_op_call_eval);
    403403        m_jit.emitRestoreArgumentReference();
    404404
    405        emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r
    406 
    407         m_jit.cmpl_i32r(reinterpret_cast<unsigned>(JSImmediate::impossibleValue()), MacroAssembler::eax);
     405       emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     406
     407        m_jit.cmpl_i32r(reinterpret_cast<unsigned>(JSImmediate::impossibleValue()), X86::eax);
    408408        wasEval = m_jit.emitUnlinkedJne();
    409409   
    410410        // this reloads the first arg into ecx (checked just below).
    411         emitGetArg(instruction[i + 2].u.operand, MacroAssembler::ecx);
     411        emitGetArg(instruction[i + 2].u.operand, X86::ecx);
    412412    } else {
    413413        // this sets up the first arg, and explicitly leaves the value in ecx (checked just below).
    414         emitGetArg(instruction[i + 2].u.operand, MacroAssembler::ecx);
    415         emitPutArg(MacroAssembler::ecx, 0);
     414        emitGetArg(instruction[i + 2].u.operand, X86::ecx);
     415        emitPutArg(X86::ecx, 0);
    416416    }
    417417
    418418    // Fast check for JS function.
    419     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::ecx);
     419    m_jit.testl_i32r(JSImmediate::TagMask, X86::ecx);
    420420    MacroAssembler::JmpSrc isNotObject = m_jit.emitUnlinkedJne();
    421     m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsFunctionVptr), MacroAssembler::ecx);
     421    m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsFunctionVptr), X86::ecx);
    422422    MacroAssembler::JmpSrc isJSFunction = m_jit.emitUnlinkedJe();
    423423    m_jit.link(isNotObject, m_jit.label());
     
    425425    // This handles host functions
    426426    emitCall(i, ((type == OpConstruct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction));
    427     emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r
     427    emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
    428428   
    429429    MacroAssembler::JmpSrc wasNotJSFunction = m_jit.emitUnlinkedJmp();
     
    432432    // This handles JSFunctions
    433433    emitCall(i, ((type == OpConstruct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction));
    434     m_jit.call_r(MacroAssembler::eax);
    435     emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r
     434    m_jit.call_r(X86::eax);
     435    emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
    436436
    437437    MacroAssembler::JmpDst end = m_jit.label();
     
    445445void CTI::emitSlowScriptCheck(unsigned opcodeIndex)
    446446{
    447     m_jit.subl_i8r(1, MacroAssembler::esi);
     447    m_jit.subl_i8r(1, X86::esi);
    448448    MacroAssembler::JmpSrc skipTimeout = m_jit.emitUnlinkedJne();
    449449    emitCall(opcodeIndex, Machine::cti_timeout_check);
    450450
    451     emitGetCTIParam(CTI_ARGS_exec, MacroAssembler::ecx);
    452     m_jit.movl_mr(OBJECT_OFFSET(ExecState, m_globalData), MacroAssembler::ecx, MacroAssembler::ecx);
    453     m_jit.movl_mr(OBJECT_OFFSET(JSGlobalData, machine), MacroAssembler::ecx, MacroAssembler::ecx);
    454     m_jit.movl_mr(OBJECT_OFFSET(Machine, m_ticksUntilNextTimeoutCheck), MacroAssembler::ecx, MacroAssembler::esi);
     451    emitGetCTIParam(CTI_ARGS_exec, X86::ecx);
     452    m_jit.movl_mr(OBJECT_OFFSET(ExecState, m_globalData), X86::ecx, X86::ecx);
     453    m_jit.movl_mr(OBJECT_OFFSET(JSGlobalData, machine), X86::ecx, X86::ecx);
     454    m_jit.movl_mr(OBJECT_OFFSET(Machine, m_ticksUntilNextTimeoutCheck), X86::ecx, X86::esi);
    455455    m_jit.link(skipTimeout, m_jit.label());
    456456}
     
    474474            unsigned src = instruction[i + 2].u.operand;
    475475            if (src < m_codeBlock->constantRegisters.size())
    476                 m_jit.movl_i32r(reinterpret_cast<unsigned>(m_codeBlock->constantRegisters[src].jsValue(m_exec)), MacroAssembler::edx);
     476                m_jit.movl_i32r(reinterpret_cast<unsigned>(m_codeBlock->constantRegisters[src].jsValue(m_exec)), X86::edx);
    477477            else
    478                 emitGetArg(src, MacroAssembler::edx);
    479             emitPutResult(instruction[i + 1].u.operand, MacroAssembler::edx);
     478                emitGetArg(src, X86::edx);
     479            emitPutResult(instruction[i + 1].u.operand, X86::edx);
    480480            i += 3;
    481481            break;
     
    488488                JSValue* value = m_codeBlock->constantRegisters[src2].jsValue(m_exec);
    489489                if (JSImmediate::isNumber(value)) {
    490                     emitGetArg(src1, MacroAssembler::eax);
    491                     emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    492                     m_jit.addl_i32r(getDeTaggedConstantImmediate(value), MacroAssembler::eax);
     490                    emitGetArg(src1, X86::eax);
     491                    emitJumpSlowCaseIfNotImm(X86::eax, i);
     492                    m_jit.addl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
    493493                    m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    494494                    emitPutResult(dst);
     
    497497                }
    498498            } else if (!(src1 < m_codeBlock->constantRegisters.size())) {
    499                 emitGetArg(src1, MacroAssembler::eax);
    500                 emitGetArg(src2, MacroAssembler::edx);
    501                 emitJumpSlowCaseIfNotImms(MacroAssembler::eax, MacroAssembler::edx, i);
    502                 emitFastArithDeTagImmediate(MacroAssembler::eax);
    503                 m_jit.addl_rr(MacroAssembler::edx, MacroAssembler::eax);
     499                emitGetArg(src1, X86::eax);
     500                emitGetArg(src2, X86::edx);
     501                emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     502                emitFastArithDeTagImmediate(X86::eax);
     503                m_jit.addl_rr(X86::edx, X86::eax);
    504504                m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    505505                emitPutResult(dst);
     
    507507                break;
    508508            }
    509             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
    510             emitGetPutArg(instruction[i + 3].u.operand, 4, MacroAssembler::ecx);
     509            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
     510            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    511511            emitCall(i, Machine::cti_op_add);
    512512            emitPutResult(instruction[i + 1].u.operand);
     
    517517            if (m_codeBlock->needsFullScopeChain)
    518518                emitCall(i, Machine::cti_op_end);
    519             emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
     519            emitGetArg(instruction[i + 1].u.operand, X86::eax);
    520520#if ENABLE(SAMPLING_TOOL)
    521521            m_jit.movl_i32m(-1, &what);
    522522#endif
    523             m_jit.pushl_m(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - RegisterFile::CTIReturnEIP) * sizeof(Register), MacroAssembler::edi);
     523            m_jit.pushl_m(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - RegisterFile::CTIReturnEIP) * sizeof(Register), X86::edi);
    524524            m_jit.ret();
    525525            i += 2;
     
    534534        case op_pre_inc: {
    535535            int srcDst = instruction[i + 1].u.operand;
    536             emitGetArg(srcDst, MacroAssembler::eax);
    537             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    538             m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), MacroAssembler::eax);
     536            emitGetArg(srcDst, X86::eax);
     537            emitJumpSlowCaseIfNotImm(X86::eax, i);
     538            m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    539539            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    540             emitPutResult(srcDst, MacroAssembler::eax);
     540            emitPutResult(srcDst, X86::eax);
    541541            i += 2;
    542542            break;
     
    556556            JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
    557557            if (src2imm) {
    558                 emitGetArg(instruction[i + 1].u.operand, MacroAssembler::edx);
    559                 emitJumpSlowCaseIfNotImm(MacroAssembler::edx, i);
    560                 m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), MacroAssembler::edx);
     558                emitGetArg(instruction[i + 1].u.operand, X86::edx);
     559                emitJumpSlowCaseIfNotImm(X86::edx, i);
     560                m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx);
    561561                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target));
    562562            } else {
    563                 emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    564                 emitGetArg(instruction[i + 2].u.operand, MacroAssembler::edx);
    565                 emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    566                 emitJumpSlowCaseIfNotImm(MacroAssembler::edx, i);
    567                 m_jit.cmpl_rr(MacroAssembler::edx, MacroAssembler::eax);
     563                emitGetArg(instruction[i + 1].u.operand, X86::eax);
     564                emitGetArg(instruction[i + 2].u.operand, X86::edx);
     565                emitJumpSlowCaseIfNotImm(X86::eax, i);
     566                emitJumpSlowCaseIfNotImm(X86::edx, i);
     567                m_jit.cmpl_rr(X86::edx, X86::eax);
    568568                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target));
    569569            }
     
    580580            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]);
    581581            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    582             emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    583             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::edx);
    584             emitPutArg(MacroAssembler::eax, 0); // leave the base in eax
    585             emitPutArg(MacroAssembler::edx, 8); // leave the base in edx
     582            emitGetArg(instruction[i + 1].u.operand, X86::eax);
     583            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     584            emitPutArg(X86::eax, 0); // leave the base in eax
     585            emitPutArg(X86::edx, 8); // leave the base in edx
    586586            emitCall(i, Machine::cti_op_put_by_id);
    587587            i += 6;
     
    591591            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]);
    592592            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    593             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    594             emitPutArg(MacroAssembler::eax, 0); // leave the base in eax
     593            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     594            emitPutArg(X86::eax, 0); // leave the base in eax
    595595            emitCall(i, Machine::cti_op_get_by_id);
    596596            emitPutResult(instruction[i + 1].u.operand);
     
    599599        }
    600600        case op_instanceof: {
    601             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
    602             emitGetPutArg(instruction[i + 3].u.operand, 4, MacroAssembler::ecx);
     601            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
     602            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    603603            emitCall(i, Machine::cti_op_instanceof);
    604604            emitPutResult(instruction[i + 1].u.operand);
     
    607607        }
    608608        case op_del_by_id: {
    609             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     609            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    610610            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]);
    611611            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
     
    632632            int skip = instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain;
    633633
    634             emitGetCTIParam(CTI_ARGS_scopeChain, MacroAssembler::eax);
     634            emitGetCTIParam(CTI_ARGS_scopeChain, X86::eax);
    635635            while (skip--)
    636                 m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, next), MacroAssembler::eax, MacroAssembler::eax);
    637 
    638             m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, object), MacroAssembler::eax, MacroAssembler::eax);
    639             m_jit.movl_mr(JSVariableObject::offsetOf_d(), MacroAssembler::eax, MacroAssembler::eax);
    640             m_jit.movl_mr(JSVariableObject::offsetOf_Data_registers(), MacroAssembler::eax, MacroAssembler::eax);
    641             m_jit.movl_mr((instruction[i + 2].u.operand) * sizeof(Register), MacroAssembler::eax, MacroAssembler::eax);
     636                m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, next), X86::eax, X86::eax);
     637
     638            m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, object), X86::eax, X86::eax);
     639            m_jit.movl_mr(JSVariableObject::offsetOf_d(), X86::eax, X86::eax);
     640            m_jit.movl_mr(JSVariableObject::offsetOf_Data_registers(), X86::eax, X86::eax);
     641            m_jit.movl_mr((instruction[i + 2].u.operand) * sizeof(Register), X86::eax, X86::eax);
    642642            emitPutResult(instruction[i + 1].u.operand);
    643643            i += 4;
     
    647647            int skip = instruction[i + 2].u.operand + m_codeBlock->needsFullScopeChain;
    648648
    649             emitGetCTIParam(CTI_ARGS_scopeChain, MacroAssembler::edx);
    650             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::eax);
     649            emitGetCTIParam(CTI_ARGS_scopeChain, X86::edx);
     650            emitGetArg(instruction[i + 3].u.operand, X86::eax);
    651651            while (skip--)
    652                 m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, next), MacroAssembler::edx, MacroAssembler::edx);
    653 
    654             m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, object), MacroAssembler::edx, MacroAssembler::edx);
    655             m_jit.movl_mr(JSVariableObject::offsetOf_d(), MacroAssembler::edx, MacroAssembler::edx);
    656             m_jit.movl_mr(JSVariableObject::offsetOf_Data_registers(), MacroAssembler::edx, MacroAssembler::edx);
    657             m_jit.movl_rm(MacroAssembler::eax, (instruction[i + 1].u.operand) * sizeof(Register), MacroAssembler::edx);
     652                m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, next), X86::edx, X86::edx);
     653
     654            m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, object), X86::edx, X86::edx);
     655            m_jit.movl_mr(JSVariableObject::offsetOf_d(), X86::edx, X86::edx);
     656            m_jit.movl_mr(JSVariableObject::offsetOf_Data_registers(), X86::edx, X86::edx);
     657            m_jit.movl_rm(X86::eax, (instruction[i + 1].u.operand) * sizeof(Register), X86::edx);
    658658            i += 4;
    659659            break;
    660660        }
    661661        case op_ret: {
    662             emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);
     662            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    663663            emitCall(i, Machine::cti_op_ret);
    664664
    665             m_jit.pushl_m(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - RegisterFile::CTIReturnEIP) * sizeof(Register), MacroAssembler::edi);
     665            m_jit.pushl_m(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - RegisterFile::CTIReturnEIP) * sizeof(Register), X86::edi);
    666666            m_jit.ret();
    667667            i += 2;
     
    669669        }
    670670        case op_new_array: {
    671             m_jit.leal_mr(sizeof(Register) * instruction[i + 2].u.operand, MacroAssembler::edi, MacroAssembler::edx);
    672             emitPutArg(MacroAssembler::edx, 0);
     671            m_jit.leal_mr(sizeof(Register) * instruction[i + 2].u.operand, X86::edi, X86::edx);
     672            emitPutArg(X86::edx, 0);
    673673            emitPutArgConstant(instruction[i + 3].u.operand, 4);
    674674            emitCall(i, Machine::cti_op_new_array);
     
    691691        }
    692692        case op_get_by_val: {
    693             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    694             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::edx);
    695             emitJumpSlowCaseIfNotImm(MacroAssembler::edx, i);
    696             emitFastArithImmToInt(MacroAssembler::edx);
    697             m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     693            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     694            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     695            emitJumpSlowCaseIfNotImm(X86::edx, i);
     696            emitFastArithImmToInt(X86::edx);
     697            m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    698698            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    699             m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), MacroAssembler::eax);
     699            m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), X86::eax);
    700700            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    701             m_jit.cmpl_rm(MacroAssembler::edx, OBJECT_OFFSET(JSArray, m_fastAccessCutoff), MacroAssembler::eax);
     701            m_jit.cmpl_rm(X86::edx, OBJECT_OFFSET(JSArray, m_fastAccessCutoff), X86::eax);
    702702            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJbe(), i));
    703703
    704             m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), MacroAssembler::eax, MacroAssembler::eax);
    705             m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_vector[0]), MacroAssembler::eax, MacroAssembler::edx, sizeof(JSValue*), MacroAssembler::eax);
     704            m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::eax);
     705            m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::eax, X86::edx, sizeof(JSValue*), X86::eax);
    706706            emitPutResult(instruction[i + 1].u.operand);
    707707            i += 4;
     
    713713            emitCall(i, Machine::cti_op_resolve_func);
    714714            emitPutResult(instruction[i + 1].u.operand);
    715             emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);
     715            emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax);
    716716            emitPutResult(instruction[i + 2].u.operand);
    717717            i += 4;
     
    719719        }
    720720        case op_sub: {
    721             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    722             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::edx);
    723             emitJumpSlowCaseIfNotImms(MacroAssembler::eax, MacroAssembler::edx, i);
    724             m_jit.subl_rr(MacroAssembler::edx, MacroAssembler::eax);
     721            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     722            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     723            emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     724            m_jit.subl_rr(X86::edx, X86::eax);
    725725            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    726             emitFastArithReTagImmediate(MacroAssembler::eax);
     726            emitFastArithReTagImmediate(X86::eax);
    727727            emitPutResult(instruction[i + 1].u.operand);
    728728            i += 4;
     
    730730        }
    731731        case op_put_by_val: {
    732             emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    733             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::edx);
    734             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::ecx);
    735             emitJumpSlowCaseIfNotImm(MacroAssembler::edx, i);
    736             emitFastArithImmToInt(MacroAssembler::edx);
    737             m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     732            emitGetArg(instruction[i + 1].u.operand, X86::eax);
     733            emitGetArg(instruction[i + 2].u.operand, X86::edx);
     734            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
     735            emitJumpSlowCaseIfNotImm(X86::edx, i);
     736            emitFastArithImmToInt(X86::edx);
     737            m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    738738            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    739             m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), MacroAssembler::eax);
     739            m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), X86::eax);
    740740            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    741             m_jit.cmpl_rm(MacroAssembler::edx, OBJECT_OFFSET(JSArray, m_fastAccessCutoff), MacroAssembler::eax);
     741            m_jit.cmpl_rm(X86::edx, OBJECT_OFFSET(JSArray, m_fastAccessCutoff), X86::eax);
    742742            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJbe(), i));
    743743
    744             m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), MacroAssembler::eax, MacroAssembler::eax);
    745             m_jit.movl_rm(MacroAssembler::ecx, OBJECT_OFFSET(ArrayStorage, m_vector[0]), MacroAssembler::eax, MacroAssembler::edx, sizeof(JSValue*));
     744            m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::eax);
     745            m_jit.movl_rm(X86::ecx, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::eax, X86::edx, sizeof(JSValue*));
    746746            i += 4;
    747747            break;
     
    752752
    753753            unsigned target = instruction[i + 2].u.operand;
    754             emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    755 
    756             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), MacroAssembler::eax);
     754            emitGetArg(instruction[i + 1].u.operand, X86::eax);
     755
     756            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), X86::eax);
    757757            MacroAssembler::JmpSrc isZero = m_jit.emitUnlinkedJe();
    758             m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, MacroAssembler::eax);
     758            m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    759759            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJne(), i + 2 + target));
    760760
    761             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), MacroAssembler::eax);
     761            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
    762762            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJe(), i + 2 + target));
    763             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), MacroAssembler::eax);
     763            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
    764764            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    765765
     
    777777        }
    778778        case op_negate: {
    779             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     779            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    780780            emitCall(i, Machine::cti_op_negate);
    781781            emitPutResult(instruction[i + 1].u.operand);
     
    795795        case op_pre_dec: {
    796796            int srcDst = instruction[i + 1].u.operand;
    797             emitGetArg(srcDst, MacroAssembler::eax);
    798             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    799             m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), MacroAssembler::eax);
     797            emitGetArg(srcDst, X86::eax);
     798            emitJumpSlowCaseIfNotImm(X86::eax, i);
     799            m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    800800            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    801             emitPutResult(srcDst, MacroAssembler::eax);
     801            emitPutResult(srcDst, X86::eax);
    802802            i += 2;
    803803            break;
     
    807807            JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
    808808            if (src2imm) {
    809                 emitGetArg(instruction[i + 1].u.operand, MacroAssembler::edx);
    810                 emitJumpSlowCaseIfNotImm(MacroAssembler::edx, i);
    811                 m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), MacroAssembler::edx);
     809                emitGetArg(instruction[i + 1].u.operand, X86::edx);
     810                emitJumpSlowCaseIfNotImm(X86::edx, i);
     811                m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx);
    812812                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target));
    813813            } else {
    814                 emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    815                 emitGetArg(instruction[i + 2].u.operand, MacroAssembler::edx);
    816                 emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    817                 emitJumpSlowCaseIfNotImm(MacroAssembler::edx, i);
    818                 m_jit.cmpl_rr(MacroAssembler::edx, MacroAssembler::eax);
     814                emitGetArg(instruction[i + 1].u.operand, X86::eax);
     815                emitGetArg(instruction[i + 2].u.operand, X86::edx);
     816                emitJumpSlowCaseIfNotImm(X86::eax, i);
     817                emitJumpSlowCaseIfNotImm(X86::edx, i);
     818                m_jit.cmpl_rr(X86::edx, X86::eax);
    819819                m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target));
    820820            }
     
    823823        }
    824824        case op_not: {
    825             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    826             m_jit.xorl_i8r(JSImmediate::FullTagTypeBool, MacroAssembler::eax);
    827             m_jit.testl_i32r(JSImmediate::FullTagTypeMask, MacroAssembler::eax); // i8?
     825            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     826            m_jit.xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax);
     827            m_jit.testl_i32r(JSImmediate::FullTagTypeMask, X86::eax); // i8?
    828828            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    829             m_jit.xorl_i8r((JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), MacroAssembler::eax);
     829            m_jit.xorl_i8r((JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax);
    830830            emitPutResult(instruction[i + 1].u.operand);
    831831            i += 3;
     
    834834        case op_jfalse: {
    835835            unsigned target = instruction[i + 2].u.operand;
    836             emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    837 
    838             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), MacroAssembler::eax);
     836            emitGetArg(instruction[i + 1].u.operand, X86::eax);
     837
     838            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), X86::eax);
    839839            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJe(), i + 2 + target));
    840             m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, MacroAssembler::eax);
     840            m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    841841            MacroAssembler::JmpSrc isNonZero = m_jit.emitUnlinkedJne();
    842842
    843             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), MacroAssembler::eax);
     843            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
    844844            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJe(), i + 2 + target));
    845             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), MacroAssembler::eax);
     845            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
    846846            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    847847
     
    852852        case op_post_inc: {
    853853            int srcDst = instruction[i + 2].u.operand;
    854             emitGetArg(srcDst, MacroAssembler::eax);
    855             m_jit.movl_rr(MacroAssembler::eax, MacroAssembler::edx);
    856             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    857             m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), MacroAssembler::edx);
     854            emitGetArg(srcDst, X86::eax);
     855            m_jit.movl_rr(X86::eax, X86::edx);
     856            emitJumpSlowCaseIfNotImm(X86::eax, i);
     857            m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx);
    858858            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    859             emitPutResult(srcDst, MacroAssembler::edx);
     859            emitPutResult(srcDst, X86::edx);
    860860            emitPutResult(instruction[i + 1].u.operand);
    861861            i += 3;
     
    864864        case op_unexpected_load: {
    865865            JSValue* v = m_codeBlock->unexpectedConstants[instruction[i + 2].u.operand];
    866             m_jit.movl_i32r(reinterpret_cast<unsigned>(v), MacroAssembler::eax);
     866            m_jit.movl_i32r(reinterpret_cast<unsigned>(v), X86::eax);
    867867            emitPutResult(instruction[i + 1].u.operand);
    868868            i += 3;
     
    872872            int retAddrDst = instruction[i + 1].u.operand;
    873873            int target = instruction[i + 2].u.operand;
    874             m_jit.movl_i32m(0, sizeof(Register) * retAddrDst, MacroAssembler::edi);
     874            m_jit.movl_i32m(0, sizeof(Register) * retAddrDst, X86::edi);
    875875            MacroAssembler::JmpDst addrPosition = m_jit.label();
    876876            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJmp(), i + 2 + target));
     
    881881        }
    882882        case op_sret: {
    883             m_jit.jmp_m(sizeof(Register) * instruction[i + 1].u.operand, MacroAssembler::edi);
     883            m_jit.jmp_m(sizeof(Register) * instruction[i + 1].u.operand, X86::edi);
    884884            i += 2;
    885885            break;
     
    887887        CTI_COMPILE_BINARY_OP(op_eq)
    888888        case op_lshift: {
    889             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    890             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::ecx);
    891             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    892             emitJumpSlowCaseIfNotImm(MacroAssembler::ecx, i);
    893             emitFastArithImmToInt(MacroAssembler::eax);
    894             emitFastArithImmToInt(MacroAssembler::ecx);
    895             m_jit.shll_CLr(MacroAssembler::eax);
    896             emitFastArithIntToImmOrSlowCase(MacroAssembler::eax, i);
     889            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     890            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
     891            emitJumpSlowCaseIfNotImm(X86::eax, i);
     892            emitJumpSlowCaseIfNotImm(X86::ecx, i);
     893            emitFastArithImmToInt(X86::eax);
     894            emitFastArithImmToInt(X86::ecx);
     895            m_jit.shll_CLr(X86::eax);
     896            emitFastArithIntToImmOrSlowCase(X86::eax, i);
    897897            emitPutResult(instruction[i + 1].u.operand);
    898898            i += 4;
     
    904904            unsigned dst = instruction[i + 1].u.operand;
    905905            if (JSValue* value = getConstantImmediateNumericArg(src1)) {
    906                 emitGetArg(src2, MacroAssembler::eax);
    907                 emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    908                 m_jit.andl_i32r(reinterpret_cast<unsigned>(value), MacroAssembler::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
     906                emitGetArg(src2, X86::eax);
     907                emitJumpSlowCaseIfNotImm(X86::eax, i);
     908                m_jit.andl_i32r(reinterpret_cast<unsigned>(value), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
    909909                emitPutResult(dst);
    910910            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    911                 emitGetArg(src1, MacroAssembler::eax);
    912                 emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    913                 m_jit.andl_i32r(reinterpret_cast<unsigned>(value), MacroAssembler::eax);
     911                emitGetArg(src1, X86::eax);
     912                emitJumpSlowCaseIfNotImm(X86::eax, i);
     913                m_jit.andl_i32r(reinterpret_cast<unsigned>(value), X86::eax);
    914914                emitPutResult(dst);
    915915            } else {
    916                 emitGetArg(src1, MacroAssembler::eax);
    917                 emitGetArg(src2, MacroAssembler::edx);
    918                 m_jit.andl_rr(MacroAssembler::edx, MacroAssembler::eax);
    919                 emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
     916                emitGetArg(src1, X86::eax);
     917                emitGetArg(src2, X86::edx);
     918                m_jit.andl_rr(X86::edx, X86::eax);
     919                emitJumpSlowCaseIfNotImm(X86::eax, i);
    920920                emitPutResult(dst);
    921921            }
     
    924924        }
    925925        case op_rshift: {
    926             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    927             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::ecx);
    928             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    929             emitJumpSlowCaseIfNotImm(MacroAssembler::ecx, i);
    930             emitFastArithImmToInt(MacroAssembler::ecx);
    931             m_jit.sarl_CLr(MacroAssembler::eax);
    932             emitFastArithPotentiallyReTagImmediate(MacroAssembler::eax);
     926            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     927            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
     928            emitJumpSlowCaseIfNotImm(X86::eax, i);
     929            emitJumpSlowCaseIfNotImm(X86::ecx, i);
     930            emitFastArithImmToInt(X86::ecx);
     931            m_jit.sarl_CLr(X86::eax);
     932            emitFastArithPotentiallyReTagImmediate(X86::eax);
    933933            emitPutResult(instruction[i + 1].u.operand);
    934934            i += 4;
     
    936936        }
    937937        case op_bitnot: {
    938             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    939             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    940             m_jit.xorl_i8r(~JSImmediate::TagBitTypeInteger, MacroAssembler::eax);
     938            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     939            emitJumpSlowCaseIfNotImm(X86::eax, i);
     940            m_jit.xorl_i8r(~JSImmediate::TagBitTypeInteger, X86::eax);
    941941            emitPutResult(instruction[i + 1].u.operand);
    942942            i += 3;
     
    948948            emitCall(i, Machine::cti_op_resolve_with_base);
    949949            emitPutResult(instruction[i + 1].u.operand);
    950             emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);
     950            emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax);
    951951            emitPutResult(instruction[i + 2].u.operand);
    952952            i += 4;
     
    962962        }
    963963        case op_mod: {
    964             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    965             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::ecx);
    966             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    967             emitJumpSlowCaseIfNotImm(MacroAssembler::ecx, i);
    968             emitFastArithDeTagImmediate(MacroAssembler::eax);
    969             emitFastArithDeTagImmediate(MacroAssembler::ecx);
     964            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     965            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
     966            emitJumpSlowCaseIfNotImm(X86::eax, i);
     967            emitJumpSlowCaseIfNotImm(X86::ecx, i);
     968            emitFastArithDeTagImmediate(X86::eax);
     969            emitFastArithDeTagImmediate(X86::ecx);
    970970            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), i)); // This is checking if the last detag resulted in a value 0.
    971971            m_jit.cdq();
    972             m_jit.idivl_r(MacroAssembler::ecx);
    973             emitFastArithReTagImmediate(MacroAssembler::edx);
    974             m_jit.movl_rr(MacroAssembler::edx, MacroAssembler::eax);
     972            m_jit.idivl_r(X86::ecx);
     973            emitFastArithReTagImmediate(X86::edx);
     974            m_jit.movl_rr(X86::edx, X86::eax);
    975975            emitPutResult(instruction[i + 1].u.operand);
    976976            i += 4;
     
    979979        case op_jtrue: {
    980980            unsigned target = instruction[i + 2].u.operand;
    981             emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);
    982 
    983             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), MacroAssembler::eax);
     981            emitGetArg(instruction[i + 1].u.operand, X86::eax);
     982
     983            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), X86::eax);
    984984            MacroAssembler::JmpSrc isZero = m_jit.emitUnlinkedJe();
    985             m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, MacroAssembler::eax);
     985            m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    986986            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJne(), i + 2 + target));
    987987
    988             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), MacroAssembler::eax);
     988            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);
    989989            m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJe(), i + 2 + target));
    990             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), MacroAssembler::eax);
     990            m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
    991991            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i));
    992992
     
    999999        case op_post_dec: {
    10001000            int srcDst = instruction[i + 2].u.operand;
    1001             emitGetArg(srcDst, MacroAssembler::eax);
    1002             m_jit.movl_rr(MacroAssembler::eax, MacroAssembler::edx);
    1003             emitJumpSlowCaseIfNotImm(MacroAssembler::eax, i);
    1004             m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), MacroAssembler::edx);
     1001            emitGetArg(srcDst, X86::eax);
     1002            m_jit.movl_rr(X86::eax, X86::edx);
     1003            emitJumpSlowCaseIfNotImm(X86::eax, i);
     1004            m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx);
    10051005            m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
    1006             emitPutResult(srcDst, MacroAssembler::edx);
     1006            emitPutResult(srcDst, X86::edx);
    10071007            emitPutResult(instruction[i + 1].u.operand);
    10081008            i += 3;
     
    10111011        CTI_COMPILE_BINARY_OP(op_urshift)
    10121012        case op_bitxor: {
    1013             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    1014             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::edx);
    1015             emitJumpSlowCaseIfNotImms(MacroAssembler::eax, MacroAssembler::edx, i);
    1016             m_jit.xorl_rr(MacroAssembler::edx, MacroAssembler::eax);
    1017             emitFastArithReTagImmediate(MacroAssembler::eax);
     1013            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     1014            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     1015            emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     1016            m_jit.xorl_rr(X86::edx, X86::eax);
     1017            emitFastArithReTagImmediate(X86::eax);
    10181018            emitPutResult(instruction[i + 1].u.operand);
    10191019            i += 4;
     
    10291029        }
    10301030        case op_bitor: {
    1031             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    1032             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::edx);
    1033             emitJumpSlowCaseIfNotImms(MacroAssembler::eax, MacroAssembler::edx, i);
    1034             m_jit.orl_rr(MacroAssembler::edx, MacroAssembler::eax);
     1031            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     1032            emitGetArg(instruction[i + 3].u.operand, X86::edx);
     1033            emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i);
     1034            m_jit.orl_rr(X86::edx, X86::eax);
    10351035            emitPutResult(instruction[i + 1].u.operand);
    10361036            i += 4;
     
    10431043        }
    10441044        case op_throw: {
    1045             emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);
     1045            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    10461046            emitCall(i, Machine::cti_op_throw);
    1047             m_jit.addl_i8r(0x24, MacroAssembler::esp);
    1048             m_jit.popl_r(MacroAssembler::edi);
    1049             m_jit.popl_r(MacroAssembler::esi);
     1047            m_jit.addl_i8r(0x24, X86::esp);
     1048            m_jit.popl_r(X86::edi);
     1049            m_jit.popl_r(X86::esi);
    10501050            m_jit.ret();
    10511051            i += 2;
     
    10531053        }
    10541054        case op_get_pnames: {
    1055             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     1055            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    10561056            emitCall(i, Machine::cti_op_get_pnames);
    10571057            emitPutResult(instruction[i + 1].u.operand);
     
    10601060        }
    10611061        case op_next_pname: {
    1062             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     1062            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    10631063            unsigned target = instruction[i + 3].u.operand;
    10641064            emitCall(i, Machine::cti_op_next_pname);
    1065             m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1065            m_jit.testl_rr(X86::eax, X86::eax);
    10661066            MacroAssembler::JmpSrc endOfIter = m_jit.emitUnlinkedJe();
    10671067            emitPutResult(instruction[i + 1].u.operand);
     
    10721072        }
    10731073        case op_push_scope: {
    1074             emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);
     1074            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    10751075            emitCall(i, Machine::cti_op_push_scope);
    10761076            i += 2;
     
    10831083        }
    10841084        case op_typeof: {
    1085             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     1085            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    10861086            emitCall(i, Machine::cti_op_typeof);
    10871087            emitPutResult(instruction[i + 1].u.operand);
     
    10921092        CTI_COMPILE_BINARY_OP(op_nstricteq)
    10931093        case op_to_jsnumber: {
    1094             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     1094            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    10951095            emitCall(i, Machine::cti_op_to_jsnumber);
    10961096            emitPutResult(instruction[i + 1].u.operand);
     
    10991099        }
    11001100        case op_in: {
    1101             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
    1102             emitGetPutArg(instruction[i + 3].u.operand, 4, MacroAssembler::ecx);
     1101            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
     1102            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    11031103            emitCall(i, Machine::cti_op_in);
    11041104            emitPutResult(instruction[i + 1].u.operand);
     
    11091109            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]);
    11101110            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0);
    1111             emitGetPutArg(instruction[i + 3].u.operand, 4, MacroAssembler::ecx);
     1111            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    11121112            emitCall(i, Machine::cti_op_push_new_scope);
    11131113            emitPutResult(instruction[i + 1].u.operand);
     
    11161116        }
    11171117        case op_catch: {
    1118             emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r
    1119             emitGetCTIParam(CTI_ARGS_exec, MacroAssembler::ecx);
    1120             m_jit.movl_mr(OBJECT_OFFSET(ExecState, m_exception), MacroAssembler::ecx, MacroAssembler::eax);
    1121             m_jit.movl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), MacroAssembler::ecx);
     1118            emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     1119            emitGetCTIParam(CTI_ARGS_exec, X86::ecx);
     1120            m_jit.movl_mr(OBJECT_OFFSET(ExecState, m_exception), X86::ecx, X86::eax);
     1121            m_jit.movl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), X86::ecx);
    11221122            emitPutResult(instruction[i + 1].u.operand);
    11231123            i += 2;
     
    11341134        }
    11351135        case op_put_by_index: {
    1136             emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);
     1136            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    11371137            emitPutArgConstant(instruction[i + 2].u.operand, 4);
    1138             emitGetPutArg(instruction[i + 3].u.operand, 8, MacroAssembler::ecx);
     1138            emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx);
    11391139            emitCall(i, Machine::cti_op_put_by_index);
    11401140            i += 4;
     
    11511151            jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size());
    11521152
    1153             emitGetPutArg(scrutinee, 0, MacroAssembler::ecx);
     1153            emitGetPutArg(scrutinee, 0, X86::ecx);
    11541154            emitPutArgConstant(tableIndex, 4);
    11551155            emitCall(i, Machine::cti_op_switch_imm);
    1156             m_jit.jmp_r(MacroAssembler::eax);
     1156            m_jit.jmp_r(X86::eax);
    11571157            i += 4;
    11581158            break;
     
    11681168            jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size());
    11691169
    1170             emitGetPutArg(scrutinee, 0, MacroAssembler::ecx);
     1170            emitGetPutArg(scrutinee, 0, X86::ecx);
    11711171            emitPutArgConstant(tableIndex, 4);
    11721172            emitCall(i, Machine::cti_op_switch_char);
    1173             m_jit.jmp_r(MacroAssembler::eax);
     1173            m_jit.jmp_r(X86::eax);
    11741174            i += 4;
    11751175            break;
     
    11841184            m_switches.append(SwitchRecord(jumpTable, i, defaultOffset));
    11851185
    1186             emitGetPutArg(scrutinee, 0, MacroAssembler::ecx);
     1186            emitGetPutArg(scrutinee, 0, X86::ecx);
    11871187            emitPutArgConstant(tableIndex, 4);
    11881188            emitCall(i, Machine::cti_op_switch_string);
    1189             m_jit.jmp_r(MacroAssembler::eax);
     1189            m_jit.jmp_r(X86::eax);
    11901190            i += 4;
    11911191            break;
    11921192        }
    11931193        case op_del_by_val: {
    1194             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
    1195             emitGetPutArg(instruction[i + 3].u.operand, 4, MacroAssembler::ecx);
     1194            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
     1195            emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx);
    11961196            emitCall(i, Machine::cti_op_del_by_val);
    11971197            emitPutResult(instruction[i + 1].u.operand);
     
    12001200        }
    12011201        case op_put_getter: {
    1202             emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);
     1202            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    12031203            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]);
    12041204            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    1205             emitGetPutArg(instruction[i + 3].u.operand, 8, MacroAssembler::ecx);
     1205            emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx);
    12061206            emitCall(i, Machine::cti_op_put_getter);
    12071207            i += 4;
     
    12091209        }
    12101210        case op_put_setter: {
    1211             emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);
     1211            emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx);
    12121212            Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]);
    12131213            emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4);
    1214             emitGetPutArg(instruction[i + 3].u.operand, 8, MacroAssembler::ecx);
     1214            emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx);
    12151215            emitCall(i, Machine::cti_op_put_setter);
    12161216            i += 4;
     
    12361236        }
    12371237        case op_eq_null: {
    1238             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     1238            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    12391239            emitCall(i, Machine::cti_op_eq_null);
    12401240            emitPutResult(instruction[i + 1].u.operand);
     
    12431243        }
    12441244        case op_neq_null: {
    1245             emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);
     1245            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    12461246            emitCall(i, Machine::cti_op_neq_null);
    12471247            emitPutResult(instruction[i + 1].u.operand);
     
    12861286                    MacroAssembler::JmpSrc notImm = iter->from;
    12871287                    m_jit.link((++iter)->from, m_jit.label());
    1288                     m_jit.subl_i32r(getDeTaggedConstantImmediate(value), MacroAssembler::eax);
     1288                    m_jit.subl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
    12891289                    m_jit.link(notImm, m_jit.label());
    1290                     emitPutArg(MacroAssembler::eax, 0);
    1291                     emitGetPutArg(src2, 4, MacroAssembler::ecx);
     1290                    emitPutArg(X86::eax, 0);
     1291                    emitGetPutArg(src2, 4, X86::ecx);
    12921292                    emitCall(i, Machine::cti_op_add);
    12931293                    emitPutResult(dst);
     
    13011301            MacroAssembler::JmpSrc notImm = iter->from;
    13021302            m_jit.link((++iter)->from, m_jit.label());
    1303             m_jit.subl_rr(MacroAssembler::edx, MacroAssembler::eax);
    1304             emitFastArithReTagImmediate(MacroAssembler::eax);
     1303            m_jit.subl_rr(X86::edx, X86::eax);
     1304            emitFastArithReTagImmediate(X86::eax);
    13051305            m_jit.link(notImm, m_jit.label());
    1306             emitPutArg(MacroAssembler::eax, 0);
    1307             emitPutArg(MacroAssembler::edx, 4);
     1306            emitPutArg(X86::eax, 0);
     1307            emitPutArg(X86::edx, 4);
    13081308            emitCall(i, Machine::cti_op_add);
    13091309            emitPutResult(dst);
     
    13161316            m_jit.link((++iter)->from, m_jit.label());
    13171317            m_jit.link((++iter)->from, m_jit.label());
    1318             emitFastArithIntToImmNoCheck(MacroAssembler::edx);
     1318            emitFastArithIntToImmNoCheck(X86::edx);
    13191319            m_jit.link(notImm, m_jit.label());
    1320             emitPutArg(MacroAssembler::eax, 0);
    1321             emitPutArg(MacroAssembler::edx, 4);
     1320            emitPutArg(X86::eax, 0);
     1321            emitPutArg(X86::edx, 4);
    13221322            emitCall(i, Machine::cti_op_get_by_val);
    13231323            emitPutResult(instruction[i + 1].u.operand);
     
    13281328            MacroAssembler::JmpSrc notImm = iter->from;
    13291329            m_jit.link((++iter)->from, m_jit.label());
    1330             m_jit.addl_rr(MacroAssembler::edx, MacroAssembler::eax);
     1330            m_jit.addl_rr(X86::edx, X86::eax);
    13311331            m_jit.link(notImm, m_jit.label());
    1332             emitPutArg(MacroAssembler::eax, 0);
    1333             emitPutArg(MacroAssembler::edx, 4);
     1332            emitPutArg(X86::eax, 0);
     1333            emitPutArg(X86::edx, 4);
    13341334            emitCall(i, Machine::cti_op_sub);
    13351335            emitPutResult(instruction[i + 1].u.operand);
     
    13401340            m_jit.link(iter->from, m_jit.label());
    13411341            m_jit.link((++iter)->from, m_jit.label());
    1342             emitPutArg(MacroAssembler::eax, 0);
    1343             emitPutArg(MacroAssembler::ecx, 4);
     1342            emitPutArg(X86::eax, 0);
     1343            emitPutArg(X86::ecx, 4);
    13441344            emitCall(i, Machine::cti_op_rshift);
    13451345            emitPutResult(instruction[i + 1].u.operand);
     
    13511351            MacroAssembler::JmpSrc notImm2 = (++iter)->from;
    13521352            m_jit.link((++iter)->from, m_jit.label());
    1353             emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);
    1354             emitGetArg(instruction[i + 3].u.operand, MacroAssembler::ecx);
     1353            emitGetArg(instruction[i + 2].u.operand, X86::eax);
     1354            emitGetArg(instruction[i + 3].u.operand, X86::ecx);
    13551355            m_jit.link(notImm1, m_jit.label());
    13561356            m_jit.link(notImm2, m_jit.label());
    1357             emitPutArg(MacroAssembler::eax, 0);
    1358             emitPutArg(MacroAssembler::ecx, 4);
     1357            emitPutArg(X86::eax, 0);
     1358            emitPutArg(X86::ecx, 4);
    13591359            emitCall(i, Machine::cti_op_lshift);
    13601360            emitPutResult(instruction[i + 1].u.operand);
     
    13691369            if (src2imm) {
    13701370                m_jit.link(iter->from, m_jit.label());
    1371                 emitPutArg(MacroAssembler::edx, 0);
    1372                 emitGetPutArg(instruction[i + 2].u.operand, 4, MacroAssembler::ecx);
     1371                emitPutArg(X86::edx, 0);
     1372                emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx);
    13731373                emitCall(i, Machine::cti_op_loop_if_less);
    1374                 m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1374                m_jit.testl_rr(X86::eax, X86::eax);
    13751375                m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]);
    13761376            } else {
    13771377                m_jit.link(iter->from, m_jit.label());
    13781378                m_jit.link((++iter)->from, m_jit.label());
    1379                 emitPutArg(MacroAssembler::eax, 0);
    1380                 emitPutArg(MacroAssembler::edx, 4);
     1379                emitPutArg(X86::eax, 0);
     1380                emitPutArg(X86::edx, 4);
    13811381                emitCall(i, Machine::cti_op_loop_if_less);
    1382                 m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1382                m_jit.testl_rr(X86::eax, X86::eax);
    13831383                m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]);
    13841384            }
     
    13901390            MacroAssembler::JmpSrc notImm = iter->from;
    13911391            m_jit.link((++iter)->from, m_jit.label());
    1392             m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), MacroAssembler::eax);
     1392            m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    13931393            m_jit.link(notImm, m_jit.label());
    1394             emitPutArg(MacroAssembler::eax, 0);
     1394            emitPutArg(X86::eax, 0);
    13951395            emitCall(i, Machine::cti_op_pre_inc);
    13961396            emitPutResult(srcDst);
     
    14031403            m_jit.link((++iter)->from, m_jit.label());
    14041404            m_jit.link((++iter)->from, m_jit.label());
    1405             emitFastArithIntToImmNoCheck(MacroAssembler::edx);
     1405            emitFastArithIntToImmNoCheck(X86::edx);
    14061406            m_jit.link(notImm, m_jit.label());
    1407             emitPutArg(MacroAssembler::eax, 0);
    1408             emitPutArg(MacroAssembler::edx, 4);
    1409             emitPutArg(MacroAssembler::ecx, 8);
     1407            emitPutArg(X86::eax, 0);
     1408            emitPutArg(X86::edx, 4);
     1409            emitPutArg(X86::ecx, 8);
    14101410            emitCall(i, Machine::cti_op_put_by_val);
    14111411            i += 4;
     
    14161416
    14171417            m_jit.link(iter->from, m_jit.label());
    1418             emitPutArg(MacroAssembler::eax, 0);
     1418            emitPutArg(X86::eax, 0);
    14191419            emitCall(i, Machine::cti_op_jtrue);
    1420             m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1420            m_jit.testl_rr(X86::eax, X86::eax);
    14211421            unsigned target = instruction[i + 2].u.operand;
    14221422            m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 2 + target]);
     
    14281428            MacroAssembler::JmpSrc notImm = iter->from;
    14291429            m_jit.link((++iter)->from, m_jit.label());
    1430             m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), MacroAssembler::eax);
     1430            m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    14311431            m_jit.link(notImm, m_jit.label());
    1432             emitPutArg(MacroAssembler::eax, 0);
     1432            emitPutArg(X86::eax, 0);
    14331433            emitCall(i, Machine::cti_op_pre_dec);
    14341434            emitPutResult(srcDst);
     
    14411441            if (src2imm) {
    14421442                m_jit.link(iter->from, m_jit.label());
    1443                 emitPutArg(MacroAssembler::edx, 0);
    1444                 emitGetPutArg(instruction[i + 2].u.operand, 4, MacroAssembler::ecx);
     1443                emitPutArg(X86::edx, 0);
     1444                emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx);
    14451445                emitCall(i, Machine::cti_op_jless);
    1446                 m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1446                m_jit.testl_rr(X86::eax, X86::eax);
    14471447                m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]);
    14481448            } else {
    14491449                m_jit.link(iter->from, m_jit.label());
    14501450                m_jit.link((++iter)->from, m_jit.label());
    1451                 emitPutArg(MacroAssembler::eax, 0);
    1452                 emitPutArg(MacroAssembler::edx, 4);
     1451                emitPutArg(X86::eax, 0);
     1452                emitPutArg(X86::edx, 4);
    14531453                emitCall(i, Machine::cti_op_jless);
    1454                 m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1454                m_jit.testl_rr(X86::eax, X86::eax);
    14551455                m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]);
    14561456            }
     
    14601460        case op_not: {
    14611461            m_jit.link(iter->from, m_jit.label());
    1462             m_jit.xorl_i8r(JSImmediate::FullTagTypeBool, MacroAssembler::eax);
    1463             emitPutArg(MacroAssembler::eax, 0);
     1462            m_jit.xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax);
     1463            emitPutArg(X86::eax, 0);
    14641464            emitCall(i, Machine::cti_op_not);
    14651465            emitPutResult(instruction[i + 1].u.operand);
     
    14691469        case op_jfalse: {
    14701470            m_jit.link(iter->from, m_jit.label());
    1471             emitPutArg(MacroAssembler::eax, 0);
     1471            emitPutArg(X86::eax, 0);
    14721472            emitCall(i, Machine::cti_op_jtrue);
    1473             m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1473            m_jit.testl_rr(X86::eax, X86::eax);
    14741474            unsigned target = instruction[i + 2].u.operand;
    14751475            m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 2 + target]); // inverted!
     
    14811481            m_jit.link(iter->from, m_jit.label());
    14821482            m_jit.link((++iter)->from, m_jit.label());
    1483             emitPutArg(MacroAssembler::eax, 0);
     1483            emitPutArg(X86::eax, 0);
    14841484            emitCall(i, Machine::cti_op_post_inc);
    14851485            emitPutResult(instruction[i + 1].u.operand);
    1486             emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);
     1486            emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax);
    14871487            emitPutResult(srcDst);
    14881488            i += 3;
     
    14911491        case op_bitnot: {
    14921492            m_jit.link(iter->from, m_jit.label());
    1493             emitPutArg(MacroAssembler::eax, 0);
     1493            emitPutArg(X86::eax, 0);
    14941494            emitCall(i, Machine::cti_op_bitnot);
    14951495            emitPutResult(instruction[i + 1].u.operand);
     
    15031503            if (getConstantImmediateNumericArg(src1)) {
    15041504                m_jit.link(iter->from, m_jit.label());
    1505                 emitGetPutArg(src1, 0, MacroAssembler::ecx);
    1506                 emitPutArg(MacroAssembler::eax, 4);
     1505                emitGetPutArg(src1, 0, X86::ecx);
     1506                emitPutArg(X86::eax, 4);
    15071507                emitCall(i, Machine::cti_op_bitand);
    15081508                emitPutResult(dst);
    15091509            } else if (getConstantImmediateNumericArg(src2)) {
    15101510                m_jit.link(iter->from, m_jit.label());
    1511                 emitPutArg(MacroAssembler::eax, 0);
    1512                 emitGetPutArg(src2, 4, MacroAssembler::ecx);
     1511                emitPutArg(X86::eax, 0);
     1512                emitGetPutArg(src2, 4, X86::ecx);
    15131513                emitCall(i, Machine::cti_op_bitand);
    15141514                emitPutResult(dst);
    15151515            } else {
    15161516                m_jit.link(iter->from, m_jit.label());
    1517                 emitGetPutArg(src1, 0, MacroAssembler::ecx);
    1518                 emitPutArg(MacroAssembler::edx, 4);
     1517                emitGetPutArg(src1, 0, X86::ecx);
     1518                emitPutArg(X86::edx, 4);
    15191519                emitCall(i, Machine::cti_op_bitand);
    15201520                emitPutResult(dst);
     
    15251525        case op_jtrue: {
    15261526            m_jit.link(iter->from, m_jit.label());
    1527             emitPutArg(MacroAssembler::eax, 0);
     1527            emitPutArg(X86::eax, 0);
    15281528            emitCall(i, Machine::cti_op_jtrue);
    1529             m_jit.testl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1529            m_jit.testl_rr(X86::eax, X86::eax);
    15301530            unsigned target = instruction[i + 2].u.operand;
    15311531            m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 2 + target]);
     
    15371537            m_jit.link(iter->from, m_jit.label());
    15381538            m_jit.link((++iter)->from, m_jit.label());
    1539             emitPutArg(MacroAssembler::eax, 0);
     1539            emitPutArg(X86::eax, 0);
    15401540            emitCall(i, Machine::cti_op_post_dec);
    15411541            emitPutResult(instruction[i + 1].u.operand);
    1542             emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);
     1542            emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax);
    15431543            emitPutResult(srcDst);
    15441544            i += 3;
     
    15471547        case op_bitxor: {
    15481548            m_jit.link(iter->from, m_jit.label());
    1549             emitPutArg(MacroAssembler::eax, 0);
    1550             emitPutArg(MacroAssembler::edx, 4);
     1549            emitPutArg(X86::eax, 0);
     1550            emitPutArg(X86::edx, 4);
    15511551            emitCall(i, Machine::cti_op_bitxor);
    15521552            emitPutResult(instruction[i + 1].u.operand);
     
    15561556        case op_bitor: {
    15571557            m_jit.link(iter->from, m_jit.label());
    1558             emitPutArg(MacroAssembler::eax, 0);
    1559             emitPutArg(MacroAssembler::edx, 4);
     1558            emitPutArg(X86::eax, 0);
     1559            emitPutArg(X86::edx, 4);
    15601560            emitCall(i, Machine::cti_op_bitor);
    15611561            emitPutResult(instruction[i + 1].u.operand);
     
    15671567            MacroAssembler::JmpSrc notImm2 = (++iter)->from;
    15681568            m_jit.link((++iter)->from, m_jit.label());
    1569             emitFastArithReTagImmediate(MacroAssembler::eax);
    1570             emitFastArithReTagImmediate(MacroAssembler::ecx);
     1569            emitFastArithReTagImmediate(X86::eax);
     1570            emitFastArithReTagImmediate(X86::ecx);
    15711571            m_jit.link(notImm1, m_jit.label());
    15721572            m_jit.link(notImm2, m_jit.label());
    1573             emitPutArg(MacroAssembler::eax, 0);
    1574             emitPutArg(MacroAssembler::ecx, 4);
     1573            emitPutArg(X86::eax, 0);
     1574            emitPutArg(X86::ecx, 4);
    15751575            emitCall(i, Machine::cti_op_mod);
    15761576            emitPutResult(instruction[i + 1].u.operand);
     
    15901590{
    15911591    // Could use a popl_m, but would need to offset the following instruction if so.
    1592     m_jit.popl_r(MacroAssembler::ecx);
    1593     emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r
    1594     emitPutToCallFrameHeader(MacroAssembler::ecx, RegisterFile::CTIReturnEIP);
     1592    m_jit.popl_r(X86::ecx);
     1593    emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     1594    emitPutToCallFrameHeader(X86::ecx, RegisterFile::CTIReturnEIP);
    15951595
    15961596    privateCompileMainPass();
     
    16521652{
    16531653    // Check eax is an object of the right StructureID.
    1654     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     1654    m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    16551655    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
    1656     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), MacroAssembler::eax);
     1656    m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
    16571657    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
    16581658
    16591659    // Checks out okay! - getDirectOffset
    1660     m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), MacroAssembler::eax, MacroAssembler::eax);
    1661     m_jit.movl_mr(cachedOffset * sizeof(JSValue*), MacroAssembler::eax, MacroAssembler::eax);
     1660    m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
     1661    m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::eax, X86::eax);
    16621662    m_jit.ret();
    16631663
     
    16791679    JSObject* protoObject = static_cast<JSObject*>(structureID->prototype());
    16801680    OwnArrayPtr<JSValue*>* protoPropertyStorage = &protoObject->m_propertyStorage;
    1681     m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), MacroAssembler::edx);
     1681    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
    16821682
    16831683    // check eax is an object of the right StructureID.
    1684     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     1684    m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    16851685    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
    1686     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), MacroAssembler::eax);
     1686    m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
    16871687    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
    16881688
     
    16931693
    16941694    // Checks out okay! - getDirectOffset
    1695     m_jit.movl_mr(cachedOffset * sizeof(JSValue*), MacroAssembler::edx, MacroAssembler::eax);
     1695    m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax);
    16961696
    16971697    m_jit.ret();
     
    17161716
    17171717    // Check eax is an object of the right StructureID.
    1718     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     1718    m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    17191719    bucketsOfFail.append(m_jit.emitUnlinkedJne());
    1720     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), MacroAssembler::eax);
     1720    m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
    17211721    bucketsOfFail.append(m_jit.emitUnlinkedJne());
    17221722
     
    17361736 
    17371737    OwnArrayPtr<JSValue*>* protoPropertyStorage = &static_cast<JSObject*>(protoObject)->m_propertyStorage;
    1738     m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), MacroAssembler::edx);
    1739     m_jit.movl_mr(cachedOffset * sizeof(JSValue*), MacroAssembler::edx, MacroAssembler::eax);
     1738    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     1739    m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax);
    17401740    m_jit.ret();
    17411741
     
    17541754{
    17551755    // check eax is an object of the right StructureID.
    1756     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     1756    m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    17571757    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
    1758     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), MacroAssembler::eax);
     1758    m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
    17591759    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
    17601760
    17611761    // checks out okay! - putDirectOffset
    1762     m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), MacroAssembler::eax, MacroAssembler::eax);
    1763     m_jit.movl_rm(MacroAssembler::edx, cachedOffset * sizeof(JSValue*), MacroAssembler::eax);
     1762    m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
     1763    m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax);
    17641764    m_jit.ret();
    17651765
     
    17781778{
    17791779    // Check eax is an array
    1780     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     1780    m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    17811781    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
    1782     m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), MacroAssembler::eax);
     1782    m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), X86::eax);
    17831783    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
    17841784
    17851785    // Checks out okay! - get the length from the storage
    1786     m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), MacroAssembler::eax, MacroAssembler::eax);
    1787     m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_length), MacroAssembler::eax, MacroAssembler::eax);
    1788 
    1789     m_jit.addl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1786    m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::eax);
     1787    m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_length), X86::eax, X86::eax);
     1788
     1789    m_jit.addl_rr(X86::eax, X86::eax);
    17901790    MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo();
    1791     m_jit.addl_i8r(1, MacroAssembler::eax);
     1791    m_jit.addl_i8r(1, X86::eax);
    17921792   
    17931793    m_jit.ret();
     
    18061806{
    18071807    // Check eax is a string
    1808     m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);
     1808    m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
    18091809    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
    1810     m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringVptr), MacroAssembler::eax);
     1810    m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringVptr), X86::eax);
    18111811    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
    18121812
    18131813    // Checks out okay! - get the length from the Ustring.
    1814     m_jit.movl_mr(OBJECT_OFFSET(JSString, m_value) + OBJECT_OFFSET(UString, m_rep), MacroAssembler::eax, MacroAssembler::eax);
    1815     m_jit.movl_mr(OBJECT_OFFSET(UString::Rep, len), MacroAssembler::eax, MacroAssembler::eax);
    1816 
    1817     m_jit.addl_rr(MacroAssembler::eax, MacroAssembler::eax);
     1814    m_jit.movl_mr(OBJECT_OFFSET(JSString, m_value) + OBJECT_OFFSET(UString, m_rep), X86::eax, X86::eax);
     1815    m_jit.movl_mr(OBJECT_OFFSET(UString::Rep, len), X86::eax, X86::eax);
     1816
     1817    m_jit.addl_rr(X86::eax, X86::eax);
    18181818    MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo();
    1819     m_jit.addl_i8r(1, MacroAssembler::eax);
     1819    m_jit.addl_i8r(1, X86::eax);
    18201820   
    18211821    m_jit.ret();
     
    18561856                    + 3 * sizeof(void*)
    18571857#endif
    1858                     , MacroAssembler::esp, WRECGenerator::outputRegister);
     1858                    , X86::esp, WRECGenerator::outputRegister);
    18591859   
    18601860    // restart point on match fail.
     
    18821882
    18831883    jit.movl_rm(WRECGenerator::currentPositionRegister, 4, WRECGenerator::outputRegister);
    1884     jit.popl_r(MacroAssembler::eax);
    1885     jit.movl_rm(MacroAssembler::eax, WRECGenerator::outputRegister);
     1884    jit.popl_r(X86::eax);
     1885    jit.movl_rm(X86::eax, WRECGenerator::outputRegister);
    18861886    jit.popl_r(WRECGenerator::currentValueRegister);
    18871887    jit.popl_r(WRECGenerator::outputRegister);
     
    18901890    jit.link(noOutput, jit.label());
    18911891   
    1892     jit.popl_r(MacroAssembler::eax);
    1893     jit.movl_rm(MacroAssembler::eax, WRECGenerator::outputRegister);
     1892    jit.popl_r(X86::eax);
     1893    jit.movl_rm(X86::eax, WRECGenerator::outputRegister);
    18941894    jit.popl_r(WRECGenerator::currentValueRegister);
    18951895    jit.popl_r(WRECGenerator::outputRegister);
     
    19041904    failures.clear();
    19051905
    1906     jit.movl_mr(MacroAssembler::esp, WRECGenerator::currentPositionRegister);
     1906    jit.movl_mr(X86::esp, WRECGenerator::currentPositionRegister);
    19071907    jit.addl_i8r(1, WRECGenerator::currentPositionRegister);
    1908     jit.movl_rm(WRECGenerator::currentPositionRegister, MacroAssembler::esp);
     1908    jit.movl_rm(WRECGenerator::currentPositionRegister, X86::esp);
    19091909    jit.cmpl_rr(WRECGenerator::lengthRegister, WRECGenerator::currentPositionRegister);
    19101910    jit.link(jit.emitUnlinkedJle(), nextLabel);
    19111911
    1912     jit.addl_i8r(4, MacroAssembler::esp);
    1913 
    1914     jit.movl_i32r(-1, MacroAssembler::eax);
     1912    jit.addl_i8r(4, X86::esp);
     1913
     1914    jit.movl_i32r(-1, X86::eax);
    19151915    jit.popl_r(WRECGenerator::currentValueRegister);
    19161916    jit.popl_r(WRECGenerator::outputRegister);
Note: See TracChangeset for help on using the changeset viewer.