Changeset 158205 in webkit


Ignore:
Timestamp:
Oct 29, 2013 12:02:46 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Fix CPU(ARM_TRADITIONAL) build after r157690.
https://bugs.webkit.org/show_bug.cgi?id=123247

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-10-29
Reviewed by Michael Saboff.

Since r157690, the executableCopy function has been removed from AssemblerBuffer.h
and the copy of executable code occurs in the linkCode function (in LinkBuffer.cpp).
As the constant pool for jumps is updated in the executableCopy function of ARM_TRADITIONAL,
this part of code still needs to be called and absolute jumps must be corrected to anticipate
the copy of the executable code through memcpy.

  • assembler/ARMAssembler.cpp:

(JSC::ARMAssembler::prepareExecutableCopy): Rename executableCopy to prepareExecutableCopy
and correct absolute jump values using the delta between the source and destination buffers.

  • assembler/ARMAssembler.h:
  • assembler/LinkBuffer.cpp:

(JSC::LinkBuffer::linkCode): Call prepareExecutableCopy just before the memcpy.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r158141 r158205  
     12013-10-29  Julien Brianceau  <jbriance@cisco.com>
     2
     3        Fix CPU(ARM_TRADITIONAL) build after r157690.
     4        https://bugs.webkit.org/show_bug.cgi?id=123247
     5
     6        Reviewed by Michael Saboff.
     7
     8        Since r157690, the executableCopy function has been removed from AssemblerBuffer.h
     9        and the copy of executable code occurs in the linkCode function (in LinkBuffer.cpp).
     10        As the constant pool for jumps is updated in the executableCopy function of ARM_TRADITIONAL,
     11        this part of code still needs to be called and absolute jumps must be corrected to anticipate
     12        the copy of the executable code through memcpy.
     13
     14        * assembler/ARMAssembler.cpp:
     15        (JSC::ARMAssembler::prepareExecutableCopy): Rename executableCopy to prepareExecutableCopy
     16        and correct absolute jump values using the delta between the source and destination buffers.
     17        * assembler/ARMAssembler.h:
     18        * assembler/LinkBuffer.cpp:
     19        (JSC::LinkBuffer::linkCode): Call prepareExecutableCopy just before the memcpy.
     20
    1212013-10-28  Filip Pizlo  <fpizlo@apple.com>
    222
  • trunk/Source/JavaScriptCore/assembler/ARMAssembler.cpp

    r148696 r158205  
    392392}
    393393
    394 PassRefPtr<ExecutableMemoryHandle> ARMAssembler::executableCopy(VM& vm, void* ownerUID, JITCompilationEffort effort)
     394void ARMAssembler::prepareExecutableCopy(void* to)
    395395{
    396396    // 64-bit alignment is required for next constant pool and JIT code as well
     
    399399        bkpt(0);
    400400
    401     RefPtr<ExecutableMemoryHandle> result = m_buffer.executableCopy(vm, ownerUID, effort);
    402     char* data = reinterpret_cast<char*>(result->start());
     401    char* data = reinterpret_cast<char*>(m_buffer.data());
     402    ptrdiff_t delta = reinterpret_cast<char*>(to) - data;
    403403
    404404    for (Jumps::Iterator iter = m_jumps.begin(); iter != m_jumps.end(); ++iter) {
     
    416416                }
    417417            }
    418             *addr = reinterpret_cast<ARMWord>(data + *addr);
    419         }
    420     }
    421 
    422     return result;
     418            *addr = reinterpret_cast<ARMWord>(data + delta + *addr);
     419        }
     420    }
    423421}
    424422
  • trunk/Source/JavaScriptCore/assembler/ARMAssembler.h

    r157796 r158205  
    809809        }
    810810
    811         PassRefPtr<ExecutableMemoryHandle> executableCopy(VM&, void* ownerUID, JITCompilationEffort);
     811        void prepareExecutableCopy(void* to);
    812812
    813813        unsigned debugOffset() { return m_buffer.debugOffset(); }
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp

    r157872 r158205  
    148148        return;
    149149    ASSERT(m_code);
     150#if CPU(ARM_TRADITIONAL)
     151    m_assembler->m_assembler.prepareExecutableCopy(m_code);
     152#endif
    150153    memcpy(m_code, buffer.data(), buffer.codeSize());
    151154#elif CPU(ARM_THUMB2)
Note: See TracChangeset for help on using the changeset viewer.