Changeset 39440 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Dec 22, 2008, 1:21:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r39428 r39440 195 195 } 196 196 197 void cti RepatchCallByReturnAddress(void* where, void* what)197 void ctiPatchCallByReturnAddress(void* where, void* what) 198 198 { 199 MacroAssembler::Jump:: repatch(where, what);199 MacroAssembler::Jump::patch(where, what); 200 200 } 201 201 … … 839 839 int retAddrDst = currentInstruction[1].u.operand; 840 840 int target = currentInstruction[2].u.operand; 841 DataLabelPtr storeLocation = storePtrWith Repatch(Address(callFrameRegister, sizeof(Register) * retAddrDst));841 DataLabelPtr storeLocation = storePtrWithPatch(Address(callFrameRegister, sizeof(Register) * retAddrDst)); 842 842 addJump(jump(), target + 2); 843 843 m_jsrSites.append(JSRInfo(storeLocation, label())); … … 1842 1842 JITCodeRef codeRef(code, allocator); 1843 1843 1844 RepatchBuffer repatchBuffer(code);1844 PatchBuffer patchBuffer(code); 1845 1845 1846 1846 // Translate vPC offsets into addresses in JIT generated code, for switch tables. … … 1853 1853 ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size()); 1854 1854 1855 record.jumpTable.simpleJumpTable->ctiDefault = repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]);1855 record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]); 1856 1856 1857 1857 for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) { 1858 1858 unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j]; 1859 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;1859 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault; 1860 1860 } 1861 1861 } else { 1862 1862 ASSERT(record.type == SwitchRecord::String); 1863 1863 1864 record.jumpTable.stringJumpTable->ctiDefault = repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]);1864 record.jumpTable.stringJumpTable->ctiDefault = patchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]); 1865 1865 1866 1866 StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end(); 1867 1867 for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) { 1868 1868 unsigned offset = it->second.branchOffset; 1869 it->second.ctiOffset = offset ? repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault;1869 it->second.ctiOffset = offset ? patchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault; 1870 1870 } 1871 1871 } … … 1874 1874 for (size_t i = 0; i < m_codeBlock->numberOfExceptionHandlers(); ++i) { 1875 1875 HandlerInfo& handler = m_codeBlock->exceptionHandler(i); 1876 handler.nativeCode = repatchBuffer.addressOf(m_labels[handler.target]);1876 handler.nativeCode = patchBuffer.addressOf(m_labels[handler.target]); 1877 1877 } 1878 1878 … … 1880 1880 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 1881 1881 if (iter->to) 1882 repatchBuffer.link(iter->from, iter->to);1883 m_codeBlock->pcVector().append(PC( repatchBuffer.addressOf(iter->from), iter->bytecodeIndex));1882 patchBuffer.link(iter->from, iter->to); 1883 m_codeBlock->pcVector().append(PC(patchBuffer.addressOf(iter->from), iter->bytecodeIndex)); 1884 1884 } 1885 1885 1886 1886 // Link absolute addresses for jsr 1887 1887 for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter) 1888 repatchBuffer.setPtr(iter->storeLocation, repatchBuffer.addressOf(iter->target));1888 patchBuffer.setPtr(iter->storeLocation, patchBuffer.addressOf(iter->target)); 1889 1889 1890 1890 for (unsigned i = 0; i < m_codeBlock->numberOfStructureStubInfos(); ++i) { 1891 1891 StructureStubInfo& info = m_codeBlock->structureStubInfo(i); 1892 1892 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 1893 info.callReturnLocation = repatchBuffer.addressOf(m_propertyAccessCompilationInfo[i].callReturnLocation);1894 info.hotPathBegin = repatchBuffer.addressOf(m_propertyAccessCompilationInfo[i].hotPathBegin);1893 info.callReturnLocation = patchBuffer.addressOf(m_propertyAccessCompilationInfo[i].callReturnLocation); 1894 info.hotPathBegin = patchBuffer.addressOf(m_propertyAccessCompilationInfo[i].hotPathBegin); 1895 1895 #else 1896 1896 info.callReturnLocation = 0; … … 1901 1901 CallLinkInfo& info = m_codeBlock->callLinkInfo(i); 1902 1902 #if ENABLE(JIT_OPTIMIZE_CALL) 1903 info.callReturnLocation = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].callReturnLocation);1904 info.hotPathBegin = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].hotPathBegin);1905 info.hotPathOther = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].hotPathOther);1906 info.coldPathOther = repatchBuffer.addressOf(m_callStructureStubCompilationInfo[i].coldPathOther);1903 info.callReturnLocation = patchBuffer.addressOf(m_callStructureStubCompilationInfo[i].callReturnLocation); 1904 info.hotPathBegin = patchBuffer.addressOf(m_callStructureStubCompilationInfo[i].hotPathBegin); 1905 info.hotPathOther = patchBuffer.addressOf(m_callStructureStubCompilationInfo[i].hotPathOther); 1906 info.coldPathOther = patchBuffer.addressOf(m_callStructureStubCompilationInfo[i].coldPathOther); 1907 1907 #else 1908 1908 info.callReturnLocation = 0; … … 2069 2069 m_interpreter->m_executablePool = m_globalData->poolForSize(m_assembler.size()); 2070 2070 void* code = m_assembler.executableCopy(m_interpreter->m_executablePool.get()); 2071 RepatchBuffer repatchBuffer(code);2071 PatchBuffer patchBuffer(code); 2072 2072 2073 2073 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 2074 repatchBuffer.link(array_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail));2075 repatchBuffer.link(array_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail));2076 repatchBuffer.link(array_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail));2077 repatchBuffer.link(string_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail));2078 repatchBuffer.link(string_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail));2079 repatchBuffer.link(string_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail));2080 2081 m_interpreter->m_ctiArrayLengthTrampoline = repatchBuffer.addressOf(arrayLengthBegin);2082 m_interpreter->m_ctiStringLengthTrampoline = repatchBuffer.addressOf(stringLengthBegin);2074 patchBuffer.link(array_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail)); 2075 patchBuffer.link(array_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail)); 2076 patchBuffer.link(array_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_array_fail)); 2077 patchBuffer.link(string_failureCases1, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail)); 2078 patchBuffer.link(string_failureCases2, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail)); 2079 patchBuffer.link(string_failureCases3, reinterpret_cast<void*>(Interpreter::cti_op_get_by_id_string_fail)); 2080 2081 m_interpreter->m_ctiArrayLengthTrampoline = patchBuffer.addressOf(arrayLengthBegin); 2082 m_interpreter->m_ctiStringLengthTrampoline = patchBuffer.addressOf(stringLengthBegin); 2083 2083 #endif 2084 repatchBuffer.link(callArityCheck1, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));2085 repatchBuffer.link(callArityCheck2, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));2086 repatchBuffer.link(callArityCheck3, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck));2087 repatchBuffer.link(callJSFunction1, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));2088 repatchBuffer.link(callJSFunction2, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));2089 repatchBuffer.link(callJSFunction3, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction));2090 repatchBuffer.link(callDontLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_dontLazyLinkCall));2091 repatchBuffer.link(callLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_lazyLinkCall));2092 2093 m_interpreter->m_ctiVirtualCallPreLink = repatchBuffer.addressOf(virtualCallPreLinkBegin);2094 m_interpreter->m_ctiVirtualCallLink = repatchBuffer.addressOf(virtualCallLinkBegin);2095 m_interpreter->m_ctiVirtualCall = repatchBuffer.addressOf(virtualCallBegin);2084 patchBuffer.link(callArityCheck1, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 2085 patchBuffer.link(callArityCheck2, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 2086 patchBuffer.link(callArityCheck3, reinterpret_cast<void*>(Interpreter::cti_op_call_arityCheck)); 2087 patchBuffer.link(callJSFunction1, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 2088 patchBuffer.link(callJSFunction2, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 2089 patchBuffer.link(callJSFunction3, reinterpret_cast<void*>(Interpreter::cti_op_call_JSFunction)); 2090 patchBuffer.link(callDontLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_dontLazyLinkCall)); 2091 patchBuffer.link(callLazyLinkCall, reinterpret_cast<void*>(Interpreter::cti_vm_lazyLinkCall)); 2092 2093 m_interpreter->m_ctiVirtualCallPreLink = patchBuffer.addressOf(virtualCallPreLinkBegin); 2094 m_interpreter->m_ctiVirtualCallLink = patchBuffer.addressOf(virtualCallLinkBegin); 2095 m_interpreter->m_ctiVirtualCall = patchBuffer.addressOf(virtualCallBegin); 2096 2096 } 2097 2097
Note:
See TracChangeset
for help on using the changeset viewer.