Changeset 155418 in webkit for trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
- Timestamp:
- Sep 9, 2013, 11:01:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r153222 r155418 51 51 void JIT::emit_op_jless(Instruction* currentInstruction) 52 52 { 53 unsignedop1 = currentInstruction[1].u.operand;54 unsignedop2 = currentInstruction[2].u.operand;53 int op1 = currentInstruction[1].u.operand; 54 int op2 = currentInstruction[2].u.operand; 55 55 unsigned target = currentInstruction[3].u.operand; 56 56 … … 60 60 void JIT::emit_op_jlesseq(Instruction* currentInstruction) 61 61 { 62 unsignedop1 = currentInstruction[1].u.operand;63 unsignedop2 = currentInstruction[2].u.operand;62 int op1 = currentInstruction[1].u.operand; 63 int op2 = currentInstruction[2].u.operand; 64 64 unsigned target = currentInstruction[3].u.operand; 65 65 … … 69 69 void JIT::emit_op_jgreater(Instruction* currentInstruction) 70 70 { 71 unsignedop1 = currentInstruction[1].u.operand;72 unsignedop2 = currentInstruction[2].u.operand;71 int op1 = currentInstruction[1].u.operand; 72 int op2 = currentInstruction[2].u.operand; 73 73 unsigned target = currentInstruction[3].u.operand; 74 74 … … 78 78 void JIT::emit_op_jgreatereq(Instruction* currentInstruction) 79 79 { 80 unsignedop1 = currentInstruction[1].u.operand;81 unsignedop2 = currentInstruction[2].u.operand;80 int op1 = currentInstruction[1].u.operand; 81 int op2 = currentInstruction[2].u.operand; 82 82 unsigned target = currentInstruction[3].u.operand; 83 83 … … 87 87 void JIT::emit_op_jnless(Instruction* currentInstruction) 88 88 { 89 unsignedop1 = currentInstruction[1].u.operand;90 unsignedop2 = currentInstruction[2].u.operand;89 int op1 = currentInstruction[1].u.operand; 90 int op2 = currentInstruction[2].u.operand; 91 91 unsigned target = currentInstruction[3].u.operand; 92 92 … … 96 96 void JIT::emit_op_jnlesseq(Instruction* currentInstruction) 97 97 { 98 unsignedop1 = currentInstruction[1].u.operand;99 unsignedop2 = currentInstruction[2].u.operand;98 int op1 = currentInstruction[1].u.operand; 99 int op2 = currentInstruction[2].u.operand; 100 100 unsigned target = currentInstruction[3].u.operand; 101 101 … … 105 105 void JIT::emit_op_jngreater(Instruction* currentInstruction) 106 106 { 107 unsignedop1 = currentInstruction[1].u.operand;108 unsignedop2 = currentInstruction[2].u.operand;107 int op1 = currentInstruction[1].u.operand; 108 int op2 = currentInstruction[2].u.operand; 109 109 unsigned target = currentInstruction[3].u.operand; 110 110 … … 114 114 void JIT::emit_op_jngreatereq(Instruction* currentInstruction) 115 115 { 116 unsignedop1 = currentInstruction[1].u.operand;117 unsignedop2 = currentInstruction[2].u.operand;116 int op1 = currentInstruction[1].u.operand; 117 int op2 = currentInstruction[2].u.operand; 118 118 unsigned target = currentInstruction[3].u.operand; 119 119 … … 123 123 void JIT::emitSlow_op_jless(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 124 124 { 125 unsignedop1 = currentInstruction[1].u.operand;126 unsignedop2 = currentInstruction[2].u.operand;125 int op1 = currentInstruction[1].u.operand; 126 int op2 = currentInstruction[2].u.operand; 127 127 unsigned target = currentInstruction[3].u.operand; 128 128 … … 132 132 void JIT::emitSlow_op_jlesseq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 133 133 { 134 unsignedop1 = currentInstruction[1].u.operand;135 unsignedop2 = currentInstruction[2].u.operand;134 int op1 = currentInstruction[1].u.operand; 135 int op2 = currentInstruction[2].u.operand; 136 136 unsigned target = currentInstruction[3].u.operand; 137 137 … … 141 141 void JIT::emitSlow_op_jgreater(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 142 142 { 143 unsignedop1 = currentInstruction[1].u.operand;144 unsignedop2 = currentInstruction[2].u.operand;143 int op1 = currentInstruction[1].u.operand; 144 int op2 = currentInstruction[2].u.operand; 145 145 unsigned target = currentInstruction[3].u.operand; 146 146 … … 150 150 void JIT::emitSlow_op_jgreatereq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 151 151 { 152 unsignedop1 = currentInstruction[1].u.operand;153 unsignedop2 = currentInstruction[2].u.operand;152 int op1 = currentInstruction[1].u.operand; 153 int op2 = currentInstruction[2].u.operand; 154 154 unsigned target = currentInstruction[3].u.operand; 155 155 … … 159 159 void JIT::emitSlow_op_jnless(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 160 160 { 161 unsignedop1 = currentInstruction[1].u.operand;162 unsignedop2 = currentInstruction[2].u.operand;161 int op1 = currentInstruction[1].u.operand; 162 int op2 = currentInstruction[2].u.operand; 163 163 unsigned target = currentInstruction[3].u.operand; 164 164 … … 168 168 void JIT::emitSlow_op_jnlesseq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 169 169 { 170 unsignedop1 = currentInstruction[1].u.operand;171 unsignedop2 = currentInstruction[2].u.operand;170 int op1 = currentInstruction[1].u.operand; 171 int op2 = currentInstruction[2].u.operand; 172 172 unsigned target = currentInstruction[3].u.operand; 173 173 … … 177 177 void JIT::emitSlow_op_jngreater(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 178 178 { 179 unsignedop1 = currentInstruction[1].u.operand;180 unsignedop2 = currentInstruction[2].u.operand;179 int op1 = currentInstruction[1].u.operand; 180 int op2 = currentInstruction[2].u.operand; 181 181 unsigned target = currentInstruction[3].u.operand; 182 182 … … 186 186 void JIT::emitSlow_op_jngreatereq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 187 187 { 188 unsignedop1 = currentInstruction[1].u.operand;189 unsignedop2 = currentInstruction[2].u.operand;188 int op1 = currentInstruction[1].u.operand; 189 int op2 = currentInstruction[2].u.operand; 190 190 unsigned target = currentInstruction[3].u.operand; 191 191 … … 197 197 void JIT::emit_op_negate(Instruction* currentInstruction) 198 198 { 199 unsigneddst = currentInstruction[1].u.operand;200 unsignedsrc = currentInstruction[2].u.operand;199 int dst = currentInstruction[1].u.operand; 200 int src = currentInstruction[2].u.operand; 201 201 202 202 emitGetVirtualRegister(src, regT0); … … 221 221 void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 222 222 { 223 unsignedresult = currentInstruction[1].u.operand;223 int result = currentInstruction[1].u.operand; 224 224 225 225 linkSlowCase(iter); // 0x7fffffff check … … 233 233 void JIT::emit_op_lshift(Instruction* currentInstruction) 234 234 { 235 unsignedresult = currentInstruction[1].u.operand;236 unsignedop1 = currentInstruction[2].u.operand;237 unsignedop2 = currentInstruction[3].u.operand;235 int result = currentInstruction[1].u.operand; 236 int op1 = currentInstruction[2].u.operand; 237 int op2 = currentInstruction[3].u.operand; 238 238 239 239 emitGetVirtualRegisters(op1, regT0, op2, regT2); … … 250 250 void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 251 251 { 252 unsignedresult = currentInstruction[1].u.operand;252 int result = currentInstruction[1].u.operand; 253 253 254 254 linkSlowCase(iter); … … 261 261 void JIT::emit_op_rshift(Instruction* currentInstruction) 262 262 { 263 unsignedresult = currentInstruction[1].u.operand;264 unsignedop1 = currentInstruction[2].u.operand;265 unsignedop2 = currentInstruction[3].u.operand;263 int result = currentInstruction[1].u.operand; 264 int op1 = currentInstruction[2].u.operand; 265 int op2 = currentInstruction[3].u.operand; 266 266 267 267 if (isOperandConstantImmediateInt(op2)) { … … 296 296 void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 297 297 { 298 unsignedresult = currentInstruction[1].u.operand;299 unsignedop1 = currentInstruction[2].u.operand;300 unsignedop2 = currentInstruction[3].u.operand;298 int result = currentInstruction[1].u.operand; 299 int op1 = currentInstruction[2].u.operand; 300 int op2 = currentInstruction[3].u.operand; 301 301 302 302 UNUSED_PARAM(op1); … … 323 323 void JIT::emit_op_urshift(Instruction* currentInstruction) 324 324 { 325 unsigneddst = currentInstruction[1].u.operand;326 unsignedop1 = currentInstruction[2].u.operand;327 unsignedop2 = currentInstruction[3].u.operand;325 int dst = currentInstruction[1].u.operand; 326 int op1 = currentInstruction[2].u.operand; 327 int op2 = currentInstruction[3].u.operand; 328 328 329 329 // Slow case of urshift makes assumptions about what registers hold the … … 359 359 void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 360 360 { 361 unsigneddst = currentInstruction[1].u.operand;362 unsignedop1 = currentInstruction[2].u.operand;363 unsignedop2 = currentInstruction[3].u.operand;361 int dst = currentInstruction[1].u.operand; 362 int op1 = currentInstruction[2].u.operand; 363 int op2 = currentInstruction[3].u.operand; 364 364 if (isOperandConstantImmediateInt(op2)) { 365 365 int shift = getConstantOperand(op2).asInt32(); … … 414 414 } 415 415 416 void JIT::emit_compareAndJump(OpcodeID, unsigned op1, unsignedop2, unsigned target, RelationalCondition condition)416 void JIT::emit_compareAndJump(OpcodeID, int op1, int op2, unsigned target, RelationalCondition condition) 417 417 { 418 418 // We generate inline code for the following cases in the fast path: … … 458 458 } 459 459 460 void JIT::emit_compareAndJumpSlow( unsigned op1, unsignedop2, unsigned target, DoubleCondition condition, int (JIT_STUB *stub)(STUB_ARGS_DECLARATION), bool invert, Vector<SlowCaseEntry>::iterator& iter)460 void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondition condition, int (JIT_STUB *stub)(STUB_ARGS_DECLARATION), bool invert, Vector<SlowCaseEntry>::iterator& iter) 461 461 { 462 462 COMPILE_ASSERT(OPCODE_LENGTH(op_jless) == OPCODE_LENGTH(op_jlesseq), OPCODE_LENGTH_op_jlesseq_equals_op_jless); … … 568 568 void JIT::emit_op_bitand(Instruction* currentInstruction) 569 569 { 570 unsignedresult = currentInstruction[1].u.operand;571 unsignedop1 = currentInstruction[2].u.operand;572 unsignedop2 = currentInstruction[3].u.operand;570 int result = currentInstruction[1].u.operand; 571 int op1 = currentInstruction[2].u.operand; 572 int op2 = currentInstruction[3].u.operand; 573 573 574 574 if (isOperandConstantImmediateInt(op1)) { … … 596 596 void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 597 597 { 598 unsignedresult = currentInstruction[1].u.operand;598 int result = currentInstruction[1].u.operand; 599 599 600 600 linkSlowCase(iter); … … 607 607 void JIT::emit_op_inc(Instruction* currentInstruction) 608 608 { 609 unsignedsrcDst = currentInstruction[1].u.operand;609 int srcDst = currentInstruction[1].u.operand; 610 610 611 611 emitGetVirtualRegister(srcDst, regT0); … … 618 618 void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 619 619 { 620 unsignedsrcDst = currentInstruction[1].u.operand;620 int srcDst = currentInstruction[1].u.operand; 621 621 622 622 linkSlowCase(iter); … … 629 629 void JIT::emit_op_dec(Instruction* currentInstruction) 630 630 { 631 unsignedsrcDst = currentInstruction[1].u.operand;631 int srcDst = currentInstruction[1].u.operand; 632 632 633 633 emitGetVirtualRegister(srcDst, regT0); … … 640 640 void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 641 641 { 642 unsignedsrcDst = currentInstruction[1].u.operand;642 int srcDst = currentInstruction[1].u.operand; 643 643 644 644 linkSlowCase(iter); … … 655 655 void JIT::emit_op_mod(Instruction* currentInstruction) 656 656 { 657 unsignedresult = currentInstruction[1].u.operand;658 unsignedop1 = currentInstruction[2].u.operand;659 unsignedop2 = currentInstruction[3].u.operand;657 int result = currentInstruction[1].u.operand; 658 int op1 = currentInstruction[2].u.operand; 659 int op2 = currentInstruction[3].u.operand; 660 660 661 661 // Make sure registers are correct for x86 IDIV instructions. … … 684 684 void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 685 685 { 686 unsignedresult = currentInstruction[1].u.operand;686 int result = currentInstruction[1].u.operand; 687 687 688 688 linkSlowCase(iter); … … 700 700 void JIT::emit_op_mod(Instruction* currentInstruction) 701 701 { 702 unsignedresult = currentInstruction[1].u.operand;703 unsignedop1 = currentInstruction[2].u.operand;704 unsignedop2 = currentInstruction[3].u.operand;702 int result = currentInstruction[1].u.operand; 703 int op1 = currentInstruction[2].u.operand; 704 int op2 = currentInstruction[3].u.operand; 705 705 706 706 UNUSED_PARAM(op1); … … 723 723 /* ------------------------------ BEGIN: USE(JSVALUE64) (OP_ADD, OP_SUB, OP_MUL) ------------------------------ */ 724 724 725 void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsignedop2, OperandTypes)725 void JIT::compileBinaryArithOp(OpcodeID opcodeID, int, int op1, int op2, OperandTypes) 726 726 { 727 727 emitGetVirtualRegisters(op1, regT0, op2, regT1); … … 769 769 } 770 770 771 void JIT::compileBinaryArithOpSlowCase(Instruction* currentInstruction, OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned result, unsigned op1, unsignedop2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase)771 void JIT::compileBinaryArithOpSlowCase(Instruction* currentInstruction, OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, int result, int op1, int op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase) 772 772 { 773 773 // We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset. … … 855 855 void JIT::emit_op_add(Instruction* currentInstruction) 856 856 { 857 unsignedresult = currentInstruction[1].u.operand;858 unsignedop1 = currentInstruction[2].u.operand;859 unsignedop2 = currentInstruction[3].u.operand;857 int result = currentInstruction[1].u.operand; 858 int op1 = currentInstruction[2].u.operand; 859 int op2 = currentInstruction[3].u.operand; 860 860 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 861 861 … … 885 885 void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 886 886 { 887 unsignedresult = currentInstruction[1].u.operand;888 unsignedop1 = currentInstruction[2].u.operand;889 unsignedop2 = currentInstruction[3].u.operand;887 int result = currentInstruction[1].u.operand; 888 int op1 = currentInstruction[2].u.operand; 889 int op2 = currentInstruction[3].u.operand; 890 890 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 891 891 … … 902 902 void JIT::emit_op_mul(Instruction* currentInstruction) 903 903 { 904 unsignedresult = currentInstruction[1].u.operand;905 unsignedop1 = currentInstruction[2].u.operand;906 unsignedop2 = currentInstruction[3].u.operand;904 int result = currentInstruction[1].u.operand; 905 int op1 = currentInstruction[2].u.operand; 906 int op2 = currentInstruction[3].u.operand; 907 907 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 908 908 … … 935 935 void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 936 936 { 937 unsignedresult = currentInstruction[1].u.operand;938 unsignedop1 = currentInstruction[2].u.operand;939 unsignedop2 = currentInstruction[3].u.operand;937 int result = currentInstruction[1].u.operand; 938 int op1 = currentInstruction[2].u.operand; 939 int op2 = currentInstruction[3].u.operand; 940 940 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 941 941 … … 947 947 void JIT::emit_op_div(Instruction* currentInstruction) 948 948 { 949 unsigneddst = currentInstruction[1].u.operand;950 unsignedop1 = currentInstruction[2].u.operand;951 unsignedop2 = currentInstruction[3].u.operand;949 int dst = currentInstruction[1].u.operand; 950 int op1 = currentInstruction[2].u.operand; 951 int op2 = currentInstruction[3].u.operand; 952 952 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 953 953 … … 1029 1029 void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1030 1030 { 1031 unsignedresult = currentInstruction[1].u.operand;1032 unsignedop1 = currentInstruction[2].u.operand;1033 unsignedop2 = currentInstruction[3].u.operand;1031 int result = currentInstruction[1].u.operand; 1032 int op1 = currentInstruction[2].u.operand; 1033 int op2 = currentInstruction[3].u.operand; 1034 1034 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 1035 1035 if (types.first().definitelyIsNumber() && types.second().definitelyIsNumber()) { … … 1055 1055 void JIT::emit_op_sub(Instruction* currentInstruction) 1056 1056 { 1057 unsignedresult = currentInstruction[1].u.operand;1058 unsignedop1 = currentInstruction[2].u.operand;1059 unsignedop2 = currentInstruction[3].u.operand;1057 int result = currentInstruction[1].u.operand; 1058 int op1 = currentInstruction[2].u.operand; 1059 int op2 = currentInstruction[3].u.operand; 1060 1060 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 1061 1061 … … 1066 1066 void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1067 1067 { 1068 unsignedresult = currentInstruction[1].u.operand;1069 unsignedop1 = currentInstruction[2].u.operand;1070 unsignedop2 = currentInstruction[3].u.operand;1068 int result = currentInstruction[1].u.operand; 1069 int op1 = currentInstruction[2].u.operand; 1070 int op2 = currentInstruction[3].u.operand; 1071 1071 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 1072 1072
Note:
See TracChangeset
for help on using the changeset viewer.