Changeset 85372 in webkit


Ignore:
Timestamp:
Apr 29, 2011 5:11:22 PM (13 years ago)
Author:
barraclough@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=59847
Remove linkOffset from LinkBuffer

Reviewed by Oliver Hunt.

This is redundant since removal of recompilation for exception info.

  • assembler/LinkBuffer.h:

(JSC::LinkBuffer::LinkBuffer):
(JSC::LinkBuffer::linkCode):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileFunction):

  • jit/JIT.cpp:

(JSC::JIT::JIT):
(JSC::JIT::privateCompile):

  • jit/JIT.h:

(JSC::JIT::compile):
(JSC::JIT::compileCTIMachineTrampolines):
(JSC::JIT::compileCTINativeCall):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):
(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::finalize):

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::compile):

Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r85361 r85372  
     12011-04-29  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=59847
     6        Remove linkOffset from LinkBuffer
     7
     8        This is redundant since removal of recompilation for exception info.
     9
     10        * assembler/LinkBuffer.h:
     11        (JSC::LinkBuffer::LinkBuffer):
     12        (JSC::LinkBuffer::linkCode):
     13        * dfg/DFGJITCompiler.cpp:
     14        (JSC::DFG::JITCompiler::compileFunction):
     15        * jit/JIT.cpp:
     16        (JSC::JIT::JIT):
     17        (JSC::JIT::privateCompile):
     18        * jit/JIT.h:
     19        (JSC::JIT::compile):
     20        (JSC::JIT::compileCTIMachineTrampolines):
     21        (JSC::JIT::compileCTINativeCall):
     22        * jit/JITOpcodes.cpp:
     23        (JSC::JIT::privateCompileCTIMachineTrampolines):
     24        * jit/JITOpcodes32_64.cpp:
     25        (JSC::JIT::privateCompileCTIMachineTrampolines):
     26        (JSC::JIT::privateCompileCTINativeCall):
     27        * jit/JITPropertyAccess.cpp:
     28        (JSC::JIT::stringGetByValStubGenerator):
     29        (JSC::JIT::privateCompilePutByIdTransition):
     30        (JSC::JIT::privateCompilePatchGetArrayLength):
     31        (JSC::JIT::privateCompileGetByIdProto):
     32        (JSC::JIT::privateCompileGetByIdSelfList):
     33        (JSC::JIT::privateCompileGetByIdProtoList):
     34        (JSC::JIT::privateCompileGetByIdChainList):
     35        (JSC::JIT::privateCompileGetByIdChain):
     36        * jit/JITPropertyAccess32_64.cpp:
     37        (JSC::JIT::stringGetByValStubGenerator):
     38        (JSC::JIT::privateCompilePutByIdTransition):
     39        (JSC::JIT::privateCompilePatchGetArrayLength):
     40        (JSC::JIT::privateCompileGetByIdProto):
     41        (JSC::JIT::privateCompileGetByIdSelfList):
     42        (JSC::JIT::privateCompileGetByIdProtoList):
     43        (JSC::JIT::privateCompileGetByIdChainList):
     44        (JSC::JIT::privateCompileGetByIdChain):
     45        * jit/SpecializedThunkJIT.h:
     46        (JSC::SpecializedThunkJIT::finalize):
     47        * yarr/YarrJIT.cpp:
     48        (JSC::Yarr::YarrGenerator::compile):
     49
    1502011-04-29  Gavin Barraclough  <barraclough@apple.com>
    251
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.h

    r83916 r85372  
    7171    //       First, executablePool is copied into m_executablePool, then the initialization of
    7272    //       m_code uses m_executablePool, *not* executablePool, since this is no longer valid.
    73     // The linkOffset parameter should only be non-null when recompiling for exception info
    74     LinkBuffer(MacroAssembler* masm, PassRefPtr<ExecutablePool> executablePool, void* linkOffset)
     73    LinkBuffer(MacroAssembler* masm, PassRefPtr<ExecutablePool> executablePool)
    7574        : m_executablePool(executablePool)
    7675        , m_size(0)
     
    8180#endif
    8281    {
    83         linkCode(linkOffset);
     82        linkCode();
    8483    }
    8584
     
    207206    }
    208207
    209     void linkCode(void* linkOffset)
    210     {
    211         UNUSED_PARAM(linkOffset);
     208    void linkCode()
     209    {
    212210        ASSERT(!m_code);
    213211#if !ENABLE(BRANCH_COMPACTION)
     
    222220        uint8_t* inData = (uint8_t*)m_assembler->unlinkedCode();
    223221        uint8_t* outData = reinterpret_cast<uint8_t*>(m_code);
    224         const uint8_t* linkBase = linkOffset ? reinterpret_cast<uint8_t*>(linkOffset) : outData;
    225222        int readPtr = 0;
    226223        int writePtr = 0;
     
    242239            const uint8_t* target;
    243240            if (jumpsToLink[i].to() >= jumpsToLink[i].from())
    244                 target = linkBase + jumpsToLink[i].to() - offset; // Compensate for what we have collapsed so far
     241                target = outData + jumpsToLink[i].to() - offset; // Compensate for what we have collapsed so far
    245242            else
    246                 target = linkBase + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to());
     243                target = outData + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to());
    247244           
    248             JumpLinkType jumpLinkType = m_assembler->computeJumpType(jumpsToLink[i], linkBase + writePtr, target);
     245            JumpLinkType jumpLinkType = m_assembler->computeJumpType(jumpsToLink[i], outData + writePtr, target);
    249246            // Compact branch if we can...
    250247            if (m_assembler->canCompact(jumpsToLink[i].type())) {
     
    262259        m_assembler->recordLinkOffsets(readPtr, m_assembler->size(), readPtr - writePtr);
    263260       
    264         // Actually link everything (don't link if we've be given a linkoffset as it's a
    265         // waste of time: linkOffset is used for recompiling to get exception info)
    266         if (!linkOffset) {
    267             for (unsigned i = 0; i < jumpCount; ++i) {
    268                 uint8_t* location = outData + jumpsToLink[i].from();
    269                 uint8_t* target = outData + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to());
    270                 m_assembler->link(jumpsToLink[i], location, target);
    271             }
     261        for (unsigned i = 0; i < jumpCount; ++i) {
     262            uint8_t* location = outData + jumpsToLink[i].from();
     263            uint8_t* target = outData + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to());
     264            m_assembler->link(jumpsToLink[i], location, target);
    272265        }
    273266
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r85271 r85372  
    351351    // Link the code, populate data in CodeBlock data structures.
    352352
    353     LinkBuffer linkBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()), 0);
     353    LinkBuffer linkBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
    354354
    355355#if DFG_DEBUG_VERBOSE
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r84063 r85372  
    6969}
    7070
    71 JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock, void* linkerOffset)
     71JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock)
    7272    : m_interpreter(globalData->interpreter)
    7373    , m_globalData(globalData)
     
    8787    , m_jumpTargetsPosition(0)
    8888#endif
    89     , m_linkerOffset(linkerOffset)
    9089{
    9190}
     
    514513    ASSERT(m_jmpTable.isEmpty());
    515514
    516     LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()), m_linkerOffset);
     515    LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
    517516
    518517    // Translate vPC offsets into addresses in JIT generated code, for switch tables.
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r84052 r85372  
    179179
    180180    public:
    181         static JITCode compile(JSGlobalData* globalData, CodeBlock* codeBlock, CodePtr* functionEntryArityCheck = 0, void* offsetBase = 0)
    182         {
    183             return JIT(globalData, codeBlock, offsetBase).privateCompile(functionEntryArityCheck);
     181        static JITCode compile(JSGlobalData* globalData, CodeBlock* codeBlock, CodePtr* functionEntryArityCheck = 0)
     182        {
     183            return JIT(globalData, codeBlock).privateCompile(functionEntryArityCheck);
    184184        }
    185185
     
    222222            if (!globalData->canUseJIT())
    223223                return;
    224             JIT jit(globalData, 0, 0);
     224            JIT jit(globalData, 0);
    225225            jit.privateCompileCTIMachineTrampolines(executablePool, globalData, trampolines);
    226226        }
     
    230230            if (!globalData->canUseJIT())
    231231                return CodePtr();
    232             JIT jit(globalData, 0, 0);
     232            JIT jit(globalData, 0);
    233233            return jit.privateCompileCTINativeCall(executablePool, globalData, func);
    234234        }
     
    259259        };
    260260
    261         JIT(JSGlobalData*, CodeBlock* = 0, void* = 0);
     261        JIT(JSGlobalData*, CodeBlock* = 0);
    262262
    263263        void privateCompileMainPass();
     
    994994#endif
    995995#endif
    996         void* m_linkerOffset;
    997996        static CodePtr stringGetByValStubGenerator(JSGlobalData* globalData, ExecutablePool* pool);
    998997    } JIT_CLASS_ALIGNMENT;
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r84399 r85372  
    159159
    160160    // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object.
    161     LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()), 0);
     161    LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
    162162
    163163#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r84402 r85372  
    160160
    161161    // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object.
    162     LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()), 0);
     162    LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()));
    163163
    164164#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
     
    465465
    466466    // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object.
    467     LinkBuffer patchBuffer(this, executablePool, 0);
     467    LinkBuffer patchBuffer(this, executablePool);
    468468
    469469    patchBuffer.link(nativeCall, FunctionPtr(func));
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r85240 r85372  
    7878    jit.ret();
    7979   
    80     LinkBuffer patchBuffer(&jit, pool, 0);
     80    LinkBuffer patchBuffer(&jit, pool);
    8181    return patchBuffer.finalizeCode().m_code;
    8282}
     
    602602    Call failureCall = tailRecursiveCall();
    603603
    604     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     604    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    605605
    606606    patchBuffer.link(failureCall, FunctionPtr(direct ? cti_op_put_by_id_direct_fail : cti_op_put_by_id_fail));
     
    680680    Jump success = jump();
    681681
    682     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     682    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    683683
    684684    // Use the patch information to link the failure cases back to the original slow case routine.
     
    738738        compileGetDirectOffset(protoObject, regT0, cachedOffset);
    739739    Jump success = jump();
    740     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     740    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    741741
    742742    // Use the patch information to link the failure cases back to the original slow case routine.
     
    791791    Jump success = jump();
    792792
    793     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     793    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    794794
    795795    if (needsStubLink) {
     
    856856    Jump success = jump();
    857857
    858     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     858    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    859859
    860860    if (needsStubLink) {
     
    922922    Jump success = jump();
    923923
    924     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     924    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    925925   
    926926    if (needsStubLink) {
     
    990990    Jump success = jump();
    991991
    992     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     992    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    993993
    994994    if (needsStubLink) {
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r85240 r85372  
    296296    jit.ret();
    297297   
    298     LinkBuffer patchBuffer(&jit, pool, 0);
     298    LinkBuffer patchBuffer(&jit, pool);
    299299    return patchBuffer.finalizeCode().m_code;
    300300}
     
    625625    Call failureCall = tailRecursiveCall();
    626626   
    627     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     627    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    628628   
    629629    patchBuffer.link(failureCall, FunctionPtr(direct ? cti_op_put_by_id_direct_fail : cti_op_put_by_id_fail));
     
    707707    Jump success = jump();
    708708   
    709     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     709    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    710710   
    711711    // Use the patch information to link the failure cases back to the original slow case routine.
     
    767767    Jump success = jump();
    768768   
    769     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     769    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    770770   
    771771    // Use the patch information to link the failure cases back to the original slow case routine.
     
    824824    Jump success = jump();
    825825   
    826     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     826    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    827827    if (needsStubLink) {
    828828        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
     
    888888    Jump success = jump();
    889889   
    890     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     890    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    891891    if (needsStubLink) {
    892892        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
     
    955955    Jump success = jump();
    956956   
    957     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     957    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    958958    if (needsStubLink) {
    959959        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
     
    10221022    Jump success = jump();
    10231023   
    1024     LinkBuffer patchBuffer(this, m_codeBlock->executablePool(), 0);
     1024    LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
    10251025    if (needsStubLink) {
    10261026        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
  • trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h

    r82130 r85372  
    126126        MacroAssemblerCodePtr finalize(MacroAssemblerCodePtr fallback)
    127127        {
    128             LinkBuffer patchBuffer(this, m_pool.get(), 0);
     128            LinkBuffer patchBuffer(this, m_pool.get());
    129129            patchBuffer.link(m_failures, CodeLocationLabel(fallback));
    130130            return patchBuffer.finalizeCode().m_code;
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r84846 r85372  
    22502250        generate();
    22512251
    2252         LinkBuffer patchBuffer(this, globalData->regexAllocator.poolForSize(size()), 0);
     2252        LinkBuffer patchBuffer(this, globalData->regexAllocator.poolForSize(size()));
    22532253
    22542254        for (unsigned i = 0; i < m_expressionState.m_backtrackRecords.size(); ++i)
Note: See TracChangeset for help on using the changeset viewer.