Changeset 43531 in webkit for trunk/JavaScriptCore/jit/JITArithmetic.cpp
- Timestamp:
- May 11, 2009, 6:06:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITArithmetic.cpp
r43441 r43531 94 94 namespace JSC { 95 95 96 void JIT::compileFastArith_op_lshift(unsigned result, unsigned op1, unsigned op2) 97 { 96 void JIT::emit_op_lshift(Instruction* currentInstruction) 97 { 98 unsigned result = currentInstruction[1].u.operand; 99 unsigned op1 = currentInstruction[2].u.operand; 100 unsigned op2 = currentInstruction[3].u.operand; 101 98 102 emitGetVirtualRegisters(op1, regT0, op2, regT2); 99 103 // FIXME: would we be better using 'emitJumpSlowCaseIfNotImmediateIntegers'? - we *probably* ought to be consistent. … … 115 119 emitPutVirtualRegister(result); 116 120 } 117 void JIT::compileFastArithSlow_op_lshift(unsigned result, unsigned op1, unsigned op2, Vector<SlowCaseEntry>::iterator& iter) 118 { 121 void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 122 { 123 unsigned result = currentInstruction[1].u.operand; 124 unsigned op1 = currentInstruction[2].u.operand; 125 unsigned op2 = currentInstruction[3].u.operand; 126 119 127 #if USE(ALTERNATE_JSIMMEDIATE) 120 128 UNUSED_PARAM(op1); … … 137 145 } 138 146 139 void JIT::compileFastArith_op_rshift(unsigned result, unsigned op1, unsigned op2) 140 { 147 void JIT::emit_op_rshift(Instruction* currentInstruction) 148 { 149 unsigned result = currentInstruction[1].u.operand; 150 unsigned op1 = currentInstruction[2].u.operand; 151 unsigned op2 = currentInstruction[3].u.operand; 152 141 153 if (isOperandConstantImmediateInt(op2)) { 142 154 emitGetVirtualRegister(op1, regT0); … … 190 202 } 191 203 192 void JIT::compileFastArithSlow_op_rshift(unsigned result, unsigned op1, unsigned op2, Vector<SlowCaseEntry>::iterator& iter) 193 { 204 void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 205 { 206 unsigned result = currentInstruction[1].u.operand; 207 unsigned op1 = currentInstruction[2].u.operand; 208 unsigned op2 = currentInstruction[3].u.operand; 209 194 210 linkSlowCase(iter); 195 211 JITStubCall stubCall(this, JITStubs::cti_op_rshift); … … 224 240 } 225 241 226 void JIT::compileFastArith_op_jnless(unsigned op1, unsigned op2, unsigned target) 227 { 242 void JIT::emit_op_jnless(Instruction* currentInstruction) 243 { 244 unsigned op1 = currentInstruction[1].u.operand; 245 unsigned op2 = currentInstruction[2].u.operand; 246 unsigned target = currentInstruction[3].u.operand; 247 228 248 // We generate inline code for the following cases in the fast path: 229 249 // - int immediate to constant int immediate … … 257 277 } 258 278 } 259 void JIT::compileFastArithSlow_op_jnless(unsigned op1, unsigned op2, unsigned target, Vector<SlowCaseEntry>::iterator& iter) 260 { 279 void JIT::emitSlow_op_jnless(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 280 { 281 unsigned op1 = currentInstruction[1].u.operand; 282 unsigned op2 = currentInstruction[2].u.operand; 283 unsigned target = currentInstruction[3].u.operand; 284 261 285 // We generate inline code for the following cases in the slow path: 262 286 // - floating-point number to constant int immediate … … 403 427 } 404 428 405 void JIT::compileFastArith_op_jnlesseq(unsigned op1, unsigned op2, unsigned target) 406 { 429 void JIT::emit_op_jnlesseq(Instruction* currentInstruction) 430 { 431 unsigned op1 = currentInstruction[1].u.operand; 432 unsigned op2 = currentInstruction[2].u.operand; 433 unsigned target = currentInstruction[3].u.operand; 434 407 435 // We generate inline code for the following cases in the fast path: 408 436 // - int immediate to constant int immediate … … 436 464 } 437 465 } 438 void JIT::compileFastArithSlow_op_jnlesseq(unsigned op1, unsigned op2, unsigned target, Vector<SlowCaseEntry>::iterator& iter) 439 { 466 void JIT::emitSlow_op_jnlesseq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 467 { 468 unsigned op1 = currentInstruction[1].u.operand; 469 unsigned op2 = currentInstruction[2].u.operand; 470 unsigned target = currentInstruction[3].u.operand; 471 440 472 // We generate inline code for the following cases in the slow path: 441 473 // - floating-point number to constant int immediate … … 582 614 } 583 615 584 void JIT::compileFastArith_op_bitand(unsigned result, unsigned op1, unsigned op2) 585 { 616 void JIT::emit_op_bitand(Instruction* currentInstruction) 617 { 618 unsigned result = currentInstruction[1].u.operand; 619 unsigned op1 = currentInstruction[2].u.operand; 620 unsigned op2 = currentInstruction[3].u.operand; 621 586 622 if (isOperandConstantImmediateInt(op1)) { 587 623 emitGetVirtualRegister(op2, regT0); … … 613 649 emitPutVirtualRegister(result); 614 650 } 615 void JIT::compileFastArithSlow_op_bitand(unsigned result, unsigned op1, unsigned op2, Vector<SlowCaseEntry>::iterator& iter) 616 { 651 void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 652 { 653 unsigned result = currentInstruction[1].u.operand; 654 unsigned op1 = currentInstruction[2].u.operand; 655 unsigned op2 = currentInstruction[3].u.operand; 656 617 657 linkSlowCase(iter); 618 658 if (isOperandConstantImmediateInt(op1)) { … … 635 675 636 676 #if PLATFORM(X86) || PLATFORM(X86_64) 637 void JIT::compileFastArith_op_mod(unsigned result, unsigned op1, unsigned op2) 638 { 677 void JIT::emit_op_mod(Instruction* currentInstruction) 678 { 679 unsigned result = currentInstruction[1].u.operand; 680 unsigned op1 = currentInstruction[2].u.operand; 681 unsigned op2 = currentInstruction[3].u.operand; 682 639 683 emitGetVirtualRegisters(op1, X86::eax, op2, X86::ecx); 640 684 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); … … 654 698 emitPutVirtualRegister(result); 655 699 } 656 void JIT::compileFastArithSlow_op_mod(unsigned result, unsigned, unsigned, Vector<SlowCaseEntry>::iterator& iter) 657 { 700 void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 701 { 702 unsigned result = currentInstruction[1].u.operand; 703 658 704 #if USE(ALTERNATE_JSIMMEDIATE) 659 705 linkSlowCase(iter); … … 675 721 } 676 722 #else 677 void JIT::compileFastArith_op_mod(unsigned result, unsigned op1, unsigned op2) 678 { 723 void JIT::emit_op_mod(Instruction* currentInstruction) 724 { 725 unsigned result = currentInstruction[1].u.operand; 726 unsigned op1 = currentInstruction[2].u.operand; 727 unsigned op2 = currentInstruction[3].u.operand; 728 679 729 JITStubCall stubCall(this, JITStubs::cti_op_mod); 680 730 stubCall.addArgument(op1, regT2); … … 682 732 stubCall.call(result); 683 733 } 684 void JIT:: compileFastArithSlow_op_mod(unsigned, unsigned, unsigned, Vector<SlowCaseEntry>::iterator&)734 void JIT::emitSlow_op_mod(Instruction*, Vector<SlowCaseEntry>::iterator&) 685 735 { 686 736 ASSERT_NOT_REACHED(); … … 688 738 #endif 689 739 690 void JIT::compileFastArith_op_post_inc(unsigned result, unsigned srcDst) 691 { 740 void JIT::emit_op_post_inc(Instruction* currentInstruction) 741 { 742 unsigned result = currentInstruction[1].u.operand; 743 unsigned srcDst = currentInstruction[2].u.operand; 744 692 745 emitGetVirtualRegister(srcDst, regT0); 693 746 move(regT0, regT1); … … 704 757 } 705 758 706 void JIT::compileFastArithSlow_op_post_inc(unsigned result, unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter) 707 { 759 void JIT::emitSlow_op_post_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 760 { 761 unsigned result = currentInstruction[1].u.operand; 762 unsigned srcDst = currentInstruction[2].u.operand; 763 708 764 linkSlowCase(iter); 709 765 linkSlowCase(iter); … … 714 770 } 715 771 716 void JIT::compileFastArith_op_post_dec(unsigned result, unsigned srcDst) 717 { 772 void JIT::emit_op_post_dec(Instruction* currentInstruction) 773 { 774 unsigned result = currentInstruction[1].u.operand; 775 unsigned srcDst = currentInstruction[2].u.operand; 776 718 777 emitGetVirtualRegister(srcDst, regT0); 719 778 move(regT0, regT1); … … 729 788 emitPutVirtualRegister(result); 730 789 } 731 void JIT::compileFastArithSlow_op_post_dec(unsigned result, unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter) 732 { 790 void JIT::emitSlow_op_post_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 791 { 792 unsigned result = currentInstruction[1].u.operand; 793 unsigned srcDst = currentInstruction[2].u.operand; 794 733 795 linkSlowCase(iter); 734 796 linkSlowCase(iter); … … 739 801 } 740 802 741 void JIT::compileFastArith_op_pre_inc(unsigned srcDst) 742 { 803 void JIT::emit_op_pre_inc(Instruction* currentInstruction) 804 { 805 unsigned srcDst = currentInstruction[1].u.operand; 806 743 807 emitGetVirtualRegister(srcDst, regT0); 744 808 emitJumpSlowCaseIfNotImmediateInteger(regT0); … … 752 816 emitPutVirtualRegister(srcDst); 753 817 } 754 void JIT::compileFastArithSlow_op_pre_inc(unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter) 755 { 818 void JIT::emitSlow_op_pre_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 819 { 820 unsigned srcDst = currentInstruction[1].u.operand; 821 756 822 Jump notImm = getSlowCase(iter); 757 823 linkSlowCase(iter); … … 763 829 } 764 830 765 void JIT::compileFastArith_op_pre_dec(unsigned srcDst) 766 { 831 void JIT::emit_op_pre_dec(Instruction* currentInstruction) 832 { 833 unsigned srcDst = currentInstruction[1].u.operand; 834 767 835 emitGetVirtualRegister(srcDst, regT0); 768 836 emitJumpSlowCaseIfNotImmediateInteger(regT0); … … 776 844 emitPutVirtualRegister(srcDst); 777 845 } 778 void JIT::compileFastArithSlow_op_pre_dec(unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter) 779 { 846 void JIT::emitSlow_op_pre_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 847 { 848 unsigned srcDst = currentInstruction[1].u.operand; 849 780 850 Jump notImm = getSlowCase(iter); 781 851 linkSlowCase(iter); … … 790 860 #if !ENABLE(JIT_OPTIMIZE_ARITHMETIC) 791 861 792 void JIT:: compileFastArith_op_add(Instruction* currentInstruction)862 void JIT::emit_op_add(Instruction* currentInstruction) 793 863 { 794 864 unsigned result = currentInstruction[1].u.operand; … … 802 872 } 803 873 804 void JIT:: compileFastArithSlow_op_add(Instruction*, Vector<SlowCaseEntry>::iterator&)874 void JIT::emitSlow_op_add(Instruction*, Vector<SlowCaseEntry>::iterator&) 805 875 { 806 876 ASSERT_NOT_REACHED(); 807 877 } 808 878 809 void JIT:: compileFastArith_op_mul(Instruction* currentInstruction)879 void JIT::emit_op_mul(Instruction* currentInstruction) 810 880 { 811 881 unsigned result = currentInstruction[1].u.operand; … … 819 889 } 820 890 821 void JIT:: compileFastArithSlow_op_mul(Instruction*, Vector<SlowCaseEntry>::iterator&)891 void JIT::emitSlow_op_mul(Instruction*, Vector<SlowCaseEntry>::iterator&) 822 892 { 823 893 ASSERT_NOT_REACHED(); 824 894 } 825 895 826 void JIT:: compileFastArith_op_sub(Instruction* currentInstruction)896 void JIT::emit_op_sub(Instruction* currentInstruction) 827 897 { 828 898 unsigned result = currentInstruction[1].u.operand; … … 836 906 } 837 907 838 void JIT:: compileFastArithSlow_op_sub(Instruction*, Vector<SlowCaseEntry>::iterator&)908 void JIT::emitSlow_op_sub(Instruction*, Vector<SlowCaseEntry>::iterator&) 839 909 { 840 910 ASSERT_NOT_REACHED(); … … 917 987 } 918 988 919 void JIT:: compileFastArith_op_add(Instruction* currentInstruction)989 void JIT::emit_op_add(Instruction* currentInstruction) 920 990 { 921 991 unsigned result = currentInstruction[1].u.operand; … … 947 1017 emitPutVirtualRegister(result); 948 1018 } 949 void JIT:: compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1019 void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 950 1020 { 951 1021 unsigned result = currentInstruction[1].u.operand; … … 964 1034 } 965 1035 966 void JIT:: compileFastArith_op_mul(Instruction* currentInstruction)1036 void JIT::emit_op_mul(Instruction* currentInstruction) 967 1037 { 968 1038 unsigned result = currentInstruction[1].u.operand; … … 988 1058 emitPutVirtualRegister(result); 989 1059 } 990 void JIT:: compileFastArithSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1060 void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 991 1061 { 992 1062 unsigned result = currentInstruction[1].u.operand; … … 1008 1078 } 1009 1079 1010 void JIT:: compileFastArith_op_sub(Instruction* currentInstruction)1080 void JIT::emit_op_sub(Instruction* currentInstruction) 1011 1081 { 1012 1082 unsigned result = currentInstruction[1].u.operand; … … 1019 1089 emitPutVirtualRegister(result); 1020 1090 } 1021 void JIT:: compileFastArithSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1091 void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1022 1092 { 1023 1093 unsigned result = currentInstruction[1].u.operand; … … 1222 1292 } 1223 1293 1224 void JIT:: compileFastArith_op_add(Instruction* currentInstruction)1294 void JIT::emit_op_add(Instruction* currentInstruction) 1225 1295 { 1226 1296 unsigned result = currentInstruction[1].u.operand; … … 1253 1323 } 1254 1324 1255 void JIT:: compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1325 void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1256 1326 { 1257 1327 unsigned result = currentInstruction[1].u.operand; … … 1284 1354 } 1285 1355 1286 void JIT:: compileFastArith_op_mul(Instruction* currentInstruction)1356 void JIT::emit_op_mul(Instruction* currentInstruction) 1287 1357 { 1288 1358 unsigned result = currentInstruction[1].u.operand; … … 1311 1381 compileBinaryArithOp(op_mul, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); 1312 1382 } 1313 void JIT::compileFastArithSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1383 1384 void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1314 1385 { 1315 1386 unsigned result = currentInstruction[1].u.operand; … … 1330 1401 } 1331 1402 1332 void JIT:: compileFastArith_op_sub(Instruction* currentInstruction)1403 void JIT::emit_op_sub(Instruction* currentInstruction) 1333 1404 { 1334 1405 compileBinaryArithOp(op_sub, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand)); 1335 1406 } 1336 void JIT:: compileFastArithSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1407 void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1337 1408 { 1338 1409 compileBinaryArithOpSlowCase(op_sub, iter, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
Note:
See TracChangeset
for help on using the changeset viewer.