Title: [286818] trunk/Source/WTF
Revision
286818
Author
[email protected]
Date
2021-12-09 16:47:37 -0800 (Thu, 09 Dec 2021)

Log Message

Unreviewed, reverting r286804.

Breaks internal builds.

Reverted changeset:

"Reduce maximum mmap size for Structure regions to help
placate ios"
https://bugs.webkit.org/show_bug.cgi?id=234091
https://commits.webkit.org/r286804

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (286817 => 286818)


--- trunk/Source/WTF/ChangeLog	2021-12-10 00:30:40 UTC (rev 286817)
+++ trunk/Source/WTF/ChangeLog	2021-12-10 00:47:37 UTC (rev 286818)
@@ -1,3 +1,16 @@
+2021-12-09  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r286804.
+
+        Breaks internal builds.
+
+        Reverted changeset:
+
+        "Reduce maximum mmap size for Structure regions to help
+        placate ios"
+        https://bugs.webkit.org/show_bug.cgi?id=234091
+        https://commits.webkit.org/r286804
+
 2021-12-09  Alex Christensen  <[email protected]>
 
         Prepare for transition to C++20

Modified: trunk/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp (286817 => 286818)


--- trunk/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp	2021-12-10 00:30:40 UTC (rev 286817)
+++ trunk/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp	2021-12-10 00:47:37 UTC (rev 286818)
@@ -38,7 +38,6 @@
 #if OS(DARWIN)
 #define MAP_EXECUTABLE_FOR_JIT MAP_JIT
 #define MAP_EXECUTABLE_FOR_JIT_WITH_JIT_CAGE MAP_JIT
-#include <wtf/spi/cocoa/MachVMSPI.h>
 #else // OS(DARWIN)
 #define MAP_EXECUTABLE_FOR_JIT 0
 #define MAP_EXECUTABLE_FOR_JIT_WITH_JIT_CAGE 0
@@ -74,37 +73,11 @@
     return result;
 }
 
+
+// FIXME: Make a smarter version of this for Linux flavors that have aligned mmap.
 void* OSAllocator::reserveUncommittedAligned(size_t bytes, Usage usage, bool writable, bool executable, bool jitCageEnabled, bool includesGuardPages)
 {
     ASSERT(hasOneBitSet(bytes) && bytes >= pageSize());
-
-#if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
-    UNUSED_PARAM(usage); // Not supported for mach API.
-    ASSERT_UNUSED(includesGuardPages, !includesGuardPages);
-    ASSERT_UNUSED(jitCageEnabled, !jitCageEnabled); // Not supported for mach API.
-    vm_prot_t protections = VM_PROT_READ;
-    if (writable)
-        protections |= VM_PROT_WRITE;
-    if (executable)
-        protections |= VM_PROT_EXECUTE;
-
-    const vm_inherit_t childProcessInheritance = VM_INHERIT_DEFAULT;
-
-    void* aligned = nullptr;
-    const bool copy = false;
-    const int flags = VM_FLAGS_ANYWHERE;
-
-    kern_return_t result = mach_vm_map(mach_task_self(), reinterpret_cast<mach_vm_address_t*>(&aligned), bytes, bytes - 1, flags, MEMORY_OBJECT_NULL, 0, copy, protections, protections, childProcessInheritance);
-    RELEASE_ASSERT(result == KERN_SUCCESS, result, bytes);
-#if HAVE(MADV_FREE_REUSE)
-    if (aligned) {
-        // To support the "reserve then commit" model, we have to initially decommit.
-        while (madvise(aligned, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
-    }
-#endif
-
-    return aligned;
-#else
     // Double the size so we can ensure enough mapped memory to get an aligned start.
     size_t mappedSize = bytes * 2;
     char* mapped = reinterpret_cast<char*>(reserveUncommitted(mappedSize, usage, writable, executable, jitCageEnabled, includesGuardPages));
@@ -122,7 +95,6 @@
         releaseDecommitted(alignedEnd, rightExtra);
 
     return aligned;
-#endif
 }
 
 void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bool executable, bool jitCageEnabled, bool includesGuardPages)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to