Changeset 36746 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 21, 2008, 4:08:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r36738 r36746 335 335 } 336 336 337 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImm (X86Assembler::RegisterID reg, unsigned opcodeIndex)337 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNum(X86Assembler::RegisterID reg, unsigned opcodeIndex) 338 338 { 339 339 m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, reg); … … 341 341 } 342 342 343 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImm s(X86Assembler::RegisterID reg1, X86Assembler::RegisterID reg2, unsigned opcodeIndex)343 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImmNums(X86Assembler::RegisterID reg1, X86Assembler::RegisterID reg2, unsigned opcodeIndex) 344 344 { 345 345 m_jit.movl_rr(reg1, X86::ecx); 346 346 m_jit.andl_rr(reg2, X86::ecx); 347 emitJumpSlowCaseIfNotImm (X86::ecx, opcodeIndex);347 emitJumpSlowCaseIfNotImmNum(X86::ecx, opcodeIndex); 348 348 } 349 349 … … 578 578 if (JSImmediate::isNumber(value)) { 579 579 emitGetArg(src1, X86::eax); 580 emitJumpSlowCaseIfNotImm (X86::eax, i);580 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 581 581 m_jit.addl_i32r(getDeTaggedConstantImmediate(value), X86::eax); 582 582 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); … … 588 588 emitGetArg(src1, X86::eax); 589 589 emitGetArg(src2, X86::edx); 590 emitJumpSlowCaseIfNotImm s(X86::eax, X86::edx, i);590 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i); 591 591 emitFastArithDeTagImmediate(X86::eax); 592 592 m_jit.addl_rr(X86::edx, X86::eax); … … 624 624 int srcDst = instruction[i + 1].u.operand; 625 625 emitGetArg(srcDst, X86::eax); 626 emitJumpSlowCaseIfNotImm (X86::eax, i);626 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 627 627 m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax); 628 628 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); … … 646 646 if (src2imm) { 647 647 emitGetArg(instruction[i + 1].u.operand, X86::edx); 648 emitJumpSlowCaseIfNotImm (X86::edx, i);648 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 649 649 m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx); 650 650 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target)); … … 652 652 emitGetArg(instruction[i + 1].u.operand, X86::eax); 653 653 emitGetArg(instruction[i + 2].u.operand, X86::edx); 654 emitJumpSlowCaseIfNotImm (X86::eax, i);655 emitJumpSlowCaseIfNotImm (X86::edx, i);654 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 655 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 656 656 m_jit.cmpl_rr(X86::edx, X86::eax); 657 657 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJl(), i + 3 + target)); … … 667 667 if (src2imm) { 668 668 emitGetArg(instruction[i + 1].u.operand, X86::edx); 669 emitJumpSlowCaseIfNotImm (X86::edx, i);669 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 670 670 m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx); 671 671 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJle(), i + 3 + target)); … … 673 673 emitGetArg(instruction[i + 1].u.operand, X86::eax); 674 674 emitGetArg(instruction[i + 2].u.operand, X86::edx); 675 emitJumpSlowCaseIfNotImm (X86::eax, i);676 emitJumpSlowCaseIfNotImm (X86::edx, i);675 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 676 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 677 677 m_jit.cmpl_rr(X86::edx, X86::eax); 678 678 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJle(), i + 3 + target)); … … 775 775 if (JSImmediate::isNumber(value)) { 776 776 emitGetArg(nonconstant, X86::eax); 777 emitJumpSlowCaseIfNotImm (X86::eax, i);777 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 778 778 emitFastArithImmToInt(X86::eax); 779 779 m_jit.imull_i32r( X86::eax, getDeTaggedConstantImmediate(value), X86::eax); … … 788 788 emitGetArg(src1, X86::eax); 789 789 emitGetArg(src2, X86::edx); 790 emitJumpSlowCaseIfNotImm s(X86::eax, X86::edx, i);790 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i); 791 791 emitFastArithDeTagImmediate(X86::eax); 792 792 emitFastArithImmToInt(X86::edx); … … 937 937 emitGetArg(instruction[i + 2].u.operand, X86::eax); 938 938 emitGetArg(instruction[i + 3].u.operand, X86::edx); 939 emitJumpSlowCaseIfNotImm (X86::edx, i);939 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 940 940 emitFastArithImmToInt(X86::edx); 941 941 m_jit.testl_i32r(JSImmediate::TagMask, X86::eax); … … 968 968 emitGetArg(instruction[i + 2].u.operand, X86::eax); 969 969 emitGetArg(instruction[i + 3].u.operand, X86::edx); 970 emitJumpSlowCaseIfNotImm s(X86::eax, X86::edx, i);970 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i); 971 971 m_jit.subl_rr(X86::edx, X86::eax); 972 972 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); … … 979 979 emitGetArg(instruction[i + 1].u.operand, X86::eax); 980 980 emitGetArg(instruction[i + 2].u.operand, X86::edx); 981 emitJumpSlowCaseIfNotImm (X86::edx, i);981 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 982 982 emitFastArithImmToInt(X86::edx); 983 983 m_jit.testl_i32r(JSImmediate::TagMask, X86::eax); … … 1088 1088 int srcDst = instruction[i + 1].u.operand; 1089 1089 emitGetArg(srcDst, X86::eax); 1090 emitJumpSlowCaseIfNotImm (X86::eax, i);1090 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1091 1091 m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax); 1092 1092 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); … … 1100 1100 if (src2imm) { 1101 1101 emitGetArg(instruction[i + 1].u.operand, X86::edx); 1102 emitJumpSlowCaseIfNotImm (X86::edx, i);1102 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 1103 1103 m_jit.cmpl_i32r(reinterpret_cast<unsigned>(src2imm), X86::edx); 1104 1104 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target)); … … 1106 1106 emitGetArg(instruction[i + 1].u.operand, X86::eax); 1107 1107 emitGetArg(instruction[i + 2].u.operand, X86::edx); 1108 emitJumpSlowCaseIfNotImm (X86::eax, i);1109 emitJumpSlowCaseIfNotImm (X86::edx, i);1108 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1109 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 1110 1110 m_jit.cmpl_rr(X86::edx, X86::eax); 1111 1111 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJge(), i + 3 + target)); … … 1146 1146 emitGetArg(srcDst, X86::eax); 1147 1147 m_jit.movl_rr(X86::eax, X86::edx); 1148 emitJumpSlowCaseIfNotImm (X86::eax, i);1148 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1149 1149 m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx); 1150 1150 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); … … 1177 1177 break; 1178 1178 } 1179 CTI_COMPILE_BINARY_OP(op_eq) 1179 case op_eq: { 1180 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1181 emitGetArg(instruction[i + 3].u.operand, X86::edx); 1182 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i); 1183 m_jit.cmpl_rr(X86::edx, X86::eax); 1184 m_jit.sete_r(X86::eax); 1185 m_jit.movzbl_rr(X86::eax, X86::eax); 1186 emitTagAsBoolImmediate(X86::eax); 1187 emitPutResult(instruction[i + 1].u.operand); 1188 i += 4; 1189 break; 1190 } 1180 1191 case op_lshift: { 1181 1192 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1182 1193 emitGetArg(instruction[i + 3].u.operand, X86::ecx); 1183 emitJumpSlowCaseIfNotImm (X86::eax, i);1184 emitJumpSlowCaseIfNotImm (X86::ecx, i);1194 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1195 emitJumpSlowCaseIfNotImmNum(X86::ecx, i); 1185 1196 emitFastArithImmToInt(X86::eax); 1186 1197 emitFastArithImmToInt(X86::ecx); … … 1197 1208 if (JSValue* value = getConstantImmediateNumericArg(src1)) { 1198 1209 emitGetArg(src2, X86::eax); 1199 emitJumpSlowCaseIfNotImm (X86::eax, i);1210 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1200 1211 m_jit.andl_i32r(reinterpret_cast<unsigned>(value), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate 1201 1212 emitPutResult(dst); 1202 1213 } else if (JSValue* value = getConstantImmediateNumericArg(src2)) { 1203 1214 emitGetArg(src1, X86::eax); 1204 emitJumpSlowCaseIfNotImm (X86::eax, i);1215 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1205 1216 m_jit.andl_i32r(reinterpret_cast<unsigned>(value), X86::eax); 1206 1217 emitPutResult(dst); … … 1209 1220 emitGetArg(src2, X86::edx); 1210 1221 m_jit.andl_rr(X86::edx, X86::eax); 1211 emitJumpSlowCaseIfNotImm (X86::eax, i);1222 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1212 1223 emitPutResult(dst); 1213 1224 } … … 1218 1229 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1219 1230 emitGetArg(instruction[i + 3].u.operand, X86::ecx); 1220 emitJumpSlowCaseIfNotImm (X86::eax, i);1221 emitJumpSlowCaseIfNotImm (X86::ecx, i);1231 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1232 emitJumpSlowCaseIfNotImmNum(X86::ecx, i); 1222 1233 emitFastArithImmToInt(X86::ecx); 1223 1234 m_jit.sarl_CLr(X86::eax); … … 1229 1240 case op_bitnot: { 1230 1241 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1231 emitJumpSlowCaseIfNotImm (X86::eax, i);1242 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1232 1243 m_jit.xorl_i8r(~JSImmediate::TagBitTypeInteger, X86::eax); 1233 1244 emitPutResult(instruction[i + 1].u.operand); … … 1256 1267 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1257 1268 emitGetArg(instruction[i + 3].u.operand, X86::ecx); 1258 emitJumpSlowCaseIfNotImm (X86::eax, i);1259 emitJumpSlowCaseIfNotImm (X86::ecx, i);1269 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1270 emitJumpSlowCaseIfNotImmNum(X86::ecx, i); 1260 1271 emitFastArithDeTagImmediate(X86::eax); 1261 1272 emitFastArithDeTagImmediate(X86::ecx); … … 1293 1304 emitGetArg(srcDst, X86::eax); 1294 1305 m_jit.movl_rr(X86::eax, X86::edx); 1295 emitJumpSlowCaseIfNotImm (X86::eax, i);1306 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1296 1307 m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx); 1297 1308 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); … … 1305 1316 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1306 1317 emitGetArg(instruction[i + 3].u.operand, X86::edx); 1307 emitJumpSlowCaseIfNotImm s(X86::eax, X86::edx, i);1318 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i); 1308 1319 m_jit.xorl_rr(X86::edx, X86::eax); 1309 1320 emitFastArithReTagImmediate(X86::eax); … … 1323 1334 emitGetArg(instruction[i + 2].u.operand, X86::eax); 1324 1335 emitGetArg(instruction[i + 3].u.operand, X86::edx); 1325 emitJumpSlowCaseIfNotImm s(X86::eax, X86::edx, i);1336 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i); 1326 1337 m_jit.orl_rr(X86::edx, X86::eax); 1327 1338 emitPutResult(instruction[i + 1].u.operand); … … 2031 2042 break; 2032 2043 } 2044 case op_eq: 2045 m_jit.link(iter->from, m_jit.label()); 2046 emitPutArg(X86::eax, 0); 2047 emitPutArg(X86::edx, 4); 2048 emitCall(i, Machine::cti_op_eq); 2049 emitPutResult(instruction[i + 1].u.operand); 2050 i += 4; 2051 break; 2033 2052 CTI_COMPILE_BINARY_OP_SLOW_CASE(op_stricteq); 2034 2053
Note:
See TracChangeset
for help on using the changeset viewer.