Changeset 236538 in webkit


Ignore:
Timestamp:
Sep 26, 2018 9:36:42 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

Options::useSeparatedWXHeap() should always be false when ENABLE(FAST_JIT_PERMISSIONS) && CPU(ARM64E).
https://bugs.webkit.org/show_bug.cgi?id=190022
<rdar://problem/44800928>

Reviewed by Saam Barati.

  • jit/ExecutableAllocator.cpp:

(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
(JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):

  • jit/ExecutableAllocator.h:

(JSC::performJITMemcpy):

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r236534 r236538  
     12018-09-26  Mark Lam  <mark.lam@apple.com>
     2
     3        Options::useSeparatedWXHeap() should always be false when ENABLE(FAST_JIT_PERMISSIONS) && CPU(ARM64E).
     4        https://bugs.webkit.org/show_bug.cgi?id=190022
     5        <rdar://problem/44800928>
     6
     7        Reviewed by Saam Barati.
     8
     9        * jit/ExecutableAllocator.cpp:
     10        (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
     11        (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
     12        * jit/ExecutableAllocator.h:
     13        (JSC::performJITMemcpy):
     14        * runtime/Options.cpp:
     15        (JSC::recomputeDependentOptions):
     16
    1172018-09-26  Mark Lam  <mark.lam@apple.com>
    218
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp

    r232604 r236538  
    107107JS_EXPORT_PRIVATE void* taggedStartOfFixedExecutableMemoryPool;
    108108JS_EXPORT_PRIVATE void* taggedEndOfFixedExecutableMemoryPool;
     109
     110#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
    109111JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy { false };
    110 
    111112JS_EXPORT_PRIVATE JITWriteSeparateHeapsFunction jitWriteSeparateHeapsFunction;
     113#endif
    112114
    113115#if !USE(EXECUTE_ONLY_JIT_WRITE_FUNCTION) && HAVE(REMAP_JIT)
     
    144146            void* reservationBase = m_reservation.base();
    145147
     148#if ENABLE(FAST_JIT_PERMISSIONS) && CPU(ARM64E)
     149            RELEASE_ASSERT(os_thread_self_restrict_rwx_is_supported());
     150            os_thread_self_restrict_rwx_to_rx();
     151
     152#else // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)
    146153#if ENABLE(FAST_JIT_PERMISSIONS)
    147154            if (os_thread_self_restrict_rwx_is_supported()) {
     
    157164                initializeSeparatedWXHeaps(m_reservation.base(), pageSize(), reservationBase, reservationSize);
    158165            }
     166#endif // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)
    159167
    160168            addFreshFreeSpace(reservationBase, reservationSize);
     
    245253        memset_s(&writableAddr, sizeof(writableAddr), 0, sizeof(writableAddr));
    246254
     255#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
    247256        jitWriteSeparateHeapsFunction = reinterpret_cast<JITWriteSeparateHeapsFunction>(writeThunk.code().executableAddress());
     257#endif
    248258    }
    249259
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h

    r236534 r236538  
    8282}
    8383
     84#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
     85
    8486typedef void (*JITWriteSeparateHeapsFunction)(off_t, const void*, size_t);
    8587extern JS_EXPORT_PRIVATE JITWriteSeparateHeapsFunction jitWriteSeparateHeapsFunction;
     88extern JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy;
    8689
    87 extern JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy;
     90#endif // !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
    8891
    8992static inline void* performJITMemcpy(void *dst, const void *src, size_t n)
     
    97100        RELEASE_ASSERT(reinterpret_cast<uint8_t*>(dst) + n <= endOfFixedExecutableMemoryPool());
    98101#if ENABLE(FAST_JIT_PERMISSIONS)
    99         if (useFastPermisionsJITCopy) {
     102#if !CPU(ARM64E)
     103        if (useFastPermisionsJITCopy)
     104#endif
     105        {
    100106            os_thread_self_restrict_rwx_to_rw();
    101107            memcpy(dst, src, n);
     
    103109            return dst;
    104110        }
    105 #endif
     111#endif // ENABLE(FAST_JIT_PERMISSIONS)
    106112
     113#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
    107114        if (jitWriteSeparateHeapsFunction) {
    108115            // Use execute-only write thunk for writes inside the JIT region. This is a variant of
     
    112119            return dst;
    113120        }
     121#endif
    114122    }
    115123
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r235935 r236538  
    460460    }
    461461   
    462 #if PLATFORM(IOS) && CPU(ARM64)
     462#if PLATFORM(IOS) && CPU(ARM64) && !CPU(ARM64E)
    463463    // Override globally for now. Longer term we'll just make the default
    464464    // be to have this option enabled, and have platforms that don't support
Note: See TracChangeset for help on using the changeset viewer.