Changeset 99614 in webkit


Ignore:
Timestamp:
Nov 8, 2011 1:57:16 PM (12 years ago)
Author:
barraclough@apple.com
Message:

DFG JIT calculation of OSR entry points is not THUMB2 safe
https://bugs.webkit.org/show_bug.cgi?id=71852

Reviewed by Oliver Hunt.

Executable addresses are tagged with a low bit set to distinguish
between THUMB2 and traditional ARM.

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::exitSpeculativeWithOSR):

  • dfg/DFGJITCompiler32_64.cpp:

(JSC::DFG::JITCompiler::exitSpeculativeWithOSR):

  • dfg/DFGOSREntry.cpp:

(JSC::DFG::prepareOSREntry):

  • jit/JITCode.h:

(JSC::JITCode::executableAddressAtOffset):
(JSC::JITCode::start):
(JSC::JITCode::size):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r99608 r99614  
     12011-11-08  Gavin Barraclough  <barraclough@apple.com>
     2
     3        DFG JIT calculation of OSR entry points is not THUMB2 safe
     4        https://bugs.webkit.org/show_bug.cgi?id=71852
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Executable addresses are tagged with a low bit set to distinguish
     9        between THUMB2 and traditional ARM.
     10
     11        * dfg/DFGJITCompiler.cpp:
     12        (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
     13        * dfg/DFGJITCompiler32_64.cpp:
     14        (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
     15        * dfg/DFGOSREntry.cpp:
     16        (JSC::DFG::prepareOSREntry):
     17        * jit/JITCode.h:
     18        (JSC::JITCode::executableAddressAtOffset):
     19        (JSC::JITCode::start):
     20        (JSC::JITCode::size):
     21
    1222011-11-08  Michael Saboff  <msaboff@apple.com>
    223
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r99519 r99614  
    757757        ASSERT(mapping->m_bytecodeIndex == returnBytecodeIndex);
    758758       
    759         void* jumpTarget = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(baselineCodeBlockForCaller->getJITCode().start()) + mapping->m_machineCodeOffset);
     759        void* jumpTarget = baselineCodeBlockForCaller->getJITCode().executableAddressAtOffset(mapping->m_machineCodeOffset);
    760760
    761761        GPRReg callerFrameGPR;
     
    787787    ASSERT(mapping->m_bytecodeIndex == exit.m_codeOrigin.bytecodeIndex);
    788788   
    789     void* jumpTarget = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(baselineCodeBlock->getJITCode().start()) + mapping->m_machineCodeOffset);
     789    void* jumpTarget = baselineCodeBlock->getJITCode().executableAddressAtOffset(mapping->m_machineCodeOffset);
    790790   
    791791    ASSERT(GPRInfo::regT1 != GPRInfo::cachedResultRegister);
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp

    r99519 r99614  
    513513        ASSERT(mapping->m_bytecodeIndex == returnBytecodeIndex);
    514514       
    515         void* jumpTarget = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(baselineCodeBlockForCaller->getJITCode().start()) + mapping->m_machineCodeOffset);
     515        void* jumpTarget = baselineCodeBlockForCaller->getJITCode().executableAddressAtOffset(mapping->m_machineCodeOffset);
    516516
    517517        GPRReg callerFrameGPR;
     
    547547    ASSERT(mapping->m_bytecodeIndex == exit.m_codeOrigin.bytecodeIndex);
    548548   
    549     void* jumpTarget = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(baselineCodeBlock->getJITCode().start()) + mapping->m_machineCodeOffset);
     549    void* jumpTarget = baselineCodeBlock->getJITCode().executableAddressAtOffset(mapping->m_machineCodeOffset);
    550550   
    551551    ASSERT(GPRInfo::regT2 != GPRInfo::cachedResultRegister && GPRInfo::regT2 != GPRInfo::cachedResultRegister2);
  • trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp

    r97408 r99614  
    139139    // 4) Find and return the destination machine code address.
    140140   
    141     void* result = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(codeBlock->getJITCode().start()) + entry->m_machineCodeOffset);
     141    void* result = codeBlock->getJITCode().executableAddressAtOffset(entry->m_machineCodeOffset);
    142142   
    143143#if ENABLE(JIT_VERBOSE_OSR)
  • trunk/Source/JavaScriptCore/jit/JITCode.h

    r95901 r99614  
    8888        }
    8989
     90        void* executableAddressAtOffset(size_t offset) const
     91        {
     92            ASSERT(offset < size());
     93            return reinterpret_cast<char*>(m_ref.code().executableAddress()) + offset;
     94        }
     95
    9096        // This function returns the offset in bytes of 'pointerIntoCode' into
    9197        // this block of code.  The pointer provided must be a pointer into this
     
    105111        }
    106112
    107         void* start()
     113        void* start() const
    108114        {
    109115            return m_ref.code().dataLocation();
    110116        }
    111117
    112         size_t size()
     118        size_t size() const
    113119        {
    114120            ASSERT(m_ref.code().executableAddress());
Note: See TracChangeset for help on using the changeset viewer.