Changeset 238573 in webkit


Ignore:
Timestamp:
Nov 27, 2018 1:41:38 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r238564. rdar://problem/45494310

Introducing a ENABLE_SEPARATED_WX_HEAP macro.
https://bugs.webkit.org/show_bug.cgi?id=192013
<rdar://problem/45494310>

Reviewed by Keith Miller.

This makes the code a little more readable.

I put the definition of ENABLE_SEPARATED_WX_HEAP in JSC's config.h instead of
Platform.h because ENABLE_SEPARATED_WX_HEAP is only needed inside JSC. Also,
ENABLE_SEPARATED_WX_HEAP depends on ENABLE(FAST_JIT_PERMISSIONS), which is only
defined for JSC.

  • config.h:
  • jit/ExecutableAllocator.cpp: (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
  • jit/ExecutableAllocator.h: (JSC::performJITMemcpy):
  • runtime/Options.cpp: (JSC::recomputeDependentOptions):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238564 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
tags/Safari-607.1.14.4/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tags/Safari-607.1.14.4/Source/JavaScriptCore/ChangeLog

    r238163 r238573  
     12018-11-27  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r238564. rdar://problem/45494310
     4
     5    Introducing a ENABLE_SEPARATED_WX_HEAP macro.
     6    https://bugs.webkit.org/show_bug.cgi?id=192013
     7    <rdar://problem/45494310>
     8   
     9    Reviewed by Keith Miller.
     10   
     11    This makes the code a little more readable.
     12   
     13    I put the definition of ENABLE_SEPARATED_WX_HEAP in JSC's config.h instead of
     14    Platform.h because ENABLE_SEPARATED_WX_HEAP is only needed inside JSC.  Also,
     15    ENABLE_SEPARATED_WX_HEAP depends on ENABLE(FAST_JIT_PERMISSIONS), which is only
     16    defined for JSC.
     17   
     18    * config.h:
     19    * jit/ExecutableAllocator.cpp:
     20    (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
     21    (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
     22    * jit/ExecutableAllocator.h:
     23    (JSC::performJITMemcpy):
     24    * runtime/Options.cpp:
     25    (JSC::recomputeDependentOptions):
     26   
     27   
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2018-11-27  Mark Lam  <mark.lam@apple.com>
     32
     33            Introducing a ENABLE_SEPARATED_WX_HEAP macro.
     34            https://bugs.webkit.org/show_bug.cgi?id=192013
     35            <rdar://problem/45494310>
     36
     37            Reviewed by Keith Miller.
     38
     39            This makes the code a little more readable.
     40
     41            I put the definition of ENABLE_SEPARATED_WX_HEAP in JSC's config.h instead of
     42            Platform.h because ENABLE_SEPARATED_WX_HEAP is only needed inside JSC.  Also,
     43            ENABLE_SEPARATED_WX_HEAP depends on ENABLE(FAST_JIT_PERMISSIONS), which is only
     44            defined for JSC.
     45
     46            * config.h:
     47            * jit/ExecutableAllocator.cpp:
     48            (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
     49            (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
     50            * jit/ExecutableAllocator.h:
     51            (JSC::performJITMemcpy):
     52            * runtime/Options.cpp:
     53            (JSC::recomputeDependentOptions):
     54
    1552018-11-13  Saam Barati  <sbarati@apple.com>
    256
  • tags/Safari-607.1.14.4/Source/JavaScriptCore/config.h

    r234227 r238573  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2018 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
    44 *
     
    3838
    3939#include <wtf/DisallowCType.h>
     40
     41#if !defined(ENABLE_SEPARATED_WX_HEAP)
     42#if (!ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)) && PLATFORM(IOS_FAMILY) && CPU(ARM64)
     43#define ENABLE_SEPARATED_WX_HEAP 1
     44#else
     45#define ENABLE_SEPARATED_WX_HEAP 0
     46#endif
     47#endif // !defined(ENABLE_SEPARATED_WX_HEAP)
  • tags/Safari-607.1.14.4/Source/JavaScriptCore/jit/ExecutableAllocator.cpp

    r237400 r238573  
    105105#endif
    106106
    107 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
     107#if ENABLE(SEPARATED_WX_HEAP)
    108108JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy { false };
    109109JS_EXPORT_PRIVATE JITWriteSeparateHeapsFunction jitWriteSeparateHeapsFunction;
     
    155155            void* reservationBase = m_reservation.base();
    156156
    157 #if ENABLE(FAST_JIT_PERMISSIONS) && CPU(ARM64E)
     157#if ENABLE(FAST_JIT_PERMISSIONS) && !ENABLE(SEPARATED_WX_HEAP)
    158158            RELEASE_ASSERT(os_thread_self_restrict_rwx_is_supported());
    159159            os_thread_self_restrict_rwx_to_rx();
    160160
    161 #else // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)
     161#else // not ENABLE(FAST_JIT_PERMISSIONS) or ENABLE(SEPARATED_WX_HEAP)
    162162#if ENABLE(FAST_JIT_PERMISSIONS)
    163163            if (os_thread_self_restrict_rwx_is_supported()) {
     
    173173                initializeSeparatedWXHeaps(m_reservation.base(), pageSize(), reservationBase, reservationSize);
    174174            }
    175 #endif // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)
     175#endif // not ENABLE(FAST_JIT_PERMISSIONS) or ENABLE(SEPARATED_WX_HEAP)
    176176
    177177            addFreshFreeSpace(reservationBase, reservationSize);
     
    267267        memset_s(&writableAddr, sizeof(writableAddr), 0, sizeof(writableAddr));
    268268
    269 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
     269#if ENABLE(SEPARATED_WX_HEAP)
    270270        jitWriteSeparateHeapsFunction = reinterpret_cast<JITWriteSeparateHeapsFunction>(writeThunk.code().executableAddress());
    271271#endif
  • tags/Safari-607.1.14.4/Source/JavaScriptCore/jit/ExecutableAllocator.h

    r237266 r238573  
    7979JS_EXPORT_PRIVATE bool isJITPC(void* pc);
    8080
    81 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
     81#if ENABLE(SEPARATED_WX_HEAP)
    8282
    8383typedef void (*JITWriteSeparateHeapsFunction)(off_t, const void*, size_t);
     
    8585extern JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy;
    8686
    87 #endif // !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
     87#endif // ENABLE(SEPARATED_WX_HEAP)
    8888
    8989static inline void* performJITMemcpy(void *dst, const void *src, size_t n)
     
    9797        RELEASE_ASSERT(reinterpret_cast<uint8_t*>(dst) + n <= endOfFixedExecutableMemoryPool());
    9898#if ENABLE(FAST_JIT_PERMISSIONS)
    99 #if !CPU(ARM64E)
     99#if ENABLE(SEPARATED_WX_HEAP)
    100100        if (useFastPermisionsJITCopy)
    101101#endif
     
    108108#endif // ENABLE(FAST_JIT_PERMISSIONS)
    109109
    110 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
     110#if ENABLE(SEPARATED_WX_HEAP)
    111111        if (jitWriteSeparateHeapsFunction) {
    112112            // Use execute-only write thunk for writes inside the JIT region. This is a variant of
  • tags/Safari-607.1.14.4/Source/JavaScriptCore/runtime/Options.cpp

    r237266 r238573  
    469469    }
    470470   
    471 #if PLATFORM(IOS_FAMILY) && CPU(ARM64) && !CPU(ARM64E)
     471#if ENABLE(SEPARATED_WX_HEAP)
    472472    // Override globally for now. Longer term we'll just make the default
    473473    // be to have this option enabled, and have platforms that don't support
Note: See TracChangeset for help on using the changeset viewer.