Changeset 39440 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Dec 22, 2008, 1:21:18 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-22 Sam Weinig <[email protected]>

Reviewed by Gavin Barraclough.

Rename all uses of the term "repatch" to "patch".

  • assembler/MacroAssembler.h: (JSC::MacroAssembler::DataLabelPtr::patch): (JSC::MacroAssembler::DataLabel32::patch): (JSC::MacroAssembler::Jump::patch): (JSC::MacroAssembler::PatchBuffer::PatchBuffer): (JSC::MacroAssembler::PatchBuffer::setPtr): (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch): (JSC::MacroAssembler::storePtrWithAddressOffsetPatch): (JSC::MacroAssembler::storePtrWithPatch): (JSC::MacroAssembler::jnePtrWithPatch):
  • assembler/X86Assembler.h: (JSC::X86Assembler::patchAddress): (JSC::X86Assembler::patchImmediate): (JSC::X86Assembler::patchPointer): (JSC::X86Assembler::patchBranchOffset):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::tryCTICachePutByID): (JSC::Interpreter::tryCTICacheGetByID): (JSC::Interpreter::cti_op_put_by_id): (JSC::Interpreter::cti_op_get_by_id): (JSC::Interpreter::cti_op_get_by_id_self_fail): (JSC::Interpreter::cti_op_get_by_id_proto_list): (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  • jit/JIT.cpp: (JSC::ctiPatchCallByReturnAddress): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompile): (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JIT.h:
  • jit/JITCall.cpp: (JSC::JIT::unlinkCall): (JSC::JIT::linkCall): (JSC::JIT::compileOpCall):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdSlowCase): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::patchGetByIdSelf): (JSC::JIT::patchPutByIdReplace): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdSelf): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): (JSC::JIT::privateCompilePutByIdReplace):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r39428 r39440  
    195195}
    196196
    197 void ctiRepatchCallByReturnAddress(void* where, void* what)
     197void ctiPatchCallByReturnAddress(void* where, void* what)
    198198{
    199     MacroAssembler::Jump::repatch(where, what);
     199    MacroAssembler::Jump::patch(where, what);
    200200}
    201201
     
    839839            int retAddrDst = currentInstruction[1].u.operand;
    840840            int target = currentInstruction[2].u.operand;
    841             DataLabelPtr storeLocation = storePtrWithRepatch(Address(callFrameRegister, sizeof(Register) * retAddrDst));
     841            DataLabelPtr storeLocation = storePtrWithPatch(Address(callFrameRegister, sizeof(Register) * retAddrDst));
    842842            addJump(jump(), target + 2);
    843843            m_jsrSites.append(JSRInfo(storeLocation, label()));
     
    18421842    JITCodeRef codeRef(code, allocator);
    18431843 
    1844     RepatchBuffer repatchBuffer(code);
     1844    PatchBuffer patchBuffer(code);
    18451845
    18461846    // Translate vPC offsets into addresses in JIT generated code, for switch tables.
     
    18531853            ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size());
    18541854
    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]);
    18561856
    18571857            for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) {
    18581858                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;
    18601860            }
    18611861        } else {
    18621862            ASSERT(record.type == SwitchRecord::String);
    18631863
    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]);
    18651865
    18661866            StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end();           
    18671867            for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) {
    18681868                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;
    18701870            }
    18711871        }
     
    18741874    for (size_t i = 0; i < m_codeBlock->numberOfExceptionHandlers(); ++i) {
    18751875        HandlerInfo& handler = m_codeBlock->exceptionHandler(i);
    1876         handler.nativeCode = repatchBuffer.addressOf(m_labels[handler.target]);
     1876        handler.nativeCode = patchBuffer.addressOf(m_labels[handler.target]);
    18771877    }
    18781878
     
    18801880    for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
    18811881        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));
    18841884    }
    18851885
    18861886    // Link absolute addresses for jsr
    18871887    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));
    18891889
    18901890    for (unsigned i = 0; i < m_codeBlock->numberOfStructureStubInfos(); ++i) {
    18911891        StructureStubInfo& info = m_codeBlock->structureStubInfo(i);
    18921892#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);
    18951895#else
    18961896        info.callReturnLocation = 0;
     
    19011901        CallLinkInfo& info = m_codeBlock->callLinkInfo(i);
    19021902#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);
    19071907#else
    19081908        info.callReturnLocation = 0;
     
    20692069    m_interpreter->m_executablePool = m_globalData->poolForSize(m_assembler.size());
    20702070    void* code = m_assembler.executableCopy(m_interpreter->m_executablePool.get());
    2071     RepatchBuffer repatchBuffer(code);
     2071    PatchBuffer patchBuffer(code);
    20722072
    20732073#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);
    20832083#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);
    20962096}
    20972097
Note: See TracChangeset for help on using the changeset viewer.