Changeset 37650 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Oct 17, 2008, 2:06:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r37647 r37650 313 313 } 314 314 315 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitC all(unsigned opcodeIndex, CTIHelper_j helper)315 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_j helper) 316 316 { 317 317 #if ENABLE(SAMPLING_TOOL) … … 319 319 #endif 320 320 m_jit.emitRestoreArgumentReference(); 321 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 321 322 X86Assembler::JmpSrc call = m_jit.emitCall(); 322 323 m_calls.append(CallRecord(call, helper, opcodeIndex)); … … 328 329 } 329 330 330 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitC all(unsigned opcodeIndex, CTIHelper_p helper)331 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_p helper) 331 332 { 332 333 #if ENABLE(SAMPLING_TOOL) … … 334 335 #endif 335 336 m_jit.emitRestoreArgumentReference(); 337 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 336 338 X86Assembler::JmpSrc call = m_jit.emitCall(); 337 339 m_calls.append(CallRecord(call, helper, opcodeIndex)); … … 343 345 } 344 346 345 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitC all(unsigned opcodeIndex, CTIHelper_b helper)347 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_b helper) 346 348 { 347 349 #if ENABLE(SAMPLING_TOOL) … … 349 351 #endif 350 352 m_jit.emitRestoreArgumentReference(); 353 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 351 354 X86Assembler::JmpSrc call = m_jit.emitCall(); 352 355 m_calls.append(CallRecord(call, helper, opcodeIndex)); … … 358 361 } 359 362 360 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitC all(unsigned opcodeIndex, CTIHelper_v helper)363 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_v helper) 361 364 { 362 365 #if ENABLE(SAMPLING_TOOL) … … 364 367 #endif 365 368 m_jit.emitRestoreArgumentReference(); 369 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 366 370 X86Assembler::JmpSrc call = m_jit.emitCall(); 367 371 m_calls.append(CallRecord(call, helper, opcodeIndex)); … … 373 377 } 374 378 375 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitC all(unsigned opcodeIndex, CTIHelper_s helper)379 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_s helper) 376 380 { 377 381 #if ENABLE(SAMPLING_TOOL) … … 379 383 #endif 380 384 m_jit.emitRestoreArgumentReference(); 385 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 381 386 X86Assembler::JmpSrc call = m_jit.emitCall(); 382 387 m_calls.append(CallRecord(call, helper, opcodeIndex)); … … 388 393 } 389 394 390 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitC all(unsigned opcodeIndex, CTIHelper_2 helper)395 ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCTICall(unsigned opcodeIndex, CTIHelper_2 helper) 391 396 { 392 397 #if ENABLE(SAMPLING_TOOL) … … 394 399 #endif 395 400 m_jit.emitRestoreArgumentReference(); 401 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame); 396 402 X86Assembler::JmpSrc call = m_jit.emitCall(); 397 403 m_calls.append(CallRecord(call, helper, opcodeIndex)); … … 487 493 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \ 488 494 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); \ 489 emitC all(i, Machine::cti_##name); \495 emitCTICall(i, Machine::cti_##name); \ 490 496 emitPutResult(instruction[i + 1].u.operand); \ 491 497 i += 4; \ … … 496 502 case name: { \ 497 503 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \ 498 emitC all(i, Machine::cti_##name); \504 emitCTICall(i, Machine::cti_##name); \ 499 505 emitPutResult(instruction[i + 1].u.operand); \ 500 506 i += 3; \ … … 554 560 if (type == OpCallEval) { 555 561 emitGetPutArg(callee, 0, X86::ecx); 556 emitC all(i, Machine::cti_op_call_eval);562 emitCTICall(i, Machine::cti_op_call_eval); 557 563 558 564 m_jit.cmpl_i32r(reinterpret_cast<unsigned>(JSImmediate::impossibleValue()), X86::eax); … … 574 580 575 581 // This handles host functions 576 emitC all(i, ((type == OpConstruct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction));582 emitCTICall(i, ((type == OpConstruct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction)); 577 583 578 584 X86Assembler::JmpSrc wasNotJSFunction = m_jit.emitUnlinkedJmp(); … … 580 586 581 587 // This handles JSFunctions 582 emitC all(i, (type == OpConstruct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction);588 emitCTICall(i, (type == OpConstruct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction); 583 589 584 590 compileOpCallInitializeCallFrame(callee, argCount); … … 588 594 589 595 // Put the new value of 'callFrame' into edi and onto the stack, too. 590 emitPutCTIParam(X86::edx, CTI_ARGS_callFrame);591 596 m_jit.movl_rr(X86::edx, X86::edi); 592 597 … … 665 670 m_jit.subl_i8r(1, X86::esi); 666 671 X86Assembler::JmpSrc skipTimeout = m_jit.emitUnlinkedJne(); 667 emitC all(opcodeIndex, Machine::cti_timeout_check);672 emitCTICall(opcodeIndex, Machine::cti_timeout_check); 668 673 669 674 emitGetCTIParam(CTI_ARGS_globalData, X86::ecx); … … 892 897 emitGetPutArg(src2, 4, X86::ecx); 893 898 if (opcodeID == op_add) 894 emitC all(i, Machine::cti_op_add);899 emitCTICall(i, Machine::cti_op_add); 895 900 else if (opcodeID == op_sub) 896 emitC all(i, Machine::cti_op_sub);901 emitCTICall(i, Machine::cti_op_sub); 897 902 else { 898 903 ASSERT(opcodeID == op_mul); 899 emitC all(i, Machine::cti_op_mul);904 emitCTICall(i, Machine::cti_op_mul); 900 905 } 901 906 emitPutResult(dst); … … 952 957 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 953 958 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); 954 emitC all(i, Machine::cti_op_add);959 emitCTICall(i, Machine::cti_op_add); 955 960 emitPutResult(instruction[i + 1].u.operand); 956 961 } … … 962 967 case op_end: { 963 968 if (m_codeBlock->needsFullScopeChain) 964 emitC all(i, Machine::cti_op_end);969 emitCTICall(i, Machine::cti_op_end); 965 970 emitGetArg(instruction[i + 1].u.operand, X86::eax); 966 971 #if ENABLE(SAMPLING_TOOL) … … 1039 1044 } 1040 1045 case op_new_object: { 1041 emitC all(i, Machine::cti_op_new_object);1046 emitCTICall(i, Machine::cti_op_new_object); 1042 1047 emitPutResult(instruction[i + 1].u.operand); 1043 1048 i += 2; … … 1165 1170 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 1166 1171 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); 1167 emitC all(i, Machine::cti_op_del_by_id);1172 emitCTICall(i, Machine::cti_op_del_by_id); 1168 1173 emitPutResult(instruction[i + 1].u.operand); 1169 1174 i += 4; … … 1204 1209 FuncDeclNode* func = (m_codeBlock->functions[instruction[i + 2].u.operand]).get(); 1205 1210 emitPutArgConstant(reinterpret_cast<unsigned>(func), 0); 1206 emitC all(i, Machine::cti_op_new_func);1211 emitCTICall(i, Machine::cti_op_new_func); 1207 1212 emitPutResult(instruction[i + 1].u.operand); 1208 1213 i += 3; … … 1258 1263 case op_tear_off_activation: { 1259 1264 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1260 emitC all(i, Machine::cti_op_tear_off_activation);1265 emitCTICall(i, Machine::cti_op_tear_off_activation); 1261 1266 i += 2; 1262 1267 break; 1263 1268 } 1264 1269 case op_tear_off_arguments: { 1265 emitC all(i, Machine::cti_op_tear_off_arguments);1270 emitCTICall(i, Machine::cti_op_tear_off_arguments); 1266 1271 i += 1; 1267 1272 break; … … 1276 1281 // We could JIT generate the deref, only calling out to C when the refcount hits zero. 1277 1282 if (m_codeBlock->needsFullScopeChain) 1278 emitC all(i, Machine::cti_op_ret_scopeChain);1283 emitCTICall(i, Machine::cti_op_ret_scopeChain); 1279 1284 1280 1285 // Return the result in %eax. … … 1286 1291 // Restore our caller's "r". 1287 1292 emitGetArg(RegisterFile::CallerFrame, X86::edi); 1288 emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);1289 1293 1290 1294 // Return. … … 1294 1298 // Profiling hook 1295 1299 m_jit.link(profile, m_jit.label()); 1296 emitC all(i, Machine::cti_op_ret_profiler);1300 emitCTICall(i, Machine::cti_op_ret_profiler); 1297 1301 m_jit.link(m_jit.emitUnlinkedJmp(), profiled); 1298 1302 … … 1304 1308 emitPutArg(X86::edx, 0); 1305 1309 emitPutArgConstant(instruction[i + 3].u.operand, 4); 1306 emitC all(i, Machine::cti_op_new_array);1310 emitCTICall(i, Machine::cti_op_new_array); 1307 1311 emitPutResult(instruction[i + 1].u.operand); 1308 1312 i += 4; … … 1312 1316 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1313 1317 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0); 1314 emitC all(i, Machine::cti_op_resolve);1318 emitCTICall(i, Machine::cti_op_resolve); 1315 1319 emitPutResult(instruction[i + 1].u.operand); 1316 1320 i += 3; … … 1363 1367 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 1364 1368 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0); 1365 emitC all(i, Machine::cti_op_resolve_func);1369 emitCTICall(i, Machine::cti_op_resolve_func); 1366 1370 emitPutResult(instruction[i + 1].u.operand); 1367 1371 emitPutResult(instruction[i + 2].u.operand, X86::edx); … … 1428 1432 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 2].u.operand]); 1429 1433 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0); 1430 emitC all(i, Machine::cti_op_resolve_base);1434 emitCTICall(i, Machine::cti_op_resolve_base); 1431 1435 emitPutResult(instruction[i + 1].u.operand); 1432 1436 i += 3; … … 1435 1439 case op_negate: { 1436 1440 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1437 emitC all(i, Machine::cti_op_negate);1441 emitCTICall(i, Machine::cti_op_negate); 1438 1442 emitPutResult(instruction[i + 1].u.operand); 1439 1443 i += 3; … … 1444 1448 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0); 1445 1449 emitPutArgConstant(instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain, 4); 1446 emitC all(i, Machine::cti_op_resolve_skip);1450 emitCTICall(i, Machine::cti_op_resolve_skip); 1447 1451 emitPutResult(instruction[i + 1].u.operand); 1448 1452 i += 4; … … 1475 1479 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); 1476 1480 emitPutArgConstant(reinterpret_cast<unsigned>(instruction + i), 8); 1477 emitC all(i, Machine::cti_op_resolve_global);1481 emitCTICall(i, Machine::cti_op_resolve_global); 1478 1482 emitPutResult(instruction[i + 1].u.operand); 1479 1483 m_jit.link(end, m_jit.label()); … … 1647 1651 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 1648 1652 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0); 1649 emitC all(i, Machine::cti_op_resolve_with_base);1653 emitCTICall(i, Machine::cti_op_resolve_with_base); 1650 1654 emitPutResult(instruction[i + 1].u.operand); 1651 1655 emitPutResult(instruction[i + 2].u.operand, X86::edx); … … 1656 1660 FuncExprNode* func = (m_codeBlock->functionExpressions[instruction[i + 2].u.operand]).get(); 1657 1661 emitPutArgConstant(reinterpret_cast<unsigned>(func), 0); 1658 emitC all(i, Machine::cti_op_new_func_exp);1662 emitCTICall(i, Machine::cti_op_new_func_exp); 1659 1663 emitPutResult(instruction[i + 1].u.operand); 1660 1664 i += 3; … … 1736 1740 RegExp* regExp = m_codeBlock->regexps[instruction[i + 2].u.operand].get(); 1737 1741 emitPutArgConstant(reinterpret_cast<unsigned>(regExp), 0); 1738 emitC all(i, Machine::cti_op_new_regexp);1742 emitCTICall(i, Machine::cti_op_new_regexp); 1739 1743 emitPutResult(instruction[i + 1].u.operand); 1740 1744 i += 3; … … 1757 1761 case op_throw: { 1758 1762 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1759 emitC all(i, Machine::cti_op_throw);1763 emitCTICall(i, Machine::cti_op_throw); 1760 1764 m_jit.addl_i8r(0x24, X86::esp); 1761 1765 m_jit.popl_r(X86::edi); … … 1767 1771 case op_get_pnames: { 1768 1772 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1769 emitC all(i, Machine::cti_op_get_pnames);1773 emitCTICall(i, Machine::cti_op_get_pnames); 1770 1774 emitPutResult(instruction[i + 1].u.operand); 1771 1775 i += 3; … … 1775 1779 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1776 1780 unsigned target = instruction[i + 3].u.operand; 1777 emitC all(i, Machine::cti_op_next_pname);1781 emitCTICall(i, Machine::cti_op_next_pname); 1778 1782 m_jit.testl_rr(X86::eax, X86::eax); 1779 1783 X86Assembler::JmpSrc endOfIter = m_jit.emitUnlinkedJe(); … … 1786 1790 case op_push_scope: { 1787 1791 emitGetPutArg(instruction[i + 1].u.operand, 0, X86::ecx); 1788 emitC all(i, Machine::cti_op_push_scope);1792 emitCTICall(i, Machine::cti_op_push_scope); 1789 1793 i += 2; 1790 1794 break; 1791 1795 } 1792 1796 case op_pop_scope: { 1793 emitC all(i, Machine::cti_op_pop_scope);1797 emitCTICall(i, Machine::cti_op_pop_scope); 1794 1798 i += 1; 1795 1799 break; … … 1834 1838 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1835 1839 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); 1836 emitC all(i, Machine::cti_op_in);1840 emitCTICall(i, Machine::cti_op_in); 1837 1841 emitPutResult(instruction[i + 1].u.operand); 1838 1842 i += 4; … … 1843 1847 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 0); 1844 1848 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); 1845 emitC all(i, Machine::cti_op_push_new_scope);1849 emitCTICall(i, Machine::cti_op_push_new_scope); 1846 1850 emitPutResult(instruction[i + 1].u.operand); 1847 1851 i += 4; … … 1857 1861 unsigned count = instruction[i + 1].u.operand; 1858 1862 emitPutArgConstant(count, 0); 1859 emitC all(i, Machine::cti_op_jmp_scopes);1863 emitCTICall(i, Machine::cti_op_jmp_scopes); 1860 1864 unsigned target = instruction[i + 2].u.operand; 1861 1865 m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJmp(), i + 2 + target)); … … 1867 1871 emitPutArgConstant(instruction[i + 2].u.operand, 4); 1868 1872 emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx); 1869 emitC all(i, Machine::cti_op_put_by_index);1873 emitCTICall(i, Machine::cti_op_put_by_index); 1870 1874 i += 4; 1871 1875 break; … … 1883 1887 emitGetPutArg(scrutinee, 0, X86::ecx); 1884 1888 emitPutArgConstant(tableIndex, 4); 1885 emitC all(i, Machine::cti_op_switch_imm);1889 emitCTICall(i, Machine::cti_op_switch_imm); 1886 1890 m_jit.jmp_r(X86::eax); 1887 1891 i += 4; … … 1900 1904 emitGetPutArg(scrutinee, 0, X86::ecx); 1901 1905 emitPutArgConstant(tableIndex, 4); 1902 emitC all(i, Machine::cti_op_switch_char);1906 emitCTICall(i, Machine::cti_op_switch_char); 1903 1907 m_jit.jmp_r(X86::eax); 1904 1908 i += 4; … … 1916 1920 emitGetPutArg(scrutinee, 0, X86::ecx); 1917 1921 emitPutArgConstant(tableIndex, 4); 1918 emitC all(i, Machine::cti_op_switch_string);1922 emitCTICall(i, Machine::cti_op_switch_string); 1919 1923 m_jit.jmp_r(X86::eax); 1920 1924 i += 4; … … 1924 1928 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); 1925 1929 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); 1926 emitC all(i, Machine::cti_op_del_by_val);1930 emitCTICall(i, Machine::cti_op_del_by_val); 1927 1931 emitPutResult(instruction[i + 1].u.operand); 1928 1932 i += 4; … … 1934 1938 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); 1935 1939 emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx); 1936 emitC all(i, Machine::cti_op_put_getter);1940 emitCTICall(i, Machine::cti_op_put_getter); 1937 1941 i += 4; 1938 1942 break; … … 1943 1947 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); 1944 1948 emitGetPutArg(instruction[i + 3].u.operand, 8, X86::ecx); 1945 emitC all(i, Machine::cti_op_put_setter);1949 emitCTICall(i, Machine::cti_op_put_setter); 1946 1950 i += 4; 1947 1951 break; … … 1952 1956 emitPutArgConstant(reinterpret_cast<unsigned>(message), 4); 1953 1957 emitPutArgConstant(m_codeBlock->lineNumberForVPC(&instruction[i]), 8); 1954 emitC all(i, Machine::cti_op_new_error);1958 emitCTICall(i, Machine::cti_op_new_error); 1955 1959 emitPutResult(instruction[i + 1].u.operand); 1956 1960 i += 4; … … 1961 1965 emitPutArgConstant(instruction[i + 2].u.operand, 4); 1962 1966 emitPutArgConstant(instruction[i + 3].u.operand, 8); 1963 emitC all(i, Machine::cti_op_debug);1967 emitCTICall(i, Machine::cti_op_debug); 1964 1968 i += 4; 1965 1969 break; … … 2044 2048 emitInitRegister(j); 2045 2049 2046 emitC all(i, Machine::cti_op_push_activation);2050 emitCTICall(i, Machine::cti_op_push_activation); 2047 2051 emitPutResult(instruction[i + 1].u.operand); 2048 2052 … … 2051 2055 } 2052 2056 case op_create_arguments: { 2053 emitC all(i, Machine::cti_op_create_arguments);2057 emitCTICall(i, Machine::cti_op_create_arguments); 2054 2058 i += 1; 2055 2059 break; … … 2096 2100 emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx); \ 2097 2101 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); \ 2098 emitC all(i, Machine::cti_##name); \2102 emitCTICall(i, Machine::cti_##name); \ 2099 2103 emitPutResult(instruction[i + 1].u.operand); \ 2100 2104 i += 4; \ … … 2114 2118 m_jit.link((++iter)->from, m_jit.label()); 2115 2119 emitPutArg(X86::eax, 0); 2116 emitC all(i, Machine::cti_op_convert_this);2120 emitCTICall(i, Machine::cti_op_convert_this); 2117 2121 emitPutResult(instruction[i + 1].u.operand); 2118 2122 i += 2; … … 2130 2134 emitGetPutArg(src1, 0, X86::ecx); 2131 2135 emitPutArg(X86::edx, 4); 2132 emitC all(i, Machine::cti_op_add);2136 emitCTICall(i, Machine::cti_op_add); 2133 2137 emitPutResult(dst); 2134 2138 } else if (JSValue* value = getConstantImmediateNumericArg(src2)) { … … 2139 2143 emitPutArg(X86::eax, 0); 2140 2144 emitGetPutArg(src2, 4, X86::ecx); 2141 emitC all(i, Machine::cti_op_add);2145 emitCTICall(i, Machine::cti_op_add); 2142 2146 emitPutResult(dst); 2143 2147 } else { … … 2163 2167 emitPutArg(X86::eax, 0); 2164 2168 emitPutArg(X86::edx, 4); 2165 emitC all(i, Machine::cti_op_get_by_val);2169 emitCTICall(i, Machine::cti_op_get_by_val); 2166 2170 emitPutResult(instruction[i + 1].u.operand); 2167 2171 m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 4]); … … 2193 2197 emitPutArg(X86::eax, 0); 2194 2198 emitPutArg(X86::ecx, 4); 2195 emitC all(i, Machine::cti_op_rshift);2199 emitCTICall(i, Machine::cti_op_rshift); 2196 2200 emitPutResult(instruction[i + 1].u.operand); 2197 2201 i += 4; … … 2208 2212 emitPutArg(X86::eax, 0); 2209 2213 emitPutArg(X86::ecx, 4); 2210 emitC all(i, Machine::cti_op_lshift);2214 emitCTICall(i, Machine::cti_op_lshift); 2211 2215 emitPutResult(instruction[i + 1].u.operand); 2212 2216 i += 4; … … 2222 2226 emitPutArg(X86::edx, 0); 2223 2227 emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx); 2224 emitC all(i, Machine::cti_op_loop_if_less);2228 emitCTICall(i, Machine::cti_op_loop_if_less); 2225 2229 m_jit.testl_rr(X86::eax, X86::eax); 2226 2230 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2230 2234 emitPutArg(X86::eax, 0); 2231 2235 emitPutArg(X86::edx, 4); 2232 emitC all(i, Machine::cti_op_loop_if_less);2236 emitCTICall(i, Machine::cti_op_loop_if_less); 2233 2237 m_jit.testl_rr(X86::eax, X86::eax); 2234 2238 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2245 2249 emitPutArg(X86::eax, 0); 2246 2250 emitPutArg(X86::edx, 8); 2247 X86Assembler::JmpSrc call = emitC all(i, Machine::cti_op_put_by_id);2251 X86Assembler::JmpSrc call = emitCTICall(i, Machine::cti_op_put_by_id); 2248 2252 2249 2253 // Track the location of the call; this will be used to recover repatch information. … … 2271 2275 Identifier* ident = &(m_codeBlock->identifiers[instruction[i + 3].u.operand]); 2272 2276 emitPutArgConstant(reinterpret_cast<unsigned>(ident), 4); 2273 X86Assembler::JmpSrc call = emitC all(i, Machine::cti_op_get_by_id);2277 X86Assembler::JmpSrc call = emitCTICall(i, Machine::cti_op_get_by_id); 2274 2278 ASSERT(X86Assembler::getDifferenceBetweenLabels(coldPathBegin, call) == repatchOffsetGetByIdSlowCaseCall); 2275 2279 emitPutResult(instruction[i + 1].u.operand); … … 2297 2301 emitPutArg(X86::edx, 0); 2298 2302 emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx); 2299 emitC all(i, Machine::cti_op_loop_if_lesseq);2303 emitCTICall(i, Machine::cti_op_loop_if_lesseq); 2300 2304 m_jit.testl_rr(X86::eax, X86::eax); 2301 2305 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2305 2309 emitPutArg(X86::eax, 0); 2306 2310 emitPutArg(X86::edx, 4); 2307 emitC all(i, Machine::cti_op_loop_if_lesseq);2311 emitCTICall(i, Machine::cti_op_loop_if_lesseq); 2308 2312 m_jit.testl_rr(X86::eax, X86::eax); 2309 2313 m_jit.link(m_jit.emitUnlinkedJne(), m_labels[i + 3 + target]); … … 2319 2323 m_jit.link(notImm, m_jit.label()); 2320 2324 emitPutArg(X86::eax, 0); 2321 emitC all(i, Machine::cti_op_pre_inc);2325 emitCTICall(i, Machine::cti_op_pre_inc); 2322 2326 emitPutResult(srcDst); 2323 2327 i += 2; … … 2335 2339 emitPutArg(X86::edx, 4); 2336 2340 emitPutArg(X86::ecx, 8); 2337 emitC all(i, Machine::cti_op_put_by_val);2341 emitCTICall(i, Machine::cti_op_put_by_val); 2338 2342 m_jit.link(m_jit.emitUnlinkedJmp(), m_labels[i + 4]); 2339 2343 … … 2345 2349 emitPutArg(X86::edx, 4); 2346 2350 emitPutArg(X86::ecx, 8); 2347 emitC all(i, Machine::cti_op_put_by_val_array);2351 emitCTICall(i, Machine::cti_op_put_by_val_array); 2348 2352 2349 2353 i += 4; … … 2355 2359 m_jit.link(iter->from, m_jit.label()); 2356 2360 emitPutArg(X86::eax, 0); 2357 emitC all(i, Machine::cti_op_jtrue);2361 emitCTICall(i, Machine::cti_op_jtrue); 2358 2362 m_jit.testl_rr(X86::eax, X86::eax); 2359 2363 unsigned target = instruction[i + 2].u.operand; … … 2369 2373 m_jit.link(notImm, m_jit.label()); 2370 2374 emitPutArg(X86::eax, 0); 2371 emitC all(i, Machine::cti_op_pre_dec);2375 emitCTICall(i, Machine::cti_op_pre_dec); 2372 2376 emitPutResult(srcDst); 2373 2377 i += 2; … … 2381 2385 emitPutArg(X86::edx, 0); 2382 2386 emitGetPutArg(instruction[i + 2].u.operand, 4, X86::ecx); 2383 emitC all(i, Machine::cti_op_jless);2387 emitCTICall(i, Machine::cti_op_jless); 2384 2388 m_jit.testl_rr(X86::eax, X86::eax); 2385 2389 m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]); … … 2389 2393 emitPutArg(X86::eax, 0); 2390 2394 emitPutArg(X86::edx, 4); 2391 emitC all(i, Machine::cti_op_jless);2395 emitCTICall(i, Machine::cti_op_jless); 2392 2396 m_jit.testl_rr(X86::eax, X86::eax); 2393 2397 m_jit.link(m_jit.emitUnlinkedJe(), m_labels[i + 3 + target]); … … 2400 2404 m_jit.xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax); 2401 2405 emitPutArg(X86::eax, 0); 2402 emitC all(i, Machine::cti_op_not);2406 emitCTICall(i, Machine::cti_op_not); 2403 2407 emitPutResult(instruction[i + 1].u.operand); 2404 2408 i += 3; … … 2408 2412 m_jit.link(iter->from, m_jit.label()); 2409 2413 emitPutArg(X86::eax, 0); 2410 emitC all(i, Machine::cti_op_jtrue);2414 emitCTICall(i, Machine::cti_op_jtrue); 2411 2415 m_jit.testl_rr(X86::eax, X86::eax); 2412 2416 unsigned target = instruction[i + 2].u.operand; … … 2420 2424 m_jit.link((++iter)->from, m_jit.label()); 2421 2425 emitPutArg(X86::eax, 0); 2422 emitC all(i, Machine::cti_op_post_inc);2426 emitCTICall(i, Machine::cti_op_post_inc); 2423 2427 emitPutResult(instruction[i + 1].u.operand); 2424 2428 emitPutResult(srcDst, X86::edx); … … 2429 2433 m_jit.link(iter->from, m_jit.label()); 2430 2434 emitPutArg(X86::eax, 0); 2431 emitC all(i, Machine::cti_op_bitnot);2435 emitCTICall(i, Machine::cti_op_bitnot); 2432 2436 emitPutResult(instruction[i + 1].u.operand); 2433 2437 i += 3; … … 2442 2446 emitGetPutArg(src1, 0, X86::ecx); 2443 2447 emitPutArg(X86::eax, 4); 2444 emitC all(i, Machine::cti_op_bitand);2448 emitCTICall(i, Machine::cti_op_bitand); 2445 2449 emitPutResult(dst); 2446 2450 } else if (getConstantImmediateNumericArg(src2)) { … … 2448 2452 emitPutArg(X86::eax, 0); 2449 2453 emitGetPutArg(src2, 4, X86::ecx); 2450 emitC all(i, Machine::cti_op_bitand);2454 emitCTICall(i, Machine::cti_op_bitand); 2451 2455 emitPutResult(dst); 2452 2456 } else { … … 2454 2458 emitGetPutArg(src1, 0, X86::ecx); 2455 2459 emitPutArg(X86::edx, 4); 2456 emitC all(i, Machine::cti_op_bitand);2460 emitCTICall(i, Machine::cti_op_bitand); 2457 2461 emitPutResult(dst); 2458 2462 } … … 2463 2467 m_jit.link(iter->from, m_jit.label()); 2464 2468 emitPutArg(X86::eax, 0); 2465 emitC all(i, Machine::cti_op_jtrue);2469 emitCTICall(i, Machine::cti_op_jtrue); 2466 2470 m_jit.testl_rr(X86::eax, X86::eax); 2467 2471 unsigned target = instruction[i + 2].u.operand; … … 2475 2479 m_jit.link((++iter)->from, m_jit.label()); 2476 2480 emitPutArg(X86::eax, 0); 2477 emitC all(i, Machine::cti_op_post_dec);2481 emitCTICall(i, Machine::cti_op_post_dec); 2478 2482 emitPutResult(instruction[i + 1].u.operand); 2479 2483 emitPutResult(srcDst, X86::edx); … … 2485 2489 emitPutArg(X86::eax, 0); 2486 2490 emitPutArg(X86::edx, 4); 2487 emitC all(i, Machine::cti_op_bitxor);2491 emitCTICall(i, Machine::cti_op_bitxor); 2488 2492 emitPutResult(instruction[i + 1].u.operand); 2489 2493 i += 5; … … 2494 2498 emitPutArg(X86::eax, 0); 2495 2499 emitPutArg(X86::edx, 4); 2496 emitC all(i, Machine::cti_op_bitor);2500 emitCTICall(i, Machine::cti_op_bitor); 2497 2501 emitPutResult(instruction[i + 1].u.operand); 2498 2502 i += 5; … … 2503 2507 emitPutArg(X86::eax, 0); 2504 2508 emitPutArg(X86::edx, 4); 2505 emitC all(i, Machine::cti_op_eq);2509 emitCTICall(i, Machine::cti_op_eq); 2506 2510 emitPutResult(instruction[i + 1].u.operand); 2507 2511 i += 4; … … 2512 2516 emitPutArg(X86::eax, 0); 2513 2517 emitPutArg(X86::edx, 4); 2514 emitC all(i, Machine::cti_op_neq);2518 emitCTICall(i, Machine::cti_op_neq); 2515 2519 emitPutResult(instruction[i + 1].u.operand); 2516 2520 i += 4; … … 2524 2528 emitGetPutArg(instruction[i + 3].u.operand, 4, X86::ecx); 2525 2529 emitGetPutArg(instruction[i + 4].u.operand, 8, X86::ecx); 2526 emitC all(i, Machine::cti_op_instanceof);2530 emitCTICall(i, Machine::cti_op_instanceof); 2527 2531 emitPutResult(instruction[i + 1].u.operand); 2528 2532 i += 5; … … 2539 2543 emitPutArg(X86::eax, 0); 2540 2544 emitPutArg(X86::ecx, 4); 2541 emitC all(i, Machine::cti_op_mod);2545 emitCTICall(i, Machine::cti_op_mod); 2542 2546 emitPutResult(instruction[i + 1].u.operand); 2543 2547 i += 4; … … 2556 2560 emitGetPutArg(src1, 0, X86::ecx); 2557 2561 emitGetPutArg(src2, 4, X86::ecx); 2558 emitC all(i, Machine::cti_op_mul);2562 emitCTICall(i, Machine::cti_op_mul); 2559 2563 emitPutResult(dst); 2560 2564 } else if (src2Value && ((value = JSImmediate::intValue(src2Value)) > 0)) { … … 2563 2567 emitGetPutArg(src1, 0, X86::ecx); 2564 2568 emitGetPutArg(src2, 4, X86::ecx); 2565 emitC all(i, Machine::cti_op_mul);2569 emitCTICall(i, Machine::cti_op_mul); 2566 2570 emitPutResult(dst); 2567 2571 } else … … 2577 2581 2578 2582 // We jump to this slow case if the ctiCode for the codeBlock has not yet been generated; compile it now. 2579 emitC all(i, Machine::cti_vm_compile);2583 emitCTICall(i, Machine::cti_vm_compile); 2580 2584 emitCall(i, X86::eax); 2581 2585 … … 2592 2596 2593 2597 emitPutArg(X86::eax, 0); 2594 emitC all(i, Machine::cti_op_to_jsnumber);2598 emitCTICall(i, Machine::cti_op_to_jsnumber); 2595 2599 2596 2600 emitPutResult(instruction[i + 1].u.operand); … … 2632 2636 if (m_codeBlock->codeType == FunctionCode) { 2633 2637 m_jit.link(slowRegisterFileCheck, m_jit.label()); 2634 emitC all(0, Machine::cti_register_file_check);2638 emitCTICall(0, Machine::cti_register_file_check); 2635 2639 X86Assembler::JmpSrc backToBody = m_jit.emitUnlinkedJmp(); 2636 2640 m_jit.link(backToBody, afterRegisterFileCheck);
Note:
See TracChangeset
for help on using the changeset viewer.