From b445f6b13b51684d2ff11aa04ad455152dbec5dd Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Mon, 6 Feb 2023 15:21:21 -0300 Subject: [PATCH] Build Mac conversion shared memory identifiers in iOS Bug: chromium:1411704 Change-Id: I2f8abe46ee915e3d03cc66dd46bb8905f0e8cf49 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4225996 Auto-Submit: Tiago Vignatti Reviewed-by: Michael Lippautz Commit-Queue: Tiago Vignatti Cr-Commit-Position: refs/heads/main@{#85700} --- include/v8-platform.h | 2 +- src/base/platform/platform-posix.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/v8-platform.h b/include/v8-platform.h index 32898e7ef9..a3fe8d24f7 100644 --- a/include/v8-platform.h +++ b/include/v8-platform.h @@ -542,7 +542,7 @@ static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1; // to avoid pulling in large OS header files into this header file. Instead, // the users of these routines are expected to include the respecitve OS // headers in addition to this one. -#if V8_OS_MACOS +#if V8_OS_DARWIN // Convert between a shared memory handle and a mach_port_t referencing a memory // entry object. inline PlatformSharedMemoryHandle SharedMemoryHandleFromMachMemoryEntry( diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc index 43e3268d11..2f7b0bf8e0 100644 --- a/src/base/platform/platform-posix.cc +++ b/src/base/platform/platform-posix.cc @@ -445,7 +445,7 @@ void OS::Free(void* address, size_t size) { } // macOS specific implementation in platform-macos.cc. -#if !defined(V8_OS_MACOS) +#if !defined(V8_OS_DARWIN) // static void* OS::AllocateShared(void* hint, size_t size, MemoryPermission access, PlatformSharedMemoryHandle handle, uint64_t offset) { @@ -456,7 +456,7 @@ void* OS::AllocateShared(void* hint, size_t size, MemoryPermission access, if (result == MAP_FAILED) return nullptr; return result; } -#endif // !defined(V8_OS_MACOS) +#endif // !defined(V8_OS_DARWIN) // static void OS::FreeShared(void* address, size_t size) { @@ -624,7 +624,7 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) { } // macOS specific implementation in platform-macos.cc. -#if !defined(V8_OS_MACOS) +#if !defined(V8_OS_DARWIN) // static // Need to disable CFI_ICALL due to the indirect call to memfd_create. DISABLE_CFI_ICALL @@ -657,7 +657,7 @@ void OS::DestroySharedMemoryHandle(PlatformSharedMemoryHandle handle) { int fd = FileDescriptorFromSharedMemoryHandle(handle); CHECK_EQ(0, close(fd)); } -#endif // !defined(V8_OS_MACOS) +#endif // !defined(V8_OS_DARWIN) // static bool OS::HasLazyCommits() { @@ -1016,7 +1016,7 @@ bool AddressSpaceReservation::Free(void* address, size_t size) { } // macOS specific implementation in platform-macos.cc. -#if !defined(V8_OS_MACOS) +#if !defined(V8_OS_DARWIN) bool AddressSpaceReservation::AllocateShared(void* address, size_t size, OS::MemoryPermission access, PlatformSharedMemoryHandle handle, @@ -1027,7 +1027,7 @@ bool AddressSpaceReservation::AllocateShared(void* address, size_t size, return mmap(address, size, prot, MAP_SHARED | MAP_FIXED, fd, offset) != MAP_FAILED; } -#endif // !defined(V8_OS_MACOS) +#endif // !defined(V8_OS_DARWIN) bool AddressSpaceReservation::FreeShared(void* address, size_t size) { DCHECK(Contains(address, size));