Changeset 40846 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Feb 10, 2009, 8:57:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r40813 r40846 201 201 #endif 202 202 203 void ctiSetReturnAddress(void** where, void* what)203 void ctiSetReturnAddress(void** addressOfReturnAddress, void* newDestinationToReturnTo) 204 204 { 205 * where = what;205 *addressOfReturnAddress = newDestinationToReturnTo; 206 206 } 207 207 208 void ctiPatchCallByReturnAddress( void* where, void* what)208 void ctiPatchCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, void* newCalleeFunction) 209 209 { 210 MacroAssembler::Jump::patch(where, what);210 returnAddress.relinkCallerToFunction(newCalleeFunction); 211 211 } 212 212 … … 1679 1679 ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size()); 1680 1680 1681 record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer. addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]);1681 record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]); 1682 1682 1683 1683 for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) { 1684 1684 unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j]; 1685 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer. addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;1685 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer.locationOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault; 1686 1686 } 1687 1687 } else { 1688 1688 ASSERT(record.type == SwitchRecord::String); 1689 1689 1690 record.jumpTable.stringJumpTable->ctiDefault = patchBuffer. addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]);1690 record.jumpTable.stringJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]); 1691 1691 1692 1692 StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end(); 1693 1693 for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) { 1694 1694 unsigned offset = it->second.branchOffset; 1695 it->second.ctiOffset = offset ? patchBuffer. addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault;1695 it->second.ctiOffset = offset ? patchBuffer.locationOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault; 1696 1696 } 1697 1697 } … … 1700 1700 for (size_t i = 0; i < m_codeBlock->numberOfExceptionHandlers(); ++i) { 1701 1701 HandlerInfo& handler = m_codeBlock->exceptionHandler(i); 1702 handler.nativeCode = patchBuffer. addressOf(m_labels[handler.target]);1702 handler.nativeCode = patchBuffer.locationOf(m_labels[handler.target]); 1703 1703 } 1704 1704 … … 1716 1716 // Link absolute addresses for jsr 1717 1717 for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter) 1718 patchBuffer. setPtr(iter->storeLocation, patchBuffer.addressOf(iter->target));1718 patchBuffer.patch(iter->storeLocation, patchBuffer.locationOf(iter->target).addressForJSR()); 1719 1719 1720 1720 for (unsigned i = 0; i < m_codeBlock->numberOfStructureStubInfos(); ++i) { 1721 1721 StructureStubInfo& info = m_codeBlock->structureStubInfo(i); 1722 1722 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 1723 info.callReturnLocation = patchBuffer. addressOf(m_propertyAccessCompilationInfo[i].callReturnLocation);1724 info.hotPathBegin = patchBuffer. addressOf(m_propertyAccessCompilationInfo[i].hotPathBegin);1723 info.callReturnLocation = patchBuffer.locationOf(m_propertyAccessCompilationInfo[i].callReturnLocation); 1724 info.hotPathBegin = patchBuffer.locationOf(m_propertyAccessCompilationInfo[i].hotPathBegin); 1725 1725 #else 1726 1726 info.callReturnLocation = 0; … … 1731 1731 CallLinkInfo& info = m_codeBlock->callLinkInfo(i); 1732 1732 #if ENABLE(JIT_OPTIMIZE_CALL) 1733 info.callReturnLocation = patchBuffer. addressOf(m_callStructureStubCompilationInfo[i].callReturnLocation);1734 info.hotPathBegin = patchBuffer. addressOf(m_callStructureStubCompilationInfo[i].hotPathBegin);1735 info.hotPathOther = patchBuffer. addressOf(m_callStructureStubCompilationInfo[i].hotPathOther);1736 info.coldPathOther = patchBuffer. addressOf(m_callStructureStubCompilationInfo[i].coldPathOther);1733 info.callReturnLocation = patchBuffer.locationOf(m_callStructureStubCompilationInfo[i].callReturnLocation); 1734 info.hotPathBegin = patchBuffer.locationOf(m_callStructureStubCompilationInfo[i].hotPathBegin); 1735 info.hotPathOther = patchBuffer.locationOf(m_callStructureStubCompilationInfo[i].hotPathOther); 1736 info.coldPathOther = patchBuffer.locationOf(m_callStructureStubCompilationInfo[i].coldPathOther); 1737 1737 #else 1738 1738 info.callReturnLocation = 0; … … 1796 1796 pop(X86::ebx); 1797 1797 restoreArgumentReference(); 1798 JumpcallJSFunction1 = call();1798 Call callJSFunction1 = call(); 1799 1799 emitGetJITStubArg(1, X86::ecx); 1800 1800 emitGetJITStubArg(3, X86::edx); … … 1808 1808 emitPutJITStubArg(X86::eax, 4); 1809 1809 restoreArgumentReference(); 1810 JumpcallArityCheck1 = call();1810 Call callArityCheck1 = call(); 1811 1811 move(X86::edx, callFrameRegister); 1812 1812 emitGetJITStubArg(1, X86::ecx); … … 1820 1820 emitPutJITStubArg(X86::ebx, 2); 1821 1821 restoreArgumentReference(); 1822 JumpcallDontLazyLinkCall = call();1822 Call callDontLazyLinkCall = call(); 1823 1823 push(X86::ebx); 1824 1824 … … 1833 1833 pop(X86::ebx); 1834 1834 restoreArgumentReference(); 1835 JumpcallJSFunction2 = call();1835 Call callJSFunction2 = call(); 1836 1836 emitGetJITStubArg(1, X86::ecx); 1837 1837 emitGetJITStubArg(3, X86::edx); … … 1845 1845 emitPutJITStubArg(X86::eax, 4); 1846 1846 restoreArgumentReference(); 1847 JumpcallArityCheck2 = call();1847 Call callArityCheck2 = call(); 1848 1848 move(X86::edx, callFrameRegister); 1849 1849 emitGetJITStubArg(1, X86::ecx); … … 1857 1857 emitPutJITStubArg(X86::ebx, 2); 1858 1858 restoreArgumentReference(); 1859 JumpcallLazyLinkCall = call();1859 Call callLazyLinkCall = call(); 1860 1860 push(X86::ebx); 1861 1861 … … 1870 1870 pop(X86::ebx); 1871 1871 restoreArgumentReference(); 1872 JumpcallJSFunction3 = call();1872 Call callJSFunction3 = call(); 1873 1873 emitGetJITStubArg(1, X86::ecx); 1874 1874 emitGetJITStubArg(3, X86::edx); … … 1882 1882 emitPutJITStubArg(X86::eax, 4); 1883 1883 restoreArgumentReference(); 1884 JumpcallArityCheck3 = call();1884 Call callArityCheck3 = call(); 1885 1885 move(X86::edx, callFrameRegister); 1886 1886 emitGetJITStubArg(1, X86::ecx); … … 1902 1902 1903 1903 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 1904 patchBuffer.link (array_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail));1905 patchBuffer.link (array_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail));1906 patchBuffer.link (array_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail));1907 patchBuffer.link (string_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail));1908 patchBuffer.link (string_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail));1909 patchBuffer.link (string_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail));1910 1911 m_interpreter->m_ctiArrayLengthTrampoline = patchBuffer. addressOf(arrayLengthBegin);1912 m_interpreter->m_ctiStringLengthTrampoline = patchBuffer. addressOf(stringLengthBegin);1913 #endif 1914 patchBuffer.link(callArityCheck1, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));1915 patchBuffer.link(callArityCheck2, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));1916 patchBuffer.link(callArityCheck3, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));1917 patchBuffer.link(callJSFunction1, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));1918 patchBuffer.link(callJSFunction2, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));1919 patchBuffer.link(callJSFunction3, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));1920 patchBuffer.link(callDontLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_dontLazyLinkCall));1921 patchBuffer.link(callLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_lazyLinkCall));1922 1923 m_interpreter->m_ctiVirtualCallPreLink = patchBuffer. addressOf(virtualCallPreLinkBegin);1924 m_interpreter->m_ctiVirtualCallLink = patchBuffer. addressOf(virtualCallLinkBegin);1925 m_interpreter->m_ctiVirtualCall = patchBuffer. addressOf(virtualCallBegin);1904 patchBuffer.linkTailRecursive(array_failureCases1, Interpreter::cti_op_get_by_id_array_fail); 1905 patchBuffer.linkTailRecursive(array_failureCases2, Interpreter::cti_op_get_by_id_array_fail); 1906 patchBuffer.linkTailRecursive(array_failureCases3, Interpreter::cti_op_get_by_id_array_fail); 1907 patchBuffer.linkTailRecursive(string_failureCases1, Interpreter::cti_op_get_by_id_string_fail); 1908 patchBuffer.linkTailRecursive(string_failureCases2, Interpreter::cti_op_get_by_id_string_fail); 1909 patchBuffer.linkTailRecursive(string_failureCases3, Interpreter::cti_op_get_by_id_string_fail); 1910 1911 m_interpreter->m_ctiArrayLengthTrampoline = patchBuffer.trampolineAt(arrayLengthBegin); 1912 m_interpreter->m_ctiStringLengthTrampoline = patchBuffer.trampolineAt(stringLengthBegin); 1913 #endif 1914 patchBuffer.link(callArityCheck1, Interpreter::cti_op_call_arityCheck); 1915 patchBuffer.link(callArityCheck2, Interpreter::cti_op_call_arityCheck); 1916 patchBuffer.link(callArityCheck3, Interpreter::cti_op_call_arityCheck); 1917 patchBuffer.link(callJSFunction1, Interpreter::cti_op_call_JSFunction); 1918 patchBuffer.link(callJSFunction2, Interpreter::cti_op_call_JSFunction); 1919 patchBuffer.link(callJSFunction3, Interpreter::cti_op_call_JSFunction); 1920 patchBuffer.link(callDontLazyLinkCall, Interpreter::cti_vm_dontLazyLinkCall); 1921 patchBuffer.link(callLazyLinkCall, Interpreter::cti_vm_lazyLinkCall); 1922 1923 m_interpreter->m_ctiVirtualCallPreLink = patchBuffer.trampolineAt(virtualCallPreLinkBegin); 1924 m_interpreter->m_ctiVirtualCallLink = patchBuffer.trampolineAt(virtualCallLinkBegin); 1925 m_interpreter->m_ctiVirtualCall = patchBuffer.trampolineAt(virtualCallBegin); 1926 1926 } 1927 1927
Note:
See TracChangeset
for help on using the changeset viewer.