Changeset 36307 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 9, 2008, 6:11:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r36301 r36307 115 115 m_jit.movl_i32r(reinterpret_cast<unsigned>(js), dst); 116 116 } else 117 m_jit.movl_mr(src * sizeof(Register), MacroAssembler::edi, dst);117 m_jit.movl_mr(src * sizeof(Register), X86::edi, dst); 118 118 } 119 119 … … 123 123 if (src < m_codeBlock->constantRegisters.size()) { 124 124 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); 126 126 } 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); 129 129 } 130 130 } … … 133 133 ALWAYS_INLINE void CTI::emitPutArg(MacroAssembler::RegisterID src, unsigned offset) 134 134 { 135 m_jit.movl_rm(src, offset + sizeof(void*), MacroAssembler::esp);135 m_jit.movl_rm(src, offset + sizeof(void*), X86::esp); 136 136 } 137 137 138 138 ALWAYS_INLINE void CTI::emitPutArgConstant(unsigned value, unsigned offset) 139 139 { 140 m_jit.movl_i32m(value, offset + sizeof(void*), MacroAssembler::esp);140 m_jit.movl_i32m(value, offset + sizeof(void*), X86::esp); 141 141 } 142 142 … … 152 152 ALWAYS_INLINE void CTI::emitPutCTIParam(MacroAssembler::RegisterID from, unsigned name) 153 153 { 154 m_jit.movl_rm(from, name * sizeof(void*), MacroAssembler::esp);154 m_jit.movl_rm(from, name * sizeof(void*), X86::esp); 155 155 } 156 156 157 157 ALWAYS_INLINE void CTI::emitGetCTIParam(unsigned name, MacroAssembler::RegisterID to) 158 158 { 159 m_jit.movl_mr(name * sizeof(void*), MacroAssembler::esp, to);159 m_jit.movl_mr(name * sizeof(void*), X86::esp, to); 160 160 } 161 161 162 162 ALWAYS_INLINE void CTI::emitPutToCallFrameHeader(MacroAssembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry) 163 163 { 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); 165 165 } 166 166 167 167 ALWAYS_INLINE void CTI::emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, MacroAssembler::RegisterID to) 168 168 { 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); 170 170 } 171 171 172 172 ALWAYS_INLINE void CTI::emitPutResult(unsigned dst, MacroAssembler::RegisterID from) 173 173 { 174 m_jit.movl_rm(from, dst * sizeof(Register), MacroAssembler::edi);174 m_jit.movl_rm(from, dst * sizeof(Register), X86::edi); 175 175 // FIXME: #ifndef NDEBUG, Write the correct m_type to the register. 176 176 } … … 200 200 ALWAYS_INLINE void CTI::emitDebugExceptionCheck() 201 201 { 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); 204 204 MacroAssembler::JmpSrc noException = m_jit.emitUnlinkedJe(); 205 205 m_jit.emitInt3(); … … 311 311 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImms(MacroAssembler::RegisterID reg1, MacroAssembler::RegisterID reg2, unsigned opcodeIndex) 312 312 { 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); 316 316 } 317 317 … … 367 367 #define CTI_COMPILE_BINARY_OP(name) \ 368 368 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); \ 371 371 emitCall(i, Machine::cti_##name); \ 372 372 emitPutResult(instruction[i + 1].u.operand); \ … … 394 394 emitPutArgConstant(reinterpret_cast<unsigned>(m_exec->globalThisValue()), 4); 395 395 } else 396 emitGetPutArg(thisVal, 4, MacroAssembler::ecx);396 emitGetPutArg(thisVal, 4, X86::ecx); 397 397 } 398 398 399 399 MacroAssembler::JmpSrc wasEval; 400 400 if (type == OpCallEval) { 401 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);401 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 402 402 emitCall(i, Machine::cti_op_call_eval); 403 403 m_jit.emitRestoreArgumentReference(); 404 404 405 emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r406 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); 408 408 wasEval = m_jit.emitUnlinkedJne(); 409 409 410 410 // 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); 412 412 } else { 413 413 // 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); 416 416 } 417 417 418 418 // Fast check for JS function. 419 m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::ecx);419 m_jit.testl_i32r(JSImmediate::TagMask, X86::ecx); 420 420 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); 422 422 MacroAssembler::JmpSrc isJSFunction = m_jit.emitUnlinkedJe(); 423 423 m_jit.link(isNotObject, m_jit.label()); … … 425 425 // This handles host functions 426 426 emitCall(i, ((type == OpConstruct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction)); 427 emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r427 emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r 428 428 429 429 MacroAssembler::JmpSrc wasNotJSFunction = m_jit.emitUnlinkedJmp(); … … 432 432 // This handles JSFunctions 433 433 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 := r434 m_jit.call_r(X86::eax); 435 emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r 436 436 437 437 MacroAssembler::JmpDst end = m_jit.label(); … … 445 445 void CTI::emitSlowScriptCheck(unsigned opcodeIndex) 446 446 { 447 m_jit.subl_i8r(1, MacroAssembler::esi);447 m_jit.subl_i8r(1, X86::esi); 448 448 MacroAssembler::JmpSrc skipTimeout = m_jit.emitUnlinkedJne(); 449 449 emitCall(opcodeIndex, Machine::cti_timeout_check); 450 450 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); 455 455 m_jit.link(skipTimeout, m_jit.label()); 456 456 } … … 474 474 unsigned src = instruction[i + 2].u.operand; 475 475 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); 477 477 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); 480 480 i += 3; 481 481 break; … … 488 488 JSValue* value = m_codeBlock->constantRegisters[src2].jsValue(m_exec); 489 489 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); 493 493 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 494 494 emitPutResult(dst); … … 497 497 } 498 498 } 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); 504 504 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 505 505 emitPutResult(dst); … … 507 507 break; 508 508 } 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); 511 511 emitCall(i, Machine::cti_op_add); 512 512 emitPutResult(instruction[i + 1].u.operand); … … 517 517 if (m_codeBlock->needsFullScopeChain) 518 518 emitCall(i, Machine::cti_op_end); 519 emitGetArg(instruction[i + 1].u.operand, MacroAssembler::eax);519 emitGetArg(instruction[i + 1].u.operand, X86::eax); 520 520 #if ENABLE(SAMPLING_TOOL) 521 521 m_jit.movl_i32m(-1, &what); 522 522 #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); 524 524 m_jit.ret(); 525 525 i += 2; … … 534 534 case op_pre_inc: { 535 535 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); 539 539 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 540 emitPutResult(srcDst, MacroAssembler::eax);540 emitPutResult(srcDst, X86::eax); 541 541 i += 2; 542 542 break; … … 556 556 JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand); 557 557 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); 561 561 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target)); 562 562 } 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); 568 568 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target)); 569 569 } … … 580 580 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 581 581 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 eax585 emitPutArg( MacroAssembler::edx, 8); // leave the base in edx582 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 586 586 emitCall(i, Machine::cti_op_put_by_id); 587 587 i += 6; … … 591 591 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 592 592 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); 593 emitGetArg(instruction[i + 2].u.operand, MacroAssembler::eax);594 emitPutArg( MacroAssembler::eax, 0); // leave the base in eax593 emitGetArg(instruction[i + 2].u.operand, X86::eax); 594 emitPutArg(X86::eax, 0); // leave the base in eax 595 595 emitCall(i, Machine::cti_op_get_by_id); 596 596 emitPutResult(instruction[i + 1].u.operand); … … 599 599 } 600 600 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); 603 603 emitCall(i, Machine::cti_op_instanceof); 604 604 emitPutResult(instruction[i + 1].u.operand); … … 607 607 } 608 608 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); 610 610 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 611 611 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); … … 632 632 int skip = instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain; 633 633 634 emitGetCTIParam(CTI_ARGS_scopeChain, MacroAssembler::eax);634 emitGetCTIParam(CTI_ARGS_scopeChain, X86::eax); 635 635 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); 642 642 emitPutResult(instruction[i + 1].u.operand); 643 643 i += 4; … … 647 647 int skip = instruction[i + 2].u.operand + m_codeBlock->needsFullScopeChain; 648 648 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); 651 651 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); 658 658 i += 4; 659 659 break; 660 660 } 661 661 case op_ret: { 662 emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);662 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 663 663 emitCall(i, Machine::cti_op_ret); 664 664 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); 666 666 m_jit.ret(); 667 667 i += 2; … … 669 669 } 670 670 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); 673 673 emitPutArgConstant(instruction[i + 3].u.operand, 4); 674 674 emitCall(i, Machine::cti_op_new_array); … … 691 691 } 692 692 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); 698 698 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); 700 700 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); 702 702 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJbe(), i)); 703 703 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); 706 706 emitPutResult(instruction[i + 1].u.operand); 707 707 i += 4; … … 713 713 emitCall(i, Machine::cti_op_resolve_func); 714 714 emitPutResult(instruction[i + 1].u.operand); 715 emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);715 emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax); 716 716 emitPutResult(instruction[i + 2].u.operand); 717 717 i += 4; … … 719 719 } 720 720 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); 725 725 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 726 emitFastArithReTagImmediate( MacroAssembler::eax);726 emitFastArithReTagImmediate(X86::eax); 727 727 emitPutResult(instruction[i + 1].u.operand); 728 728 i += 4; … … 730 730 } 731 731 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); 738 738 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); 740 740 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); 742 742 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJbe(), i)); 743 743 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*)); 746 746 i += 4; 747 747 break; … … 752 752 753 753 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); 757 757 MacroAssembler::JmpSrc isZero = m_jit.emitUnlinkedJe(); 758 m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, MacroAssembler::eax);758 m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 759 759 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJne(), i + 2 + target)); 760 760 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); 762 762 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); 764 764 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 765 765 … … 777 777 } 778 778 case op_negate: { 779 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);779 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 780 780 emitCall(i, Machine::cti_op_negate); 781 781 emitPutResult(instruction[i + 1].u.operand); … … 795 795 case op_pre_dec: { 796 796 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); 800 800 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 801 emitPutResult(srcDst, MacroAssembler::eax);801 emitPutResult(srcDst, X86::eax); 802 802 i += 2; 803 803 break; … … 807 807 JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand); 808 808 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); 812 812 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target)); 813 813 } 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); 819 819 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target)); 820 820 } … … 823 823 } 824 824 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? 828 828 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); 830 830 emitPutResult(instruction[i + 1].u.operand); 831 831 i += 3; … … 834 834 case op_jfalse: { 835 835 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); 839 839 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); 841 841 MacroAssembler::JmpSrc isNonZero = m_jit.emitUnlinkedJne(); 842 842 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); 844 844 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); 846 846 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 847 847 … … 852 852 case op_post_inc: { 853 853 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); 858 858 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 859 emitPutResult(srcDst, MacroAssembler::edx);859 emitPutResult(srcDst, X86::edx); 860 860 emitPutResult(instruction[i + 1].u.operand); 861 861 i += 3; … … 864 864 case op_unexpected_load: { 865 865 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); 867 867 emitPutResult(instruction[i + 1].u.operand); 868 868 i += 3; … … 872 872 int retAddrDst = instruction[i + 1].u.operand; 873 873 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); 875 875 MacroAssembler::JmpDst addrPosition = m_jit.label(); 876 876 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJmp(), i + 2 + target)); … … 881 881 } 882 882 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); 884 884 i += 2; 885 885 break; … … 887 887 CTI_COMPILE_BINARY_OP(op_eq) 888 888 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); 897 897 emitPutResult(instruction[i + 1].u.operand); 898 898 i += 4; … … 904 904 unsigned dst = instruction[i + 1].u.operand; 905 905 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 JSImmediate906 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 909 909 emitPutResult(dst); 910 910 } 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); 914 914 emitPutResult(dst); 915 915 } 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); 920 920 emitPutResult(dst); 921 921 } … … 924 924 } 925 925 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); 933 933 emitPutResult(instruction[i + 1].u.operand); 934 934 i += 4; … … 936 936 } 937 937 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); 941 941 emitPutResult(instruction[i + 1].u.operand); 942 942 i += 3; … … 948 948 emitCall(i, Machine::cti_op_resolve_with_base); 949 949 emitPutResult(instruction[i + 1].u.operand); 950 emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);950 emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax); 951 951 emitPutResult(instruction[i + 2].u.operand); 952 952 i += 4; … … 962 962 } 963 963 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); 970 970 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), i)); // This is checking if the last detag resulted in a value 0. 971 971 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); 975 975 emitPutResult(instruction[i + 1].u.operand); 976 976 i += 4; … … 979 979 case op_jtrue: { 980 980 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); 984 984 MacroAssembler::JmpSrc isZero = m_jit.emitUnlinkedJe(); 985 m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, MacroAssembler::eax);985 m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 986 986 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJne(), i + 2 + target)); 987 987 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); 989 989 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); 991 991 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 992 992 … … 999 999 case op_post_dec: { 1000 1000 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); 1005 1005 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 1006 emitPutResult(srcDst, MacroAssembler::edx);1006 emitPutResult(srcDst, X86::edx); 1007 1007 emitPutResult(instruction[i + 1].u.operand); 1008 1008 i += 3; … … 1011 1011 CTI_COMPILE_BINARY_OP(op_urshift) 1012 1012 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); 1018 1018 emitPutResult(instruction[i + 1].u.operand); 1019 1019 i += 4; … … 1029 1029 } 1030 1030 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); 1035 1035 emitPutResult(instruction[i + 1].u.operand); 1036 1036 i += 4; … … 1043 1043 } 1044 1044 case op_throw: { 1045 emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);1045 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1046 1046 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); 1050 1050 m_jit.ret(); 1051 1051 i += 2; … … 1053 1053 } 1054 1054 case op_get_pnames: { 1055 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);1055 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1056 1056 emitCall(i, Machine::cti_op_get_pnames); 1057 1057 emitPutResult(instruction[i + 1].u.operand); … … 1060 1060 } 1061 1061 case op_next_pname: { 1062 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);1062 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1063 1063 unsigned target = instruction[i + 3].u.operand; 1064 1064 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); 1066 1066 MacroAssembler::JmpSrc endOfIter = m_jit.emitUnlinkedJe(); 1067 1067 emitPutResult(instruction[i + 1].u.operand); … … 1072 1072 } 1073 1073 case op_push_scope: { 1074 emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);1074 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1075 1075 emitCall(i, Machine::cti_op_push_scope); 1076 1076 i += 2; … … 1083 1083 } 1084 1084 case op_typeof: { 1085 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);1085 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1086 1086 emitCall(i, Machine::cti_op_typeof); 1087 1087 emitPutResult(instruction[i + 1].u.operand); … … 1092 1092 CTI_COMPILE_BINARY_OP(op_nstricteq) 1093 1093 case op_to_jsnumber: { 1094 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);1094 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1095 1095 emitCall(i, Machine::cti_op_to_jsnumber); 1096 1096 emitPutResult(instruction[i + 1].u.operand); … … 1099 1099 } 1100 1100 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); 1103 1103 emitCall(i, Machine::cti_op_in); 1104 1104 emitPutResult(instruction[i + 1].u.operand); … … 1109 1109 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1110 1110 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); 1112 1112 emitCall(i, Machine::cti_op_push_new_scope); 1113 1113 emitPutResult(instruction[i + 1].u.operand); … … 1116 1116 } 1117 1117 case op_catch: { 1118 emitGetCTIParam(CTI_ARGS_r, MacroAssembler::edi); // edi := r1119 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); 1122 1122 emitPutResult(instruction[i + 1].u.operand); 1123 1123 i += 2; … … 1134 1134 } 1135 1135 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); 1137 1137 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); 1139 1139 emitCall(i, Machine::cti_op_put_by_index); 1140 1140 i += 4; … … 1151 1151 jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size()); 1152 1152 1153 emitGetPutArg(scrutinee, 0, MacroAssembler::ecx);1153 emitGetPutArg(scrutinee, 0, X86::ecx); 1154 1154 emitPutArgConstant(tableIndex, 4); 1155 1155 emitCall(i, Machine::cti_op_switch_imm); 1156 m_jit.jmp_r( MacroAssembler::eax);1156 m_jit.jmp_r(X86::eax); 1157 1157 i += 4; 1158 1158 break; … … 1168 1168 jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size()); 1169 1169 1170 emitGetPutArg(scrutinee, 0, MacroAssembler::ecx);1170 emitGetPutArg(scrutinee, 0, X86::ecx); 1171 1171 emitPutArgConstant(tableIndex, 4); 1172 1172 emitCall(i, Machine::cti_op_switch_char); 1173 m_jit.jmp_r( MacroAssembler::eax);1173 m_jit.jmp_r(X86::eax); 1174 1174 i += 4; 1175 1175 break; … … 1184 1184 m_switches.append(SwitchRecord(jumpTable, i, defaultOffset)); 1185 1185 1186 emitGetPutArg(scrutinee, 0, MacroAssembler::ecx);1186 emitGetPutArg(scrutinee, 0, X86::ecx); 1187 1187 emitPutArgConstant(tableIndex, 4); 1188 1188 emitCall(i, Machine::cti_op_switch_string); 1189 m_jit.jmp_r( MacroAssembler::eax);1189 m_jit.jmp_r(X86::eax); 1190 1190 i += 4; 1191 1191 break; 1192 1192 } 1193 1193 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); 1196 1196 emitCall(i, Machine::cti_op_del_by_val); 1197 1197 emitPutResult(instruction[i + 1].u.operand); … … 1200 1200 } 1201 1201 case op_put_getter: { 1202 emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);1202 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1203 1203 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1204 1204 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); 1206 1206 emitCall(i, Machine::cti_op_put_getter); 1207 1207 i += 4; … … 1209 1209 } 1210 1210 case op_put_setter: { 1211 emitGetPutArg(instruction[i + 1].u.operand, 0, MacroAssembler::ecx);1211 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1212 1212 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1213 1213 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); 1215 1215 emitCall(i, Machine::cti_op_put_setter); 1216 1216 i += 4; … … 1236 1236 } 1237 1237 case op_eq_null: { 1238 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);1238 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1239 1239 emitCall(i, Machine::cti_op_eq_null); 1240 1240 emitPutResult(instruction[i + 1].u.operand); … … 1243 1243 } 1244 1244 case op_neq_null: { 1245 emitGetPutArg(instruction[i + 2].u.operand, 0, MacroAssembler::ecx);1245 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1246 1246 emitCall(i, Machine::cti_op_neq_null); 1247 1247 emitPutResult(instruction[i + 1].u.operand); … … 1286 1286 MacroAssembler::JmpSrc notImm = iter->from; 1287 1287 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); 1289 1289 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); 1292 1292 emitCall(i, Machine::cti_op_add); 1293 1293 emitPutResult(dst); … … 1301 1301 MacroAssembler::JmpSrc notImm = iter->from; 1302 1302 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); 1305 1305 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); 1308 1308 emitCall(i, Machine::cti_op_add); 1309 1309 emitPutResult(dst); … … 1316 1316 m_jit.link((++iter)->from, m_jit.label()); 1317 1317 m_jit.link((++iter)->from, m_jit.label()); 1318 emitFastArithIntToImmNoCheck( MacroAssembler::edx);1318 emitFastArithIntToImmNoCheck(X86::edx); 1319 1319 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); 1322 1322 emitCall(i, Machine::cti_op_get_by_val); 1323 1323 emitPutResult(instruction[i + 1].u.operand); … … 1328 1328 MacroAssembler::JmpSrc notImm = iter->from; 1329 1329 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); 1331 1331 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); 1334 1334 emitCall(i, Machine::cti_op_sub); 1335 1335 emitPutResult(instruction[i + 1].u.operand); … … 1340 1340 m_jit.link(iter->from, m_jit.label()); 1341 1341 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); 1344 1344 emitCall(i, Machine::cti_op_rshift); 1345 1345 emitPutResult(instruction[i + 1].u.operand); … … 1351 1351 MacroAssembler::JmpSrc notImm2 = (++iter)->from; 1352 1352 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); 1355 1355 m_jit.link(notImm1, m_jit.label()); 1356 1356 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); 1359 1359 emitCall(i, Machine::cti_op_lshift); 1360 1360 emitPutResult(instruction[i + 1].u.operand); … … 1369 1369 if (src2imm) { 1370 1370 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); 1373 1373 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); 1375 1375 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]); 1376 1376 } else { 1377 1377 m_jit.link(iter->from, m_jit.label()); 1378 1378 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); 1381 1381 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); 1383 1383 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]); 1384 1384 } … … 1390 1390 MacroAssembler::JmpSrc notImm = iter->from; 1391 1391 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); 1393 1393 m_jit.link(notImm, m_jit.label()); 1394 emitPutArg( MacroAssembler::eax, 0);1394 emitPutArg(X86::eax, 0); 1395 1395 emitCall(i, Machine::cti_op_pre_inc); 1396 1396 emitPutResult(srcDst); … … 1403 1403 m_jit.link((++iter)->from, m_jit.label()); 1404 1404 m_jit.link((++iter)->from, m_jit.label()); 1405 emitFastArithIntToImmNoCheck( MacroAssembler::edx);1405 emitFastArithIntToImmNoCheck(X86::edx); 1406 1406 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); 1410 1410 emitCall(i, Machine::cti_op_put_by_val); 1411 1411 i += 4; … … 1416 1416 1417 1417 m_jit.link(iter->from, m_jit.label()); 1418 emitPutArg( MacroAssembler::eax, 0);1418 emitPutArg(X86::eax, 0); 1419 1419 emitCall(i, Machine::cti_op_jtrue); 1420 m_jit.testl_rr( MacroAssembler::eax, MacroAssembler::eax);1420 m_jit.testl_rr(X86::eax, X86::eax); 1421 1421 unsigned target = instruction[i + 2].u.operand; 1422 1422 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 2 + target]); … … 1428 1428 MacroAssembler::JmpSrc notImm = iter->from; 1429 1429 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); 1431 1431 m_jit.link(notImm, m_jit.label()); 1432 emitPutArg( MacroAssembler::eax, 0);1432 emitPutArg(X86::eax, 0); 1433 1433 emitCall(i, Machine::cti_op_pre_dec); 1434 1434 emitPutResult(srcDst); … … 1441 1441 if (src2imm) { 1442 1442 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); 1445 1445 emitCall(i, Machine::cti_op_jless); 1446 m_jit.testl_rr( MacroAssembler::eax, MacroAssembler::eax);1446 m_jit.testl_rr(X86::eax, X86::eax); 1447 1447 m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]); 1448 1448 } else { 1449 1449 m_jit.link(iter->from, m_jit.label()); 1450 1450 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); 1453 1453 emitCall(i, Machine::cti_op_jless); 1454 m_jit.testl_rr( MacroAssembler::eax, MacroAssembler::eax);1454 m_jit.testl_rr(X86::eax, X86::eax); 1455 1455 m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]); 1456 1456 } … … 1460 1460 case op_not: { 1461 1461 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); 1464 1464 emitCall(i, Machine::cti_op_not); 1465 1465 emitPutResult(instruction[i + 1].u.operand); … … 1469 1469 case op_jfalse: { 1470 1470 m_jit.link(iter->from, m_jit.label()); 1471 emitPutArg( MacroAssembler::eax, 0);1471 emitPutArg(X86::eax, 0); 1472 1472 emitCall(i, Machine::cti_op_jtrue); 1473 m_jit.testl_rr( MacroAssembler::eax, MacroAssembler::eax);1473 m_jit.testl_rr(X86::eax, X86::eax); 1474 1474 unsigned target = instruction[i + 2].u.operand; 1475 1475 m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 2 + target]); // inverted! … … 1481 1481 m_jit.link(iter->from, m_jit.label()); 1482 1482 m_jit.link((++iter)->from, m_jit.label()); 1483 emitPutArg( MacroAssembler::eax, 0);1483 emitPutArg(X86::eax, 0); 1484 1484 emitCall(i, Machine::cti_op_post_inc); 1485 1485 emitPutResult(instruction[i + 1].u.operand); 1486 emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);1486 emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax); 1487 1487 emitPutResult(srcDst); 1488 1488 i += 3; … … 1491 1491 case op_bitnot: { 1492 1492 m_jit.link(iter->from, m_jit.label()); 1493 emitPutArg( MacroAssembler::eax, 0);1493 emitPutArg(X86::eax, 0); 1494 1494 emitCall(i, Machine::cti_op_bitnot); 1495 1495 emitPutResult(instruction[i + 1].u.operand); … … 1503 1503 if (getConstantImmediateNumericArg(src1)) { 1504 1504 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); 1507 1507 emitCall(i, Machine::cti_op_bitand); 1508 1508 emitPutResult(dst); 1509 1509 } else if (getConstantImmediateNumericArg(src2)) { 1510 1510 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); 1513 1513 emitCall(i, Machine::cti_op_bitand); 1514 1514 emitPutResult(dst); 1515 1515 } else { 1516 1516 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); 1519 1519 emitCall(i, Machine::cti_op_bitand); 1520 1520 emitPutResult(dst); … … 1525 1525 case op_jtrue: { 1526 1526 m_jit.link(iter->from, m_jit.label()); 1527 emitPutArg( MacroAssembler::eax, 0);1527 emitPutArg(X86::eax, 0); 1528 1528 emitCall(i, Machine::cti_op_jtrue); 1529 m_jit.testl_rr( MacroAssembler::eax, MacroAssembler::eax);1529 m_jit.testl_rr(X86::eax, X86::eax); 1530 1530 unsigned target = instruction[i + 2].u.operand; 1531 1531 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 2 + target]); … … 1537 1537 m_jit.link(iter->from, m_jit.label()); 1538 1538 m_jit.link((++iter)->from, m_jit.label()); 1539 emitPutArg( MacroAssembler::eax, 0);1539 emitPutArg(X86::eax, 0); 1540 1540 emitCall(i, Machine::cti_op_post_dec); 1541 1541 emitPutResult(instruction[i + 1].u.operand); 1542 emitGetCTIParam(CTI_ARGS_2ndResult, MacroAssembler::eax);1542 emitGetCTIParam(CTI_ARGS_2ndResult, X86::eax); 1543 1543 emitPutResult(srcDst); 1544 1544 i += 3; … … 1547 1547 case op_bitxor: { 1548 1548 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); 1551 1551 emitCall(i, Machine::cti_op_bitxor); 1552 1552 emitPutResult(instruction[i + 1].u.operand); … … 1556 1556 case op_bitor: { 1557 1557 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); 1560 1560 emitCall(i, Machine::cti_op_bitor); 1561 1561 emitPutResult(instruction[i + 1].u.operand); … … 1567 1567 MacroAssembler::JmpSrc notImm2 = (++iter)->from; 1568 1568 m_jit.link((++iter)->from, m_jit.label()); 1569 emitFastArithReTagImmediate( MacroAssembler::eax);1570 emitFastArithReTagImmediate( MacroAssembler::ecx);1569 emitFastArithReTagImmediate(X86::eax); 1570 emitFastArithReTagImmediate(X86::ecx); 1571 1571 m_jit.link(notImm1, m_jit.label()); 1572 1572 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); 1575 1575 emitCall(i, Machine::cti_op_mod); 1576 1576 emitPutResult(instruction[i + 1].u.operand); … … 1590 1590 { 1591 1591 // 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 := r1594 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); 1595 1595 1596 1596 privateCompileMainPass(); … … 1652 1652 { 1653 1653 // 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); 1655 1655 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); 1657 1657 MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne(); 1658 1658 1659 1659 // 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); 1662 1662 m_jit.ret(); 1663 1663 … … 1679 1679 JSObject* protoObject = static_cast<JSObject*>(structureID->prototype()); 1680 1680 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); 1682 1682 1683 1683 // 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); 1685 1685 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); 1687 1687 MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne(); 1688 1688 … … 1693 1693 1694 1694 // 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); 1696 1696 1697 1697 m_jit.ret(); … … 1716 1716 1717 1717 // 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); 1719 1719 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); 1721 1721 bucketsOfFail.append(m_jit.emitUnlinkedJne()); 1722 1722 … … 1736 1736 1737 1737 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); 1740 1740 m_jit.ret(); 1741 1741 … … 1754 1754 { 1755 1755 // 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); 1757 1757 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); 1759 1759 MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne(); 1760 1760 1761 1761 // 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); 1764 1764 m_jit.ret(); 1765 1765 … … 1778 1778 { 1779 1779 // Check eax is an array 1780 m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);1780 m_jit.testl_i32r(JSImmediate::TagMask, X86::eax); 1781 1781 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); 1783 1783 MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne(); 1784 1784 1785 1785 // 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); 1790 1790 MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo(); 1791 m_jit.addl_i8r(1, MacroAssembler::eax);1791 m_jit.addl_i8r(1, X86::eax); 1792 1792 1793 1793 m_jit.ret(); … … 1806 1806 { 1807 1807 // Check eax is a string 1808 m_jit.testl_i32r(JSImmediate::TagMask, MacroAssembler::eax);1808 m_jit.testl_i32r(JSImmediate::TagMask, X86::eax); 1809 1809 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); 1811 1811 MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne(); 1812 1812 1813 1813 // 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); 1818 1818 MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo(); 1819 m_jit.addl_i8r(1, MacroAssembler::eax);1819 m_jit.addl_i8r(1, X86::eax); 1820 1820 1821 1821 m_jit.ret(); … … 1856 1856 + 3 * sizeof(void*) 1857 1857 #endif 1858 , MacroAssembler::esp, WRECGenerator::outputRegister);1858 , X86::esp, WRECGenerator::outputRegister); 1859 1859 1860 1860 // restart point on match fail. … … 1882 1882 1883 1883 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); 1886 1886 jit.popl_r(WRECGenerator::currentValueRegister); 1887 1887 jit.popl_r(WRECGenerator::outputRegister); … … 1890 1890 jit.link(noOutput, jit.label()); 1891 1891 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); 1894 1894 jit.popl_r(WRECGenerator::currentValueRegister); 1895 1895 jit.popl_r(WRECGenerator::outputRegister); … … 1904 1904 failures.clear(); 1905 1905 1906 jit.movl_mr( MacroAssembler::esp, WRECGenerator::currentPositionRegister);1906 jit.movl_mr(X86::esp, WRECGenerator::currentPositionRegister); 1907 1907 jit.addl_i8r(1, WRECGenerator::currentPositionRegister); 1908 jit.movl_rm(WRECGenerator::currentPositionRegister, MacroAssembler::esp);1908 jit.movl_rm(WRECGenerator::currentPositionRegister, X86::esp); 1909 1909 jit.cmpl_rr(WRECGenerator::lengthRegister, WRECGenerator::currentPositionRegister); 1910 1910 jit.link(jit.emitUnlinkedJle(), nextLabel); 1911 1911 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); 1915 1915 jit.popl_r(WRECGenerator::currentValueRegister); 1916 1916 jit.popl_r(WRECGenerator::outputRegister);
Note:
See TracChangeset
for help on using the changeset viewer.