Changeset 39958 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Jan 15, 2009, 7:20:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r39851 r39958 214 214 void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqType type) 215 215 { 216 bool negated = (type == OpNStrictEq);217 218 216 unsigned dst = currentInstruction[1].u.operand; 219 217 unsigned src1 = currentInstruction[2].u.operand; … … 222 220 emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx); 223 221 224 // Check that bot are immediates, if so check if they're equal 222 #if USE(ALTERNATE_JSIMMEDIATE) 223 // Jump to a slow case if either operand is a number, or if both are JSCell*s. 224 move(X86::eax, X86::ecx); 225 orPtr(X86::edx, X86::ecx); 226 addSlowCase(emitJumpIfJSCell(X86::ecx)); 227 addSlowCase(emitJumpIfImmediateNumber(X86::ecx)); 228 229 if (type == OpStrictEq) 230 sete32(X86::edx, X86::eax); 231 else 232 setne32(X86::edx, X86::eax); 233 emitTagAsBoolImmediate(X86::eax); 234 #else 235 bool negated = (type == OpNStrictEq); 236 237 // Check that both are immediates, if so check if they're equal 225 238 Jump firstNotImmediate = emitJumpIfJSCell(X86::eax); 226 239 Jump secondNotImmediate = emitJumpIfJSCell(X86::edx); 227 Jump bothWereImmediatesButNotEqual = jne 32(X86::edx, X86::eax);240 Jump bothWereImmediatesButNotEqual = jnePtr(X86::edx, X86::eax); 228 241 229 242 // They are equal - set the result to true. (Or false, if negated). … … 251 264 252 265 bothWereImmediatesAndEqual.link(this); 266 #endif 267 253 268 emitPutVirtualRegister(dst); 254 269 } … … 348 363 if (isOperandConstantImmediateInt(op2)) { 349 364 emitGetVirtualRegister(op1, X86::eax); 350 emitJumpSlowCaseIfNotImm Num(X86::eax);365 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 351 366 #if USE(ALTERNATE_JSIMMEDIATE) 352 367 int32_t op2imm = getConstantOperandImmediateInt(op2); … … 357 372 } else { 358 373 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 359 emitJumpSlowCaseIfNotImm Num(X86::eax);360 emitJumpSlowCaseIfNotImm Num(X86::edx);374 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 375 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 361 376 addJump(jl32(X86::eax, X86::edx), target + 3); 362 377 } … … 371 386 if (isOperandConstantImmediateInt(op2)) { 372 387 emitGetVirtualRegister(op1, X86::eax); 373 emitJumpSlowCaseIfNotImm Num(X86::eax);388 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 374 389 #if USE(ALTERNATE_JSIMMEDIATE) 375 390 int32_t op2imm = getConstantOperandImmediateInt(op2); … … 380 395 } else { 381 396 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 382 emitJumpSlowCaseIfNotImm Num(X86::eax);383 emitJumpSlowCaseIfNotImm Num(X86::edx);397 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 398 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 384 399 addJump(jle32(X86::eax, X86::edx), target + 3); 385 400 } … … 573 588 case op_get_by_val: { 574 589 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 575 emitJumpSlowCaseIfNotImm Num(X86::edx);590 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 576 591 #if USE(ALTERNATE_JSIMMEDIATE) 577 592 // This is technically incorrect - we're zero-extending an int32. On the hot path this doesn't matter. … … 611 626 case op_put_by_val: { 612 627 emitGetVirtualRegisters(currentInstruction[1].u.operand, X86::eax, currentInstruction[2].u.operand, X86::edx); 613 emitJumpSlowCaseIfNotImm Num(X86::edx);628 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 614 629 #if USE(ALTERNATE_JSIMMEDIATE) 615 630 // See comment in op_get_by_val. … … 645 660 646 661 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))); 647 addJump(emitJumpIfImm Num(X86::eax), target + 2);662 addJump(emitJumpIfImmediateInteger(X86::eax), target + 2); 648 663 649 664 addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2); … … 716 731 if (isOperandConstantImmediateInt(op2)) { 717 732 emitGetVirtualRegister(op1, X86::eax); 718 emitJumpSlowCaseIfNotImm Num(X86::eax);733 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 719 734 #if USE(ALTERNATE_JSIMMEDIATE) 720 735 int32_t op2imm = getConstantOperandImmediateInt(op2); … … 725 740 } else { 726 741 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 727 emitJumpSlowCaseIfNotImm Num(X86::eax);728 emitJumpSlowCaseIfNotImm Num(X86::edx);742 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 743 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 729 744 addJump(jge32(X86::eax, X86::edx), target + 3); 730 745 } … … 744 759 745 760 addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))), target + 2); 746 Jump isNonZero = emitJumpIfImm Num(X86::eax);761 Jump isNonZero = emitJumpIfImmediateInteger(X86::eax); 747 762 748 763 addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))), target + 2); … … 816 831 case op_eq: { 817 832 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 818 emitJumpSlowCaseIfNotImm Nums(X86::eax, X86::edx, X86::ecx);833 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 819 834 sete32(X86::edx, X86::eax); 820 835 emitTagAsBoolImmediate(X86::eax); … … 836 851 case op_bitnot: { 837 852 emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax); 838 emitJumpSlowCaseIfNotImm Num(X86::eax);853 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 839 854 #if USE(ALTERNATE_JSIMMEDIATE) 840 855 not32(X86::eax); 841 856 emitFastArithIntToImmNoCheck(X86::eax, X86::eax); 842 857 #else 843 xorPtr(Imm32(~JSImmediate::TagType Integer), X86::eax);858 xorPtr(Imm32(~JSImmediate::TagTypeNumber), X86::eax); 844 859 #endif 845 860 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 870 885 871 886 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))); 872 addJump(emitJumpIfImm Num(X86::eax), target + 2);887 addJump(emitJumpIfImmediateInteger(X86::eax), target + 2); 873 888 874 889 addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2); … … 881 896 case op_neq: { 882 897 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 883 emitJumpSlowCaseIfNotImm Nums(X86::eax, X86::edx, X86::ecx);898 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 884 899 setne32(X86::edx, X86::eax); 885 900 emitTagAsBoolImmediate(X86::eax); … … 896 911 case op_bitxor: { 897 912 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 898 emitJumpSlowCaseIfNotImm Nums(X86::eax, X86::edx, X86::ecx);913 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 899 914 xorPtr(X86::edx, X86::eax); 900 915 emitFastArithReTagImmediate(X86::eax, X86::eax); … … 911 926 case op_bitor: { 912 927 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 913 emitJumpSlowCaseIfNotImm Nums(X86::eax, X86::edx, X86::ecx);928 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 914 929 orPtr(X86::edx, X86::eax); 915 930 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 981 996 emitGetVirtualRegister(srcVReg, X86::eax); 982 997 983 Jump wasImmediate = emitJumpIfImm Num(X86::eax);998 Jump wasImmediate = emitJumpIfImmediateInteger(X86::eax); 984 999 985 1000 emitJumpSlowCaseIfNotJSCell(X86::eax, srcVReg); … … 1507 1522 linkSlowCase(iter); 1508 1523 linkSlowCase(iter); 1509 linkSlowCase(iter); 1524 #if !USE(ALTERNATE_JSIMMEDIATE) 1525 linkSlowCase(iter); 1526 #endif 1510 1527 emitPutJITStubArg(X86::eax, 1); 1511 1528 emitPutJITStubArg(X86::edx, 2); … … 1517 1534 linkSlowCase(iter); 1518 1535 linkSlowCase(iter); 1519 linkSlowCase(iter); 1536 #if !USE(ALTERNATE_JSIMMEDIATE) 1537 linkSlowCase(iter); 1538 #endif 1520 1539 emitPutJITStubArg(X86::eax, 1); 1521 1540 emitPutJITStubArg(X86::edx, 2);
Note:
See TracChangeset
for help on using the changeset viewer.