Changeset 36324 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 10, 2008, 7:10:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r36317 r36324 615 615 break; 616 616 } 617 CTI_COMPILE_BINARY_OP(op_mul); 617 case op_mul: { 618 unsigned dst = instruction[i + 1].u.operand; 619 unsigned src1 = instruction[i + 2].u.operand; 620 unsigned src2 = instruction[i + 3].u.operand; 621 if (src1 < m_codeBlock->constantRegisters.size() || src2 < m_codeBlock->constantRegisters.size()) { 622 unsigned constant = src1; 623 unsigned nonconstant = src2; 624 if (!(src1 < m_codeBlock->constantRegisters.size())) { 625 constant = src2; 626 nonconstant = src1; 627 } 628 JSValue* value = m_codeBlock->constantRegisters[constant].jsValue(m_exec); 629 if (JSImmediate::isNumber(value)) { 630 emitGetArg(nonconstant, X86::eax); 631 emitJumpSlowCaseIfNotImm(X86::eax, i); 632 emitFastArithImmToInt(X86::eax); 633 m_jit.imull_i32r( X86::eax, getDeTaggedConstantImmediate(value), X86::eax); 634 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 635 emitFastArithPotentiallyReTagImmediate(X86::eax); 636 emitPutResult(dst); 637 i += 4; 638 break; 639 } 640 } 641 642 emitGetArg(src1, X86::eax); 643 emitGetArg(src2, X86::edx); 644 emitJumpSlowCaseIfNotImms(X86::eax, X86::edx, i); 645 emitFastArithDeTagImmediate(X86::eax); 646 emitFastArithImmToInt(X86::edx); 647 m_jit.imull_rr(X86::edx, X86::eax); 648 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i)); 649 emitFastArithPotentiallyReTagImmediate(X86::eax); 650 emitPutResult(dst); 651 i += 4; 652 break; 653 } 618 654 case op_new_func: { 619 655 FuncDeclNode* func = (m_codeBlock->functions[instruction[i + 2].u.operand]).get(); … … 1283 1319 } 1284 1320 1321 #define CTI_COMPILE_BINARY_OP_SLOW_CASE(name) \ 1322 case name: { \ 1323 m_jit.link(iter->from, m_jit.label()); \ 1324 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \ 1325 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); \ 1326 emitCall(i, Machine::cti_##name); \ 1327 emitPutResult(instruction[i + 1].u.operand); \ 1328 i += 4; \ 1329 break; \ 1330 } 1331 1285 1332 void CTI::privateCompileSlowCases() 1286 1333 { … … 1288 1335 for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end(); ++iter) { 1289 1336 int i = iter->to; 1290 m_jit.emitRestoreArgumentReference();1337 m_jit.emitRestoreArgumentReference(); 1291 1338 switch (m_machine->getOpcodeID(instruction[i].u.opcode)) { 1292 1339 case op_add: { … … 1590 1637 break; 1591 1638 } 1639 CTI_COMPILE_BINARY_OP_SLOW_CASE(op_mul); 1592 1640 default: 1593 1641 ASSERT_NOT_REACHED();
Note:
See TracChangeset
for help on using the changeset viewer.