Unreviewed, rolling out r197226 and r197256.
https://bugs.webkit.org/show_bug.cgi?id=154910
Caused crashes on Mac 32-bit and on ARM (Requested by ap on
#webkit).
Reverted changesets:
"Remove the on demand executable allocator"
https://bugs.webkit.org/show_bug.cgi?id=154749
http://trac.webkit.org/changeset/197226
"CLoop build fix."
http://trac.webkit.org/changeset/197256
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@197441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 6f13e5a..3c86aa7 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -515,6 +515,7 @@
jit/CallFrameShuffler32_64.cpp
jit/CallFrameShuffler64.cpp
jit/ExecutableAllocationFuzz.cpp
+ jit/ExecutableAllocator.cpp
jit/ExecutableAllocatorFixedVMPool.cpp
jit/GCAwareJITStubRoutine.cpp
jit/GPRInfo.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 151d6f2..eaa668e 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,20 @@
+2016-03-01 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r197226 and r197256.
+ https://bugs.webkit.org/show_bug.cgi?id=154910
+
+ Caused crashes on Mac 32-bit and on ARM (Requested by ap on
+ #webkit).
+
+ Reverted changesets:
+
+ "Remove the on demand executable allocator"
+ https://bugs.webkit.org/show_bug.cgi?id=154749
+ http://trac.webkit.org/changeset/197226
+
+ "CLoop build fix."
+ http://trac.webkit.org/changeset/197256
+
2016-03-01 Joseph Pecoraro <pecoraro@apple.com>
Simplify some StringBuilder appends
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
index 774b179..6cd4466 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
@@ -635,6 +635,7 @@
<ClCompile Include="..\jit\CallFrameShuffler32_64.cpp" />
<ClCompile Include="..\jit\CallFrameShuffler64.cpp" />
<ClCompile Include="..\jit\ExecutableAllocationFuzz.cpp" />
+ <ClCompile Include="..\jit\ExecutableAllocator.cpp" />
<ClCompile Include="..\jit\ExecutableAllocatorFixedVMPool.cpp" />
<ClCompile Include="..\jit\GCAwareJITStubRoutine.cpp" />
<ClCompile Include="..\jit\HostCallReturnValue.cpp" />
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
index b53fc6f..e54c784 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
@@ -390,6 +390,9 @@
<ClCompile Include="..\interpreter\StackVisitor.cpp">
<Filter>interpreter</Filter>
</ClCompile>
+ <ClCompile Include="..\jit\ExecutableAllocator.cpp">
+ <Filter>jit</Filter>
+ </ClCompile>
<ClCompile Include="..\jit\GCAwareJITStubRoutine.cpp">
<Filter>jit</Filter>
</ClCompile>
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index a6b9e28..e8a3054 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -1758,6 +1758,7 @@
A7A8AF4017ADB5F3005AB174 /* Uint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3117ADB5F3005AB174 /* Uint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7A8AF4117ADB5F3005AB174 /* Uint16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3217ADB5F3005AB174 /* Uint16Array.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7A8AF4217ADB5F3005AB174 /* Uint32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3317ADB5F3005AB174 /* Uint32Array.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; };
A7B4ACAF1484C9CE00B38A36 /* JSExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A79E781F15EECBA80047C855 /* UnlinkedCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7BDAEC817F4EA1400F6140C /* ArrayIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */; };
@@ -3948,6 +3949,7 @@
A7A8AF3317ADB5F3005AB174 /* Uint32Array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Uint32Array.h; sourceTree = "<group>"; };
A7A979C418BE8D9E002C3733 /* FunctionPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = FunctionPrototype.js; sourceTree = "<group>"; };
A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
+ A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = "<group>"; };
A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExportMacros.h; sourceTree = "<group>"; };
A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ArrayIteratorPrototype.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
A7BDAEC317F4EA1400F6140C /* ArrayIteratorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayIteratorPrototype.h; sourceTree = "<group>"; };
@@ -4942,6 +4944,7 @@
0FD82E37141AB14200179C94 /* CompactJITCodeMap.h */,
0FF054F71AC35B4400E5BE57 /* ExecutableAllocationFuzz.cpp */,
0FF054F81AC35B4400E5BE57 /* ExecutableAllocationFuzz.h */,
+ A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */,
A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */,
86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */,
0F24E53E17EA9F5900ABB217 /* FPRInfo.h */,
@@ -8850,6 +8853,7 @@
1429D8780ED21ACD00B89619 /* ExceptionHelpers.cpp in Sources */,
86CA032E1038E8440028A609 /* Executable.cpp in Sources */,
0FF054F91AC35B4400E5BE57 /* ExecutableAllocationFuzz.cpp in Sources */,
+ A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */,
86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */,
0F56A1D515001CF4002992B1 /* ExecutionCounter.cpp in Sources */,
0F0332C018ADFAE1005F979A /* ExitingJITType.cpp in Sources */,
diff --git a/Source/JavaScriptCore/jit/ExecutableAllocator.cpp b/Source/JavaScriptCore/jit/ExecutableAllocator.cpp
new file mode 100644
index 0000000..4ede235
--- /dev/null
+++ b/Source/JavaScriptCore/jit/ExecutableAllocator.cpp
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ExecutableAllocator.h"
+
+#include "JSCInlines.h"
+
+#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
+#include "CodeProfiling.h"
+#include <wtf/HashSet.h>
+#include <wtf/Lock.h>
+#include <wtf/MetaAllocator.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/PageReservation.h>
+#include <wtf/VMTags.h>
+#endif
+
+// Uncomment to create an artificial executable memory usage limit. This limit
+// is imperfect and is primarily useful for testing the VM's ability to handle
+// out-of-executable-memory situations.
+// #define EXECUTABLE_MEMORY_LIMIT 1000000
+
+#if ENABLE(ASSEMBLER)
+
+using namespace WTF;
+
+namespace JSC {
+
+#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
+
+class DemandExecutableAllocator : public MetaAllocator {
+public:
+ DemandExecutableAllocator()
+ : MetaAllocator(jitAllocationGranule)
+ {
+ std::lock_guard<StaticLock> lock(allocatorsMutex());
+ allocators().add(this);
+ // Don't preallocate any memory here.
+ }
+
+ virtual ~DemandExecutableAllocator()
+ {
+ {
+ std::lock_guard<StaticLock> lock(allocatorsMutex());
+ allocators().remove(this);
+ }
+ for (unsigned i = 0; i < reservations.size(); ++i)
+ reservations.at(i).deallocate();
+ }
+
+ static size_t bytesAllocatedByAllAllocators()
+ {
+ size_t total = 0;
+ std::lock_guard<StaticLock> lock(allocatorsMutex());
+ for (HashSet<DemandExecutableAllocator*>::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
+ total += (*allocator)->bytesAllocated();
+ return total;
+ }
+
+ static size_t bytesCommittedByAllocactors()
+ {
+ size_t total = 0;
+ std::lock_guard<StaticLock> lock(allocatorsMutex());
+ for (HashSet<DemandExecutableAllocator*>::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
+ total += (*allocator)->bytesCommitted();
+ return total;
+ }
+
+#if ENABLE(META_ALLOCATOR_PROFILE)
+ static void dumpProfileFromAllAllocators()
+ {
+ std::lock_guard<StaticLock> lock(allocatorsMutex());
+ for (HashSet<DemandExecutableAllocator*>::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
+ (*allocator)->dumpProfile();
+ }
+#endif
+
+protected:
+ virtual void* allocateNewSpace(size_t& numPages)
+ {
+ size_t newNumPages = (((numPages * pageSize() + JIT_ALLOCATOR_LARGE_ALLOC_SIZE - 1) / JIT_ALLOCATOR_LARGE_ALLOC_SIZE * JIT_ALLOCATOR_LARGE_ALLOC_SIZE) + pageSize() - 1) / pageSize();
+
+ ASSERT(newNumPages >= numPages);
+
+ numPages = newNumPages;
+
+#ifdef EXECUTABLE_MEMORY_LIMIT
+ if (bytesAllocatedByAllAllocators() >= EXECUTABLE_MEMORY_LIMIT)
+ return 0;
+#endif
+
+ PageReservation reservation = PageReservation::reserve(numPages * pageSize(), OSAllocator::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
+ RELEASE_ASSERT(reservation);
+
+ reservations.append(reservation);
+
+ return reservation.base();
+ }
+
+ virtual void notifyNeedPage(void* page)
+ {
+ OSAllocator::commit(page, pageSize(), EXECUTABLE_POOL_WRITABLE, true);
+ }
+
+ virtual void notifyPageIsFree(void* page)
+ {
+ OSAllocator::decommit(page, pageSize());
+ }
+
+private:
+ Vector<PageReservation, 16> reservations;
+ static HashSet<DemandExecutableAllocator*>& allocators()
+ {
+ static NeverDestroyed<HashSet<DemandExecutableAllocator*>> set;
+ return set;
+ }
+
+ static StaticLock& allocatorsMutex()
+ {
+ static StaticLock mutex;
+
+ return mutex;
+ }
+};
+
+#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
+void ExecutableAllocator::initializeAllocator()
+{
+}
+#else
+static DemandExecutableAllocator* gAllocator;
+
+namespace {
+static inline DemandExecutableAllocator* allocator()
+{
+ return gAllocator;
+}
+}
+
+void ExecutableAllocator::initializeAllocator()
+{
+ ASSERT(!gAllocator);
+ gAllocator = new DemandExecutableAllocator();
+ CodeProfiling::notifyAllocator(gAllocator);
+}
+#endif
+
+ExecutableAllocator::ExecutableAllocator(VM&)
+#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
+ : m_allocator(std::make_unique<DemandExecutableAllocator>())
+#endif
+{
+ ASSERT(allocator());
+}
+
+ExecutableAllocator::~ExecutableAllocator()
+{
+}
+
+bool ExecutableAllocator::isValid() const
+{
+ return true;
+}
+
+bool ExecutableAllocator::underMemoryPressure()
+{
+#ifdef EXECUTABLE_MEMORY_LIMIT
+ return DemandExecutableAllocator::bytesAllocatedByAllAllocators() > EXECUTABLE_MEMORY_LIMIT / 2;
+#else
+ return false;
+#endif
+}
+
+double ExecutableAllocator::memoryPressureMultiplier(size_t addedMemoryUsage)
+{
+ double result;
+#ifdef EXECUTABLE_MEMORY_LIMIT
+ size_t bytesAllocated = DemandExecutableAllocator::bytesAllocatedByAllAllocators() + addedMemoryUsage;
+ if (bytesAllocated >= EXECUTABLE_MEMORY_LIMIT)
+ bytesAllocated = EXECUTABLE_MEMORY_LIMIT;
+ result = static_cast<double>(EXECUTABLE_MEMORY_LIMIT) /
+ (EXECUTABLE_MEMORY_LIMIT - bytesAllocated);
+#else
+ UNUSED_PARAM(addedMemoryUsage);
+ result = 1.0;
+#endif
+ if (result < 1.0)
+ result = 1.0;
+ return result;
+
+}
+
+RefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
+{
+ RefPtr<ExecutableMemoryHandle> result = allocator()->allocate(sizeInBytes, ownerUID);
+ RELEASE_ASSERT(result || effort != JITCompilationMustSucceed);
+ return result;
+}
+
+size_t ExecutableAllocator::committedByteCount()
+{
+ return DemandExecutableAllocator::bytesCommittedByAllocactors();
+}
+
+#if ENABLE(META_ALLOCATOR_PROFILE)
+void ExecutableAllocator::dumpProfile()
+{
+ DemandExecutableAllocator::dumpProfileFromAllAllocators();
+}
+#endif
+
+Lock& ExecutableAllocator::getLock() const
+{
+ return gAllocator->getLock();
+}
+
+bool ExecutableAllocator::isValidExecutableMemory(const LockHolder& locker, void* address)
+{
+ return gAllocator->isInAllocatedMemory(locker, address);
+}
+
+#endif // ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
+
+#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
+
+#if OS(WINDOWS)
+#error "ASSEMBLER_WX_EXCLUSIVE not yet suported on this platform."
+#endif
+
+void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSetting setting)
+{
+ size_t pageSize = WTF::pageSize();
+
+ // Calculate the start of the page containing this region,
+ // and account for this extra memory within size.
+ intptr_t startPtr = reinterpret_cast<intptr_t>(start);
+ intptr_t pageStartPtr = startPtr & ~(pageSize - 1);
+ void* pageStart = reinterpret_cast<void*>(pageStartPtr);
+ size += (startPtr - pageStartPtr);
+
+ // Round size up
+ size += (pageSize - 1);
+ size &= ~(pageSize - 1);
+
+ mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX);
+}
+
+#endif
+
+}
+
+#endif // HAVE(ASSEMBLER)
diff --git a/Source/JavaScriptCore/jit/ExecutableAllocator.h b/Source/JavaScriptCore/jit/ExecutableAllocator.h
index 14be412..09b768b 100644
--- a/Source/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/Source/JavaScriptCore/jit/ExecutableAllocator.h
@@ -69,6 +69,11 @@
#if ENABLE(ASSEMBLER)
+#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
+class DemandExecutableAllocator;
+#endif
+
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
#if CPU(ARM)
static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
#elif CPU(ARM64)
@@ -85,6 +90,7 @@
#endif
extern uintptr_t startOfFixedExecutableMemoryPool;
+#endif
class ExecutableAllocator {
enum ProtectionSetting { Writable, Executable };
diff --git a/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
index f907efc..8d5018b 100644
--- a/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
+++ b/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
@@ -26,10 +26,10 @@
#include "config.h"
#include "ExecutableAllocator.h"
-#if ENABLE(ASSEMBLER)
-
#include "JSCInlines.h"
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
+
#include "CodeProfiling.h"
#include "ExecutableAllocationFuzz.h"
#include <errno.h>
@@ -223,4 +223,5 @@
}
-#endif
+
+#endif // ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
diff --git a/Source/JavaScriptCore/jit/JITStubRoutine.h b/Source/JavaScriptCore/jit/JITStubRoutine.h
index ad15da8..db9aaa7 100644
--- a/Source/JavaScriptCore/jit/JITStubRoutine.h
+++ b/Source/JavaScriptCore/jit/JITStubRoutine.h
@@ -103,15 +103,29 @@
static bool canPerformRangeFilter()
{
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
return true;
+#else
+ return false;
+#endif
}
static uintptr_t filteringStartAddress()
{
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
return startOfFixedExecutableMemoryPool;
+#else
+ UNREACHABLE_FOR_PLATFORM();
+ return 0;
+#endif
}
static size_t filteringExtentSize()
{
+#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
return fixedExecutableMemoryPoolSize;
+#else
+ UNREACHABLE_FOR_PLATFORM();
+ return 0;
+#endif
}
static bool passesFilter(uintptr_t address)
{
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index e5aea59..7fed4ba 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,20 @@
+2016-03-01 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r197226 and r197256.
+ https://bugs.webkit.org/show_bug.cgi?id=154910
+
+ Caused crashes on Mac 32-bit and on ARM (Requested by ap on
+ #webkit).
+
+ Reverted changesets:
+
+ "Remove the on demand executable allocator"
+ https://bugs.webkit.org/show_bug.cgi?id=154749
+ http://trac.webkit.org/changeset/197226
+
+ "CLoop build fix."
+ http://trac.webkit.org/changeset/197256
+
2016-03-01 Alex Christensen <achristensen@webkit.org>
Reduce size of internal windows build output
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index a34ca5c..b21faba 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -882,6 +882,16 @@
#define ENABLE_MASM_PROBE 0
#endif
+/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
+ On non-Windows x86-64, iOS, and ARM64 we use a single fixed mmap, on other platforms we mmap on demand. */
+#if ENABLE(ASSEMBLER)
+#if CPU(X86_64) || PLATFORM(IOS) || CPU(ARM64)
+#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
+#else
+#define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
+#endif
+#endif
+
/* CSS Selector JIT Compiler */
#if !defined(ENABLE_CSS_SELECTOR_JIT)
#if (CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(EFL))