Changeset 39284 in webkit for trunk/JavaScriptCore/jit
- Timestamp:
- Dec 13, 2008, 3:58:58 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/jit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r39268 r39284 41 41 #endif 42 42 43 #define __ m_assembler. 44 43 45 using namespace std; 44 46 … … 237 239 #endif 238 240 239 m_labels[m_bytecodeIndex] = __label();241 m_labels[m_bytecodeIndex] = label(); 240 242 OpcodeID opcodeID = m_interpreter->getOpcodeID(currentInstruction->u.opcode); 241 243 … … 278 280 emitCTICall(Interpreter::cti_op_end); 279 281 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 280 __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi);282 __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), callFrameRegister); 281 283 __ ret(); 282 284 NEXT_OPCODE(op_end); … … 514 516 515 517 // Restore our caller's "r". 516 emitGetFromCallFrameHeader(RegisterFile::CallerFrame, X86::edi);518 emitGetFromCallFrameHeader(RegisterFile::CallerFrame, callFrameRegister); 517 519 518 520 // Return. … … 768 770 int retAddrDst = currentInstruction[1].u.operand; 769 771 int target = currentInstruction[2].u.operand; 770 __ movl_i32m(0, sizeof(Register) * retAddrDst, X86::edi); 771 JmpDst addrPosition = __ label(); 772 addJump(__ jmp(), target + 2); 773 JmpDst sretTarget = __ label(); 774 m_jsrSites.append(JSRInfo(addrPosition, sretTarget)); 772 DataLabelPtr storeLocation = storePtrWithRepatch(Address(callFrameRegister, sizeof(Register) * retAddrDst)); 773 addJump(jump(), target + 2); 774 m_jsrSites.append(JSRInfo(storeLocation, label())); 775 775 NEXT_OPCODE(op_jsr); 776 776 } 777 777 case op_sret: { 778 __ jmp_m(sizeof(Register) * currentInstruction[1].u.operand, X86::edi);778 jump(Address(callFrameRegister, sizeof(Register) * currentInstruction[1].u.operand)); 779 779 NEXT_OPCODE(op_sret); 780 780 } … … 793 793 emitFastArithImmToInt(X86::eax); 794 794 emitFastArithImmToInt(X86::ecx); 795 __ shll_CLr(X86::eax);795 lshift32(X86::ecx, X86::eax); 796 796 emitFastArithIntToImmOrSlowCase(X86::eax); 797 797 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 833 833 emitJumpSlowCaseIfNotImmNum(X86::ecx); 834 834 emitFastArithImmToInt(X86::ecx); 835 __ sarl_CLr(X86::eax);835 rshift32(X86::ecx, X86::eax); 836 836 } 837 837 emitFastArithPotentiallyReTagImmediate(X86::eax); … … 867 867 emitFastArithDeTagImmediate(X86::eax); 868 868 addSlowCase(emitFastArithDeTagImmediateJumpIfZero(X86::ecx)); 869 __ cdq(); 870 __ idivl_r(X86::ecx); 869 mod32(X86::ecx, X86::eax, X86::edx); 871 870 emitFastArithReTagImmediate(X86::edx); 872 871 move(X86::edx, X86::eax); … … 1006 1005 } 1007 1006 case op_catch: { 1008 emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r1007 emitGetCTIParam(CTI_ARGS_callFrame, callFrameRegister); 1009 1008 emitPutVirtualRegister(currentInstruction[1].u.operand); 1010 1009 NEXT_OPCODE(op_catch); … … 1200 1199 case op_profile_will_call: { 1201 1200 emitGetCTIParam(CTI_ARGS_profilerReference, X86::eax); 1202 __ cmpl_i32m(0, X86::eax); 1203 JmpSrc noProfiler = __ je(); 1201 Jump noProfiler = jzPtr(Address(X86::eax)); 1204 1202 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax); 1205 1203 emitCTICall(Interpreter::cti_op_profile_will_call); 1206 __ link(noProfiler, __ label());1204 noProfiler.link(this); 1207 1205 1208 1206 NEXT_OPCODE(op_profile_will_call); … … 1210 1208 case op_profile_did_call: { 1211 1209 emitGetCTIParam(CTI_ARGS_profilerReference, X86::eax); 1212 __ cmpl_i32m(0, X86::eax); 1213 JmpSrc noProfiler = __ je(); 1210 Jump noProfiler = jzPtr(Address(X86::eax)); 1214 1211 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax); 1215 1212 emitCTICall(Interpreter::cti_op_profile_did_call); 1216 __ link(noProfiler, __ label());1213 noProfiler.link(this); 1217 1214 1218 1215 NEXT_OPCODE(op_profile_did_call); … … 1247 1244 unsigned jmpTableCount = m_jmpTable.size(); 1248 1245 for (unsigned i = 0; i < jmpTableCount; ++i) 1249 __ link(m_jmpTable[i].from, m_labels[m_jmpTable[i].to]);1246 m_jmpTable[i].from.linkTo(m_labels[m_jmpTable[i].toBytecodeIndex], this); 1250 1247 m_jmpTable.clear(); 1251 1248 } … … 1738 1735 1739 1736 emitGetCTIParam(CTI_ARGS_registerFile, X86::eax); 1740 __ leal_mr(m_codeBlock->m_numCalleeRegisters * sizeof(Register), X86::edi, X86::edx); 1737 addPtr(Imm32(m_codeBlock->m_numCalleeRegisters * sizeof(Register)), callFrameRegister, X86::edx); 1738 1741 1739 slowRegisterFileCheck = jg32(X86::edx, Address(X86::eax, FIELD_OFFSET(RegisterFile, m_end))); 1742 afterRegisterFileCheck = MacroAssembler::Label(this);1740 afterRegisterFileCheck = label(); 1743 1741 } 1744 1742 … … 1760 1758 ASSERT(m_jmpTable.isEmpty()); 1761 1759 1762 RefPtr<ExecutablePool> allocator = m_globalData->poolForSize(__ size()); 1763 m_codeBlock->setExecutablePool(allocator.get()); 1764 void* code = __ executableCopy(allocator.get()); 1760 RefPtr<ExecutablePool> allocator = m_globalData->poolForSize(m_assembler.size()); 1761 void* code = m_assembler.executableCopy(allocator.get()); 1762 JITCodeRef codeRef(code, allocator); 1763 1764 RepatchBuffer repatchBuffer(code); 1765 1765 1766 1766 // Translate vPC offsets into addresses in JIT generated code, for switch tables. … … 1773 1773 ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size()); 1774 1774 1775 record.jumpTable.simpleJumpTable->ctiDefault = __ getRelocatedAddress(code,m_labels[bytecodeIndex + 3 + record.defaultOffset]);1775 record.jumpTable.simpleJumpTable->ctiDefault = repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]); 1776 1776 1777 1777 for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) { 1778 1778 unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j]; 1779 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? __ getRelocatedAddress(code,m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;1779 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault; 1780 1780 } 1781 1781 } else { 1782 1782 ASSERT(record.type == SwitchRecord::String); 1783 1783 1784 record.jumpTable.stringJumpTable->ctiDefault = __ getRelocatedAddress(code,m_labels[bytecodeIndex + 3 + record.defaultOffset]);1784 record.jumpTable.stringJumpTable->ctiDefault = repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]); 1785 1785 1786 1786 StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end(); 1787 1787 for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) { 1788 1788 unsigned offset = it->second.branchOffset; 1789 it->second.ctiOffset = offset ? __ getRelocatedAddress(code,m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault;1789 it->second.ctiOffset = offset ? repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault; 1790 1790 } 1791 1791 } … … 1794 1794 for (size_t i = 0; i < m_codeBlock->numberOfExceptionHandlers(); ++i) { 1795 1795 HandlerInfo& handler = m_codeBlock->exceptionHandler(i); 1796 handler.nativeCode = __ getRelocatedAddress(code,m_labels[handler.target]);1796 handler.nativeCode = repatchBuffer.addressOf(m_labels[handler.target]); 1797 1797 } 1798 1798 … … 1800 1800 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 1801 1801 if (iter->to) 1802 X86Assembler::link(code,iter->from, iter->to);1803 m_codeBlock->pcVector().append(PC( __ getRelocatedAddress(code,iter->from), iter->bytecodeIndex));1802 repatchBuffer.link(iter->from, iter->to); 1803 m_codeBlock->pcVector().append(PC(repatchBuffer.addressOf(iter->from), iter->bytecodeIndex)); 1804 1804 } 1805 1805 1806 1806 // Link absolute addresses for jsr 1807 1807 for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter) 1808 X86Assembler::linkAbsoluteAddress(code, iter->addrPosition, iter->target);1808 repatchBuffer.setPtr(iter->storeLocation, repatchBuffer.addressOf(iter->target)); 1809 1809 1810 1810 for (unsigned i = 0; i < m_codeBlock->numberOfStructureStubInfos(); ++i) { … … 1821 1821 } 1822 1822 1823 m_codeBlock->setJITCode(code );1823 m_codeBlock->setJITCode(codeRef); 1824 1824 } 1825 1825 … … 1829 1829 1830 1830 // Check eax is an array 1831 JmpSrc array_failureCases1 = emitJumpIfNotJSCell(X86::eax);1831 X86Assembler::JmpSrc array_failureCases1 = emitJumpIfNotJSCell(X86::eax); 1832 1832 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax); 1833 JmpSrc array_failureCases2 = __ jne();1833 X86Assembler::JmpSrc array_failureCases2 = __ jne(); 1834 1834 1835 1835 // Checks out okay! - get the length from the storage … … 1838 1838 1839 1839 __ cmpl_i32r(JSImmediate::maxImmediateInt, X86::eax); 1840 JmpSrc array_failureCases3 = __ ja();1840 X86Assembler::JmpSrc array_failureCases3 = __ ja(); 1841 1841 1842 1842 __ addl_rr(X86::eax, X86::eax); … … 1847 1847 // (2) The second function provides fast property access for string length 1848 1848 1849 JmpDst stringLengthBegin = __ align(16);1849 X86Assembler::JmpDst stringLengthBegin = __ align(16); 1850 1850 1851 1851 // Check eax is a string 1852 JmpSrc string_failureCases1 = emitJumpIfNotJSCell(X86::eax);1852 X86Assembler::JmpSrc string_failureCases1 = emitJumpIfNotJSCell(X86::eax); 1853 1853 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsStringVptr), X86::eax); 1854 JmpSrc string_failureCases2 = __ jne();1854 X86Assembler::JmpSrc string_failureCases2 = __ jne(); 1855 1855 1856 1856 // Checks out okay! - get the length from the Ustring. … … 1859 1859 1860 1860 __ cmpl_i32r(JSImmediate::maxImmediateInt, X86::eax); 1861 JmpSrc string_failureCases3 = __ ja();1861 X86Assembler::JmpSrc string_failureCases3 = __ ja(); 1862 1862 1863 1863 __ addl_rr(X86::eax, X86::eax); … … 1868 1868 // (3) Trampolines for the slow cases of op_call / op_call_eval / op_construct. 1869 1869 1870 JmpDst virtualCallPreLinkBegin = __ align(16);1870 X86Assembler::JmpDst virtualCallPreLinkBegin = __ align(16); 1871 1871 1872 1872 // Load the callee CodeBlock* into eax … … 1874 1874 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 1875 1875 __ testl_rr(X86::eax, X86::eax); 1876 JmpSrc hasCodeBlock1 = __ jne();1876 X86Assembler::JmpSrc hasCodeBlock1 = __ jne(); 1877 1877 __ popl_r(X86::ebx); 1878 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1879 JmpSrc callJSFunction1 = __ call();1878 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1879 X86Assembler::JmpSrc callJSFunction1 = __ call(); 1880 1880 emitGetJITStubArg(1, X86::ecx); 1881 1881 emitGetJITStubArg(3, X86::edx); … … 1885 1885 // Check argCount matches callee arity. 1886 1886 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax); 1887 JmpSrc arityCheckOkay1 = __ je();1887 X86Assembler::JmpSrc arityCheckOkay1 = __ je(); 1888 1888 __ popl_r(X86::ebx); 1889 1889 emitPutJITStubArg(X86::ebx, 2); 1890 1890 emitPutJITStubArg(X86::eax, 4); 1891 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1892 JmpSrc callArityCheck1 = __ call();1893 __ movl_rr(X86::edx, X86::edi);1891 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1892 X86Assembler::JmpSrc callArityCheck1 = __ call(); 1893 __ movl_rr(X86::edx, callFrameRegister); 1894 1894 emitGetJITStubArg(1, X86::ecx); 1895 1895 emitGetJITStubArg(3, X86::edx); … … 1901 1901 __ popl_r(X86::ebx); 1902 1902 emitPutJITStubArg(X86::ebx, 2); 1903 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1904 JmpSrc callDontLazyLinkCall = __ call();1903 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1904 X86Assembler::JmpSrc callDontLazyLinkCall = __ call(); 1905 1905 __ pushl_r(X86::ebx); 1906 1906 1907 1907 __ jmp_r(X86::eax); 1908 1908 1909 JmpDst virtualCallLinkBegin = __ align(16);1909 X86Assembler::JmpDst virtualCallLinkBegin = __ align(16); 1910 1910 1911 1911 // Load the callee CodeBlock* into eax … … 1913 1913 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 1914 1914 __ testl_rr(X86::eax, X86::eax); 1915 JmpSrc hasCodeBlock2 = __ jne();1915 X86Assembler::JmpSrc hasCodeBlock2 = __ jne(); 1916 1916 __ popl_r(X86::ebx); 1917 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1918 JmpSrc callJSFunction2 = __ call();1917 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1918 X86Assembler::JmpSrc callJSFunction2 = __ call(); 1919 1919 emitGetJITStubArg(1, X86::ecx); 1920 1920 emitGetJITStubArg(3, X86::edx); … … 1924 1924 // Check argCount matches callee arity. 1925 1925 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax); 1926 JmpSrc arityCheckOkay2 = __ je();1926 X86Assembler::JmpSrc arityCheckOkay2 = __ je(); 1927 1927 __ popl_r(X86::ebx); 1928 1928 emitPutJITStubArg(X86::ebx, 2); 1929 1929 emitPutJITStubArg(X86::eax, 4); 1930 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1931 JmpSrc callArityCheck2 = __ call();1932 __ movl_rr(X86::edx, X86::edi);1930 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1931 X86Assembler::JmpSrc callArityCheck2 = __ call(); 1932 __ movl_rr(X86::edx, callFrameRegister); 1933 1933 emitGetJITStubArg(1, X86::ecx); 1934 1934 emitGetJITStubArg(3, X86::edx); … … 1940 1940 __ popl_r(X86::ebx); 1941 1941 emitPutJITStubArg(X86::ebx, 2); 1942 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1943 JmpSrc callLazyLinkCall = __ call();1942 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1943 X86Assembler::JmpSrc callLazyLinkCall = __ call(); 1944 1944 __ pushl_r(X86::ebx); 1945 1945 1946 1946 __ jmp_r(X86::eax); 1947 1947 1948 JmpDst virtualCallBegin = __ align(16);1948 X86Assembler::JmpDst virtualCallBegin = __ align(16); 1949 1949 1950 1950 // Load the callee CodeBlock* into eax … … 1952 1952 __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax); 1953 1953 __ testl_rr(X86::eax, X86::eax); 1954 JmpSrc hasCodeBlock3 = __ jne();1954 X86Assembler::JmpSrc hasCodeBlock3 = __ jne(); 1955 1955 __ popl_r(X86::ebx); 1956 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1957 JmpSrc callJSFunction3 = __ call();1956 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1957 X86Assembler::JmpSrc callJSFunction3 = __ call(); 1958 1958 emitGetJITStubArg(1, X86::ecx); 1959 1959 emitGetJITStubArg(3, X86::edx); … … 1963 1963 // Check argCount matches callee arity. 1964 1964 __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax); 1965 JmpSrc arityCheckOkay3 = __ je();1965 X86Assembler::JmpSrc arityCheckOkay3 = __ je(); 1966 1966 __ popl_r(X86::ebx); 1967 1967 emitPutJITStubArg(X86::ebx, 2); 1968 1968 emitPutJITStubArg(X86::eax, 4); 1969 emitPutCTIParam( X86::edi, CTI_ARGS_callFrame);1970 JmpSrc callArityCheck3 = __ call();1971 __ movl_rr(X86::edx, X86::edi);1969 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 1970 X86Assembler::JmpSrc callArityCheck3 = __ call(); 1971 __ movl_rr(X86::edx, callFrameRegister); 1972 1972 emitGetJITStubArg(1, X86::ecx); 1973 1973 emitGetJITStubArg(3, X86::edx); -
trunk/JavaScriptCore/jit/JIT.h
r39268 r39284 108 108 109 109 struct CallRecord { 110 X86Assembler::JmpSrcfrom;110 MacroAssembler::Jump from; 111 111 unsigned bytecodeIndex; 112 112 void* to; … … 116 116 } 117 117 118 CallRecord( X86Assembler::JmpSrcfrom, unsigned bytecodeIndex, void* to = 0)118 CallRecord(MacroAssembler::Jump from, unsigned bytecodeIndex, void* to = 0) 119 119 : from(from) 120 120 , bytecodeIndex(bytecodeIndex) … … 124 124 }; 125 125 126 struct J mpTable {127 X86Assembler::JmpSrcfrom;128 unsigned to ;129 130 J mpTable(X86Assembler::JmpSrcf, unsigned t)126 struct JumpTable { 127 MacroAssembler::Jump from; 128 unsigned toBytecodeIndex; 129 130 JumpTable(MacroAssembler::Jump f, unsigned t) 131 131 : from(f) 132 , to (t)132 , toBytecodeIndex(t) 133 133 { 134 134 } … … 183 183 184 184 struct StructureStubCompilationInfo { 185 typedef X86Assembler::JmpSrc JmpSrc; 186 typedef X86Assembler::JmpDst JmpDst; 187 188 JmpSrc callReturnLocation; 189 JmpDst hotPathBegin; 190 JmpSrc hotPathOther; 191 JmpDst coldPathOther; 185 X86Assembler::JmpSrc callReturnLocation; 186 X86Assembler::JmpDst hotPathBegin; 187 X86Assembler::JmpSrc hotPathOther; 188 X86Assembler::JmpDst coldPathOther; 192 189 }; 193 190 … … 204 201 using MacroAssembler::JumpList; 205 202 using MacroAssembler::Label; 206 207 typedef X86Assembler::RegisterID RegisterID;208 typedef X86Assembler::XMMRegisterID XMMRegisterID;209 typedef X86Assembler::JmpSrc JmpSrc;210 typedef X86Assembler::JmpDst JmpDst;211 203 212 204 static const RegisterID callFrameRegister = X86::edi; … … 330 322 void privateCompilePatchGetArrayLength(void* returnAddress); 331 323 332 void addSlowCase(J mpSrc);333 void addJump(J mpSrc, int);334 void emitJumpSlowToHot(J mpSrc, int);324 void addSlowCase(Jump); 325 void addJump(Jump, int); 326 void emitJumpSlowToHot(Jump, int); 335 327 336 328 void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned propertyAccessInstructionIndex); … … 346 338 enum CompileOpStrictEqType { OpStrictEq, OpNStrictEq }; 347 339 void compileOpStrictEq(Instruction* instruction, CompileOpStrictEqType type); 348 void putDoubleResultToJSNumberCellOrJSImmediate(X MMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, JmpSrc* wroteJSNumberCell,XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2);340 void putDoubleResultToJSNumberCellOrJSImmediate(X86Assembler::XMMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, X86Assembler::JmpSrc* wroteJSNumberCell, X86Assembler::XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2); 349 341 void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi); 350 342 void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi); … … 393 385 void emitJumpSlowCaseIfNotImmNums(RegisterID, RegisterID, RegisterID); 394 386 395 J mpSrccheckStructure(RegisterID reg, Structure* structure);387 Jump checkStructure(RegisterID reg, Structure* structure); 396 388 397 389 void emitFastArithDeTagImmediate(RegisterID); 398 J mpSrcemitFastArithDeTagImmediateJumpIfZero(RegisterID);390 Jump emitFastArithDeTagImmediateJumpIfZero(RegisterID); 399 391 void emitFastArithReTagImmediate(RegisterID); 400 392 void emitFastArithPotentiallyReTagImmediate(RegisterID); … … 405 397 void emitTagAsBoolImmediate(RegisterID reg); 406 398 407 J mpSrcemitNakedCall(RegisterID);408 J mpSrcemitNakedCall(void* function);409 J mpSrcemitCTICall_internal(void*);410 J mpSrcemitCTICall(CTIHelper_j helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }411 J mpSrcemitCTICall(CTIHelper_o helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }412 J mpSrcemitCTICall(CTIHelper_p helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }413 J mpSrcemitCTICall(CTIHelper_v helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }414 J mpSrcemitCTICall(CTIHelper_s helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }415 J mpSrcemitCTICall(CTIHelper_b helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }416 J mpSrcemitCTICall(CTIHelper_2 helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }399 Jump emitNakedCall(RegisterID); 400 Jump emitNakedCall(void* function); 401 Jump emitCTICall_internal(void*); 402 Jump emitCTICall(CTIHelper_j helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 403 Jump emitCTICall(CTIHelper_o helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 404 Jump emitCTICall(CTIHelper_p helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 405 Jump emitCTICall(CTIHelper_v helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 406 Jump emitCTICall(CTIHelper_s helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 407 Jump emitCTICall(CTIHelper_b helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 408 Jump emitCTICall(CTIHelper_2 helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); } 417 409 418 410 void emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst); … … 431 423 432 424 Vector<CallRecord> m_calls; 433 Vector< JmpDst> m_labels;425 Vector<Label> m_labels; 434 426 Vector<StructureStubCompilationInfo> m_propertyAccessCompilationInfo; 435 427 Vector<StructureStubCompilationInfo> m_callStructureStubCompilationInfo; 436 Vector<J mpTable> m_jmpTable;428 Vector<JumpTable> m_jmpTable; 437 429 438 430 struct JSRInfo { 439 JmpDst addrPosition;440 JmpDsttarget;441 442 JSRInfo( const JmpDst& storeLocation, const JmpDst&targetLocation)443 : addrPosition(storeLocation)431 DataLabelPtr storeLocation; 432 Label target; 433 434 JSRInfo(DataLabelPtr storeLocation, Label targetLocation) 435 : storeLocation(storeLocation) 444 436 , target(targetLocation) 445 437 { -
trunk/JavaScriptCore/jit/JITArithmetic.cpp
r39268 r39284 41 41 #endif 42 42 43 #define __ m_assembler. 44 43 45 using namespace std; 44 46 … … 68 70 69 71 #else 72 73 typedef X86Assembler::JmpSrc JmpSrc; 74 typedef X86Assembler::JmpDst JmpDst; 75 typedef X86Assembler::XMMRegisterID XMMRegisterID; 70 76 71 77 #if PLATFORM(MAC) -
trunk/JavaScriptCore/jit/JITCall.cpp
r39268 r39284 41 41 #endif 42 42 43 #define __ m_assembler. 44 43 45 using namespace std; 44 46 … … 192 194 193 195 #else 196 197 typedef X86Assembler::JmpSrc JmpSrc; 198 typedef X86Assembler::JmpDst JmpDst; 194 199 195 200 static void unreachable() -
trunk/JavaScriptCore/jit/JITInlineMethods.h
r39268 r39284 31 31 #if ENABLE(JIT) 32 32 33 #define __ m_assembler.34 35 33 #if PLATFORM(WIN) 36 34 #undef FIELD_OFFSET // Fix conflict with winnt.h. … … 43 41 44 42 namespace JSC { 45 46 typedef X86Assembler::JmpSrc JmpSrc;47 43 48 44 static ALWAYS_INLINE uintptr_t asInteger(JSValue* value) … … 190 186 } 191 187 192 ALWAYS_INLINE J mpSrcJIT::emitNakedCall(X86::RegisterID r)193 { 194 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 195 196 J mpSrcnakedCall = call(r);188 ALWAYS_INLINE JIT::Jump JIT::emitNakedCall(X86::RegisterID r) 189 { 190 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 191 192 Jump nakedCall = call(r); 197 193 m_calls.append(CallRecord(nakedCall, m_bytecodeIndex)); 198 194 return nakedCall; 199 195 } 200 196 201 ALWAYS_INLINE J mpSrcJIT::emitNakedCall(void* function)202 { 203 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 204 205 J mpSrcnakedCall = call();197 ALWAYS_INLINE JIT::Jump JIT::emitNakedCall(void* function) 198 { 199 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 200 201 Jump nakedCall = call(); 206 202 m_calls.append(CallRecord(nakedCall, m_bytecodeIndex, function)); 207 203 return nakedCall; 208 204 } 209 205 210 ALWAYS_INLINE J mpSrcJIT::emitCTICall_internal(void* helper)206 ALWAYS_INLINE JIT::Jump JIT::emitCTICall_internal(void* helper) 211 207 { 212 208 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. … … 216 212 #endif 217 213 emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame); 218 J mpSrcctiCall = call();214 Jump ctiCall = call(); 219 215 m_calls.append(CallRecord(ctiCall, m_bytecodeIndex, helper)); 220 216 #if ENABLE(OPCODE_SAMPLING) … … 226 222 } 227 223 228 ALWAYS_INLINE J mpSrcJIT::checkStructure(RegisterID reg, Structure* structure)224 ALWAYS_INLINE JIT::Jump JIT::checkStructure(RegisterID reg, Structure* structure) 229 225 { 230 226 return jnePtr(Address(reg, FIELD_OFFSET(JSCell, m_structure)), ImmPtr(structure)); … … 286 282 } 287 283 288 ALWAYS_INLINE J mpSrcJIT::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg)284 ALWAYS_INLINE JIT::Jump JIT::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg) 289 285 { 290 286 return jzSub32(Imm32(JSImmediate::TagBitTypeInteger), reg); … … 324 320 } 325 321 326 ALWAYS_INLINE void JIT::addSlowCase(J mpSrcjump)322 ALWAYS_INLINE void JIT::addSlowCase(Jump jump) 327 323 { 328 324 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. … … 331 327 } 332 328 333 ALWAYS_INLINE void JIT::addJump(J mpSrcjump, int relativeOffset)334 { 335 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 336 337 m_jmpTable.append(J mpTable(jump, m_bytecodeIndex + relativeOffset));338 } 339 340 ALWAYS_INLINE void JIT::emitJumpSlowToHot(J mpSrcjump, int relativeOffset)341 { 342 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 343 344 __ link(jump, m_labels[m_bytecodeIndex + relativeOffset]);329 ALWAYS_INLINE void JIT::addJump(Jump jump, int relativeOffset) 330 { 331 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 332 333 m_jmpTable.append(JumpTable(jump, m_bytecodeIndex + relativeOffset)); 334 } 335 336 ALWAYS_INLINE void JIT::emitJumpSlowToHot(Jump jump, int relativeOffset) 337 { 338 ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set. 339 340 jump.linkTo(m_labels[m_bytecodeIndex + relativeOffset], this); 345 341 } 346 342 -
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r39268 r39284 41 41 #endif 42 42 43 #define __ m_assembler. 44 43 45 using namespace std; 44 46 45 47 namespace JSC { 48 49 typedef X86Assembler::JmpSrc JmpSrc; 50 typedef X86Assembler::JmpDst JmpDst; 46 51 47 52 #if !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) … … 513 518 514 519 // Check eax is an object of the right Structure. 515 bucketsOfFail.append(checkStructure(X86::eax, structure)); 520 JmpSrc baseObjectCheck = checkStructure(X86::eax, structure); 521 bucketsOfFail.append(baseObjectCheck); 516 522 517 523 Structure* currStructure = structure; … … 568 574 569 575 // Check eax is an object of the right Structure. 570 bucketsOfFail.append(checkStructure(X86::eax, structure)); 576 JmpSrc baseObjectCheck = checkStructure(X86::eax, structure); 577 bucketsOfFail.append(baseObjectCheck); 571 578 572 579 Structure* currStructure = structure;
Note:
See TracChangeset
for help on using the changeset viewer.