Changeset 36475 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 15, 2008, 8:46:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r36463 r36475 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 326 320 ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex) 327 321 { … … 1403 1397 } 1404 1398 case op_eq_null: { 1405 emitGetArg(instruction[i + 2].u.operand, X86::edx); 1406 1407 // go to a slow case either if this is not an immediate, or if the immediate is not undefined/null. 1408 emitJumpSlowCaseIfIsJSCell(X86::edx, i); 1409 m_jit.andl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::edx); 1410 m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::edx); 1411 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 1412 1413 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax); 1414 emitPutResult(instruction[i + 1].u.operand); 1415 1399 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1400 emitCall(i, Machine::cti_op_eq_null); 1401 emitPutResult(instruction[i + 1].u.operand); 1416 1402 i += 3; 1417 1403 break; 1418 1404 } 1419 1405 case op_neq_null: { 1420 emitGetArg(instruction[i + 2].u.operand, X86::edx); 1421 1422 // go to a slow case either if this is not an immediate, or if the immediate is not undefined/null. 1423 emitJumpSlowCaseIfIsJSCell(X86::edx, i); 1424 m_jit.andl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::edx); 1425 m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::edx); 1426 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJne(), i)); 1427 1428 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax); 1429 emitPutResult(instruction[i + 1].u.operand); 1430 1406 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1407 emitCall(i, Machine::cti_op_neq_null); 1408 emitPutResult(instruction[i + 1].u.operand); 1431 1409 i += 3; 1432 1410 break; … … 1877 1855 } 1878 1856 CTI_COMPILE_BINARY_OP_SLOW_CASE(op_mul); 1879 case op_eq_null: {1880 m_jit.link(iter->from, m_jit.label());1881 1882 // Value is a JSCell - speculate false, check for StringObjectThatMasqueradesAsUndefined.1883 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);1884 emitPutResult(instruction[i + 1].u.operand);1885 m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringObjectThatMasqueradesAsUndefinedVptr), X86::edx);1886 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3]);1887 1888 // Value is a StringObjectThatMasqueradesAsUndefined1889 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);1890 emitPutResult(instruction[i + 1].u.operand);1891 m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 3]);1892 1893 // Value is an immediate other than undefined/null1894 m_jit.link((++iter)->from, m_jit.label());1895 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);1896 emitPutResult(instruction[i + 1].u.operand);1897 1898 i += 3;1899 break;1900 }1901 case op_neq_null: {1902 m_jit.link(iter->from, m_jit.label());1903 1904 // Value is a JSCell - speculate false, check for StringObjectThatMasqueradesAsUndefined.1905 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);1906 emitPutResult(instruction[i + 1].u.operand);1907 m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringObjectThatMasqueradesAsUndefinedVptr), X86::edx);1908 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3]);1909 1910 // Value is a StringObjectThatMasqueradesAsUndefined1911 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);1912 emitPutResult(instruction[i + 1].u.operand);1913 m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 3]);1914 1915 // Value is an immediate other than undefined/null1916 m_jit.link((++iter)->from, m_jit.label());1917 m_jit.movl_i32r(reinterpret_cast<uint32_t>(JSImmediate::trueImmediate()), X86::eax);1918 emitPutResult(instruction[i + 1].u.operand);1919 1920 i += 3;1921 break;1922 }1923 1857 default: 1924 1858 ASSERT_NOT_REACHED();
Note:
See TracChangeset
for help on using the changeset viewer.