- Revision
- 238573
- Author
- alanc...@apple.com
- Date
- 2018-11-27 13:41:38 -0800 (Tue, 27 Nov 2018)
Log 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
Modified Paths
Diff
Modified: tags/Safari-607.1.14.4/Source/_javascript_Core/ChangeLog (238572 => 238573)
--- tags/Safari-607.1.14.4/Source/_javascript_Core/ChangeLog 2018-11-27 21:29:29 UTC (rev 238572)
+++ tags/Safari-607.1.14.4/Source/_javascript_Core/ChangeLog 2018-11-27 21:41:38 UTC (rev 238573)
@@ -1,3 +1,57 @@
+2018-11-27 Alan Coon <alanc...@apple.com>
+
+ 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
+
+ 2018-11-27 Mark Lam <mark....@apple.com>
+
+ 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):
+
2018-11-13 Saam Barati <sbar...@apple.com>
ProxyObject should check for VMInquiry and return early before throwing a stack overflow exception
Modified: tags/Safari-607.1.14.4/Source/_javascript_Core/config.h (238572 => 238573)
--- tags/Safari-607.1.14.4/Source/_javascript_Core/config.h 2018-11-27 21:29:29 UTC (rev 238572)
+++ tags/Safari-607.1.14.4/Source/_javascript_Core/config.h 2018-11-27 21:41:38 UTC (rev 238573)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2018 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.wei...@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -37,3 +37,11 @@
#endif
#include <wtf/DisallowCType.h>
+
+#if !defined(ENABLE_SEPARATED_WX_HEAP)
+#if (!ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)) && PLATFORM(IOS_FAMILY) && CPU(ARM64)
+#define ENABLE_SEPARATED_WX_HEAP 1
+#else
+#define ENABLE_SEPARATED_WX_HEAP 0
+#endif
+#endif // !defined(ENABLE_SEPARATED_WX_HEAP)
Modified: tags/Safari-607.1.14.4/Source/_javascript_Core/jit/ExecutableAllocator.cpp (238572 => 238573)
--- tags/Safari-607.1.14.4/Source/_javascript_Core/jit/ExecutableAllocator.cpp 2018-11-27 21:29:29 UTC (rev 238572)
+++ tags/Safari-607.1.14.4/Source/_javascript_Core/jit/ExecutableAllocator.cpp 2018-11-27 21:41:38 UTC (rev 238573)
@@ -104,7 +104,7 @@
static const double executablePoolReservationFraction = 0.25;
#endif
-#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
+#if ENABLE(SEPARATED_WX_HEAP)
JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy { false };
JS_EXPORT_PRIVATE JITWriteSeparateHeapsFunction jitWriteSeparateHeapsFunction;
#endif
@@ -154,11 +154,11 @@
ASSERT(m_reservation.size() == reservationSize);
void* reservationBase = m_reservation.base();
-#if ENABLE(FAST_JIT_PERMISSIONS) && CPU(ARM64E)
+#if ENABLE(FAST_JIT_PERMISSIONS) && !ENABLE(SEPARATED_WX_HEAP)
RELEASE_ASSERT(os_thread_self_restrict_rwx_is_supported());
os_thread_self_restrict_rwx_to_rx();
-#else // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)
+#else // not ENABLE(FAST_JIT_PERMISSIONS) or ENABLE(SEPARATED_WX_HEAP)
#if ENABLE(FAST_JIT_PERMISSIONS)
if (os_thread_self_restrict_rwx_is_supported()) {
useFastPermisionsJITCopy = true;
@@ -172,7 +172,7 @@
reservationSize -= pageSize();
initializeSeparatedWXHeaps(m_reservation.base(), pageSize(), reservationBase, reservationSize);
}
-#endif // not ENABLE(FAST_JIT_PERMISSIONS) or not CPU(ARM64E)
+#endif // not ENABLE(FAST_JIT_PERMISSIONS) or ENABLE(SEPARATED_WX_HEAP)
addFreshFreeSpace(reservationBase, reservationSize);
@@ -266,7 +266,7 @@
// Zero out writableAddr to avoid leaking the address of the writable mapping.
memset_s(&writableAddr, sizeof(writableAddr), 0, sizeof(writableAddr));
-#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
+#if ENABLE(SEPARATED_WX_HEAP)
jitWriteSeparateHeapsFunction = reinterpret_cast<JITWriteSeparateHeapsFunction>(writeThunk.code().executableAddress());
#endif
}
Modified: tags/Safari-607.1.14.4/Source/_javascript_Core/jit/ExecutableAllocator.h (238572 => 238573)
--- tags/Safari-607.1.14.4/Source/_javascript_Core/jit/ExecutableAllocator.h 2018-11-27 21:29:29 UTC (rev 238572)
+++ tags/Safari-607.1.14.4/Source/_javascript_Core/jit/ExecutableAllocator.h 2018-11-27 21:41:38 UTC (rev 238573)
@@ -78,13 +78,13 @@
JS_EXPORT_PRIVATE bool isJITPC(void* pc);
-#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
+#if ENABLE(SEPARATED_WX_HEAP)
typedef void (*JITWriteSeparateHeapsFunction)(off_t, const void*, size_t);
extern JS_EXPORT_PRIVATE JITWriteSeparateHeapsFunction jitWriteSeparateHeapsFunction;
extern JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy;
-#endif // !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
+#endif // ENABLE(SEPARATED_WX_HEAP)
static inline void* performJITMemcpy(void *dst, const void *src, size_t n)
{
@@ -96,7 +96,7 @@
if (isJITPC(dst)) {
RELEASE_ASSERT(reinterpret_cast<uint8_t*>(dst) + n <= endOfFixedExecutableMemoryPool());
#if ENABLE(FAST_JIT_PERMISSIONS)
-#if !CPU(ARM64E)
+#if ENABLE(SEPARATED_WX_HEAP)
if (useFastPermisionsJITCopy)
#endif
{
@@ -107,7 +107,7 @@
}
#endif // ENABLE(FAST_JIT_PERMISSIONS)
-#if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
+#if ENABLE(SEPARATED_WX_HEAP)
if (jitWriteSeparateHeapsFunction) {
// Use execute-only write thunk for writes inside the JIT region. This is a variant of
// memcpy that takes an offset into the JIT region as its destination (first) parameter.
Modified: tags/Safari-607.1.14.4/Source/_javascript_Core/runtime/Options.cpp (238572 => 238573)
--- tags/Safari-607.1.14.4/Source/_javascript_Core/runtime/Options.cpp 2018-11-27 21:29:29 UTC (rev 238572)
+++ tags/Safari-607.1.14.4/Source/_javascript_Core/runtime/Options.cpp 2018-11-27 21:41:38 UTC (rev 238573)
@@ -468,7 +468,7 @@
Options::useOSREntryToFTL() = false;
}
-#if PLATFORM(IOS_FAMILY) && CPU(ARM64) && !CPU(ARM64E)
+#if ENABLE(SEPARATED_WX_HEAP)
// Override globally for now. Longer term we'll just make the default
// be to have this option enabled, and have platforms that don't support
// it just silently use a single mapping.