Changeset 36462 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 15, 2008, 4:33:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r36427 r36462 318 318 } 319 319 320 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfIsJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex) 321 { 322 m_jit.testl_i32r(JSImmediate::TagMask, reg); 323 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), opcodeIndex)); 324 } 325 320 326 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex) 321 327 { … … 1390 1396 } 1391 1397 case op_eq_null: { 1392 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1393 emitCall(i, Machine::cti_op_eq_null); 1394 emitPutResult(instruction[i + 1].u.operand); 1398 emitGetArg(instruction[i + 2].u.operand, X86::edx); 1399 1400 // go to a slow case either if this is not an immediate, or if the immediate is not undefined/null. 1401 emitJumpSlowCaseIfIsJSCell(X86::edx, i); 1402 m_jit.andl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::edx); 1403 m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::edx); 1404 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 1405 1406 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax); 1407 emitPutResult(instruction[i + 1].u.operand); 1408 1395 1409 i += 3; 1396 1410 break; 1397 1411 } 1398 1412 case op_neq_null: { 1399 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1400 emitCall(i, Machine::cti_op_neq_null); 1401 emitPutResult(instruction[i + 1].u.operand); 1413 emitGetArg(instruction[i + 2].u.operand, X86::edx); 1414 1415 // go to a slow case either if this is not an immediate, or if the immediate is not undefined/null. 1416 emitJumpSlowCaseIfIsJSCell(X86::edx, i); 1417 m_jit.andl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::edx); 1418 m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::edx); 1419 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 1420 1421 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax); 1422 emitPutResult(instruction[i + 1].u.operand); 1423 1402 1424 i += 3; 1403 1425 break; … … 1848 1870 } 1849 1871 CTI_COMPILE_BINARY_OP_SLOW_CASE(op_mul); 1872 case op_eq_null: { 1873 m_jit.link(iter->from, m_jit.label()); 1874 1875 // Value is a JSCell - speculate false, check for StringObjectThatMasqueradesAsUndefined. 1876 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax); 1877 emitPutResult(instruction[i + 1].u.operand); 1878 m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringObjectThatMasqueradesAsUndefinedVptr), X86::edx); 1879 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3]); 1880 1881 // Value is a StringObjectThatMasqueradesAsUndefined 1882 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax); 1883 emitPutResult(instruction[i + 1].u.operand); 1884 m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 3]); 1885 1886 // Value is an immediate other than undefined/null 1887 m_jit.link((++iter)->from, m_jit.label()); 1888 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax); 1889 emitPutResult(instruction[i + 1].u.operand); 1890 1891 i += 3; 1892 break; 1893 } 1894 case op_neq_null: { 1895 m_jit.link(iter->from, m_jit.label()); 1896 1897 // Value is a JSCell - speculate false, check for StringObjectThatMasqueradesAsUndefined. 1898 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax); 1899 emitPutResult(instruction[i + 1].u.operand); 1900 m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringObjectThatMasqueradesAsUndefinedVptr), X86::edx); 1901 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3]); 1902 1903 // Value is a StringObjectThatMasqueradesAsUndefined 1904 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax); 1905 emitPutResult(instruction[i + 1].u.operand); 1906 m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 3]); 1907 1908 // Value is an immediate other than undefined/null 1909 m_jit.link((++iter)->from, m_jit.label()); 1910 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax); 1911 emitPutResult(instruction[i + 1].u.operand); 1912 1913 i += 3; 1914 break; 1915 } 1850 1916 default: 1851 1917 ASSERT_NOT_REACHED();
Note:
See TracChangeset
for help on using the changeset viewer.