Set the minimum executable allocator size properly
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jan 2018 23:53:23 +0000 (23:53 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jan 2018 23:53:23 +0000 (23:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181816
<rdar://problem/36635533>

Reviewed by Saam Barati.

Executable allocator expects at least two page size's worth of
allocation in certain conditions, and that causes some tests to
now fail because they ask for less. Set that minimum correctly. We
were already rounding up to a page size, so having a minimum of 2
page sizes is fine.

* jit/ExecutableAllocator.cpp:
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/ExecutableAllocator.cpp

index 06b2114..15783e7 100644 (file)
@@ -1,3 +1,20 @@
+2018-01-18  JF Bastien  <jfbastien@apple.com>
+
+        Set the minimum executable allocator size properly
+        https://bugs.webkit.org/show_bug.cgi?id=181816
+        <rdar://problem/36635533>
+
+        Reviewed by Saam Barati.
+
+        Executable allocator expects at least two page size's worth of
+        allocation in certain conditions, and that causes some tests to
+        now fail because they ask for less. Set that minimum correctly. We
+        were already rounding up to a page size, so having a minimum of 2
+        page sizes is fine.
+
+        * jit/ExecutableAllocator.cpp:
+        (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
+
 2018-01-18  Michael Saboff  <msaboff@apple.com>
 
         Unreviewed build fix for Windows
index 7eecac7..ae5ccd5 100644 (file)
@@ -121,7 +121,7 @@ public:
             reservationSize = Options::jitMemoryReservationSize();
         else
             reservationSize = fixedExecutableMemoryPoolSize;
-        reservationSize = roundUpToMultipleOf(pageSize(), reservationSize);
+        reservationSize = std::max(roundUpToMultipleOf(pageSize(), reservationSize), pageSize() * 2);
         m_reservation = PageReservation::reserveWithGuardPages(reservationSize, OSAllocator::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
         if (m_reservation) {
             ASSERT(m_reservation.size() == reservationSize);