Changeset 238573 in webkit
- Timestamp:
- Nov 27, 2018 1:41:38 PM (6 years ago)
- 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 1 2018-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 1 55 2018-11-13 Saam Barati <sbarati@apple.com> 2 56 -
tags/Safari-607.1.14.4/Source/JavaScriptCore/config.h
r234227 r238573 1 1 /* 2 * Copyright (C) 2006 , 2007, 2008, 2013Apple Inc. All rights reserved.2 * Copyright (C) 2006-2018 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 4 * … … 38 38 39 39 #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 105 105 #endif 106 106 107 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)107 #if ENABLE(SEPARATED_WX_HEAP) 108 108 JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy { false }; 109 109 JS_EXPORT_PRIVATE JITWriteSeparateHeapsFunction jitWriteSeparateHeapsFunction; … … 155 155 void* reservationBase = m_reservation.base(); 156 156 157 #if ENABLE(FAST_JIT_PERMISSIONS) && CPU(ARM64E)157 #if ENABLE(FAST_JIT_PERMISSIONS) && !ENABLE(SEPARATED_WX_HEAP) 158 158 RELEASE_ASSERT(os_thread_self_restrict_rwx_is_supported()); 159 159 os_thread_self_restrict_rwx_to_rx(); 160 160 161 #else // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)161 #else // not ENABLE(FAST_JIT_PERMISSIONS) or ENABLE(SEPARATED_WX_HEAP) 162 162 #if ENABLE(FAST_JIT_PERMISSIONS) 163 163 if (os_thread_self_restrict_rwx_is_supported()) { … … 173 173 initializeSeparatedWXHeaps(m_reservation.base(), pageSize(), reservationBase, reservationSize); 174 174 } 175 #endif // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)175 #endif // not ENABLE(FAST_JIT_PERMISSIONS) or ENABLE(SEPARATED_WX_HEAP) 176 176 177 177 addFreshFreeSpace(reservationBase, reservationSize); … … 267 267 memset_s(&writableAddr, sizeof(writableAddr), 0, sizeof(writableAddr)); 268 268 269 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)269 #if ENABLE(SEPARATED_WX_HEAP) 270 270 jitWriteSeparateHeapsFunction = reinterpret_cast<JITWriteSeparateHeapsFunction>(writeThunk.code().executableAddress()); 271 271 #endif -
tags/Safari-607.1.14.4/Source/JavaScriptCore/jit/ExecutableAllocator.h
r237266 r238573 79 79 JS_EXPORT_PRIVATE bool isJITPC(void* pc); 80 80 81 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)81 #if ENABLE(SEPARATED_WX_HEAP) 82 82 83 83 typedef void (*JITWriteSeparateHeapsFunction)(off_t, const void*, size_t); … … 85 85 extern JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy; 86 86 87 #endif // !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)87 #endif // ENABLE(SEPARATED_WX_HEAP) 88 88 89 89 static inline void* performJITMemcpy(void *dst, const void *src, size_t n) … … 97 97 RELEASE_ASSERT(reinterpret_cast<uint8_t*>(dst) + n <= endOfFixedExecutableMemoryPool()); 98 98 #if ENABLE(FAST_JIT_PERMISSIONS) 99 #if !CPU(ARM64E)99 #if ENABLE(SEPARATED_WX_HEAP) 100 100 if (useFastPermisionsJITCopy) 101 101 #endif … … 108 108 #endif // ENABLE(FAST_JIT_PERMISSIONS) 109 109 110 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)110 #if ENABLE(SEPARATED_WX_HEAP) 111 111 if (jitWriteSeparateHeapsFunction) { 112 112 // 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 469 469 } 470 470 471 #if PLATFORM(IOS_FAMILY) && CPU(ARM64) && !CPU(ARM64E)471 #if ENABLE(SEPARATED_WX_HEAP) 472 472 // Override globally for now. Longer term we'll just make the default 473 473 // be to have this option enabled, and have platforms that don't support
Note: See TracChangeset
for help on using the changeset viewer.