Changeset 39958 in webkit for trunk/JavaScriptCore/jit/JITArithmetic.cpp
- Timestamp:
- Jan 15, 2009, 7:20:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITArithmetic.cpp
r39851 r39958 50 50 { 51 51 emitGetVirtualRegisters(op1, X86::eax, op2, X86::ecx); 52 // FIXME: would we be better using 'emitJumpSlowCaseIfNotImm Nums'? - we *probably* ought to be consistent.53 emitJumpSlowCaseIfNotImm Num(X86::eax);54 emitJumpSlowCaseIfNotImm Num(X86::ecx);52 // FIXME: would we be better using 'emitJumpSlowCaseIfNotImmediateIntegers'? - we *probably* ought to be consistent. 53 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 54 emitJumpSlowCaseIfNotImmediateInteger(X86::ecx); 55 55 emitFastArithImmToInt(X86::eax); 56 56 emitFastArithImmToInt(X86::ecx); … … 94 94 if (isOperandConstantImmediateInt(op2)) { 95 95 emitGetVirtualRegister(op1, X86::eax); 96 emitJumpSlowCaseIfNotImm Num(X86::eax);96 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 97 97 // Mask with 0x1f as per ecma-262 11.7.2 step 7. 98 98 #if USE(ALTERNATE_JSIMMEDIATE) … … 103 103 } else { 104 104 emitGetVirtualRegisters(op1, X86::eax, op2, X86::ecx); 105 emitJumpSlowCaseIfNotImm Num(X86::eax);106 emitJumpSlowCaseIfNotImm Num(X86::ecx);105 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 106 emitJumpSlowCaseIfNotImmediateInteger(X86::ecx); 107 107 emitFastArithImmToInt(X86::ecx); 108 108 #if !PLATFORM(X86) … … 120 120 emitFastArithIntToImmNoCheck(X86::eax, X86::eax); 121 121 #else 122 orPtr(Imm32(JSImmediate::TagType Integer), X86::eax);122 orPtr(Imm32(JSImmediate::TagTypeNumber), X86::eax); 123 123 #endif 124 124 emitPutVirtualRegister(result); … … 143 143 if (isOperandConstantImmediateInt(op1)) { 144 144 emitGetVirtualRegister(op2, X86::eax); 145 emitJumpSlowCaseIfNotImm Num(X86::eax);145 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 146 146 #if USE(ALTERNATE_JSIMMEDIATE) 147 147 int32_t imm = getConstantOperandImmediateInt(op1); … … 154 154 } else if (isOperandConstantImmediateInt(op2)) { 155 155 emitGetVirtualRegister(op1, X86::eax); 156 emitJumpSlowCaseIfNotImm Num(X86::eax);156 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 157 157 #if USE(ALTERNATE_JSIMMEDIATE) 158 158 int32_t imm = getConstantOperandImmediateInt(op2); … … 166 166 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 167 167 andPtr(X86::edx, X86::eax); 168 emitJumpSlowCaseIfNotImm Num(X86::eax);168 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 169 169 } 170 170 emitPutVirtualRegister(result); … … 190 190 { 191 191 emitGetVirtualRegisters(op1, X86::eax, op2, X86::ecx); 192 emitJumpSlowCaseIfNotImm Num(X86::eax);193 emitJumpSlowCaseIfNotImm Num(X86::ecx);192 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 193 emitJumpSlowCaseIfNotImmediateInteger(X86::ecx); 194 194 #if USE(ALTERNATE_JSIMMEDIATE) 195 195 addSlowCase(jePtr(X86::ecx, ImmPtr(JSValuePtr::encode(js0())))); … … 233 233 if (isOperandConstantImmediateInt(op1)) { 234 234 emitGetVirtualRegister(op2, X86::eax); 235 emitJumpSlowCaseIfNotImm Num(X86::eax);235 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 236 236 #if USE(ALTERNATE_JSIMMEDIATE) 237 237 // FIXME: investigate performing a 31-bit add here (can we preserve upper bit & detect overflow from low word to high?) … … 246 246 } else if (isOperandConstantImmediateInt(op2)) { 247 247 emitGetVirtualRegister(op1, X86::eax); 248 emitJumpSlowCaseIfNotImm Num(X86::eax);248 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 249 249 #if USE(ALTERNATE_JSIMMEDIATE) 250 250 emitFastArithImmToInt(X86::eax); … … 323 323 if (isOperandConstantImmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) { 324 324 emitGetVirtualRegister(op2, X86::eax); 325 emitJumpSlowCaseIfNotImm Num(X86::eax);325 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 326 326 #if USE(ALTERNATE_JSIMMEDIATE) 327 327 addSlowCase(joMul32(Imm32(value), X86::eax, X86::eax)); … … 335 335 } else if (isOperandConstantImmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) { 336 336 emitGetVirtualRegister(op1, X86::eax); 337 emitJumpSlowCaseIfNotImm Num(X86::eax);337 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 338 338 #if USE(ALTERNATE_JSIMMEDIATE) 339 339 addSlowCase(joMul32(Imm32(value), X86::eax, X86::eax)); … … 371 371 emitGetVirtualRegister(srcDst, X86::eax); 372 372 move(X86::eax, X86::edx); 373 emitJumpSlowCaseIfNotImm Num(X86::eax);373 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 374 374 #if USE(ALTERNATE_JSIMMEDIATE) 375 375 addSlowCase(joAdd32(Imm32(1), X86::edx)); … … 396 396 emitGetVirtualRegister(srcDst, X86::eax); 397 397 move(X86::eax, X86::edx); 398 emitJumpSlowCaseIfNotImm Num(X86::eax);398 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 399 399 #if USE(ALTERNATE_JSIMMEDIATE) 400 400 addSlowCase(joSub32(Imm32(1), X86::edx)); … … 420 420 { 421 421 emitGetVirtualRegister(srcDst, X86::eax); 422 emitJumpSlowCaseIfNotImm Num(X86::eax);422 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 423 423 #if USE(ALTERNATE_JSIMMEDIATE) 424 424 // FIXME: Could add ptr & specify int64; no need to re-sign-extend? … … 445 445 { 446 446 emitGetVirtualRegister(srcDst, X86::eax); 447 emitJumpSlowCaseIfNotImm Num(X86::eax);447 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 448 448 #if USE(ALTERNATE_JSIMMEDIATE) 449 449 addSlowCase(joSub32(Imm32(1), X86::eax)); … … 548 548 __ cvtsi2sd_rr(tempReg1, tempXmm); 549 549 // Compare & branch if immediate. 550 __ ucomis _rr(tempXmm, xmmSource);550 __ ucomisd_rr(tempXmm, xmmSource); 551 551 JmpSrc resultIsImm = __ je(); 552 552 JmpDst resultLookedLikeImmButActuallyIsnt = __ label(); … … 585 585 586 586 // Check op2 is a number 587 __ testl_i32r(JSImmediate::TagType Integer, X86::edx);587 __ testl_i32r(JSImmediate::TagTypeNumber, X86::edx); 588 588 JmpSrc op2imm = __ jne(); 589 589 if (!types.second().definitelyIsNumber()) { … … 595 595 // (1) In this case src2 is a reusable number cell. 596 596 // Slow case if src1 is not a number type. 597 __ testl_i32r(JSImmediate::TagType Integer, X86::eax);597 __ testl_i32r(JSImmediate::TagTypeNumber, X86::eax); 598 598 JmpSrc op1imm = __ jne(); 599 599 if (!types.first().definitelyIsNumber()) { … … 627 627 // Two slow cases - either src1 isn't an immediate, or the subtract overflows. 628 628 __ link(op2imm, __ label()); 629 emitJumpSlowCaseIfNotImm Num(X86::eax);629 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 630 630 } else if (types.first().isReusable() && isSSE2Present()) { 631 631 ASSERT(types.first().mightBeNumber()); 632 632 633 633 // Check op1 is a number 634 __ testl_i32r(JSImmediate::TagType Integer, X86::eax);634 __ testl_i32r(JSImmediate::TagTypeNumber, X86::eax); 635 635 JmpSrc op1imm = __ jne(); 636 636 if (!types.first().definitelyIsNumber()) { … … 642 642 // (1) In this case src1 is a reusable number cell. 643 643 // Slow case if src2 is not a number type. 644 __ testl_i32r(JSImmediate::TagType Integer, X86::edx);644 __ testl_i32r(JSImmediate::TagTypeNumber, X86::edx); 645 645 JmpSrc op2imm = __ jne(); 646 646 if (!types.second().definitelyIsNumber()) { … … 677 677 // Two slow cases - either src2 isn't an immediate, or the subtract overflows. 678 678 __ link(op1imm, __ label()); 679 emitJumpSlowCaseIfNotImm Num(X86::edx);679 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 680 680 } else 681 emitJumpSlowCaseIfNotImm Nums(X86::eax, X86::edx, X86::ecx);681 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 682 682 683 683 if (opcodeID == op_add) {
Note:
See TracChangeset
for help on using the changeset viewer.