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 <tvignatti@igalia.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Tiago Vignatti <tvignatti@igalia.com>
Cr-Commit-Position: refs/heads/main@{#85700}
This commit is contained in:
Tiago Vignatti 2023-02-06 15:21:21 -03:00 committed by V8 LUCI CQ
parent cdb12d8703
commit b445f6b13b
2 changed files with 7 additions and 7 deletions

View File

@ -542,7 +542,7 @@ static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1;
// to avoid pulling in large OS header files into this header file. Instead, // 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 // the users of these routines are expected to include the respecitve OS
// headers in addition to this one. // 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 // Convert between a shared memory handle and a mach_port_t referencing a memory
// entry object. // entry object.
inline PlatformSharedMemoryHandle SharedMemoryHandleFromMachMemoryEntry( inline PlatformSharedMemoryHandle SharedMemoryHandleFromMachMemoryEntry(

View File

@ -445,7 +445,7 @@ void OS::Free(void* address, size_t size) {
} }
// macOS specific implementation in platform-macos.cc. // macOS specific implementation in platform-macos.cc.
#if !defined(V8_OS_MACOS) #if !defined(V8_OS_DARWIN)
// static // static
void* OS::AllocateShared(void* hint, size_t size, MemoryPermission access, void* OS::AllocateShared(void* hint, size_t size, MemoryPermission access,
PlatformSharedMemoryHandle handle, uint64_t offset) { 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; if (result == MAP_FAILED) return nullptr;
return result; return result;
} }
#endif // !defined(V8_OS_MACOS) #endif // !defined(V8_OS_DARWIN)
// static // static
void OS::FreeShared(void* address, size_t size) { void OS::FreeShared(void* address, size_t size) {
@ -624,7 +624,7 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) {
} }
// macOS specific implementation in platform-macos.cc. // macOS specific implementation in platform-macos.cc.
#if !defined(V8_OS_MACOS) #if !defined(V8_OS_DARWIN)
// static // static
// Need to disable CFI_ICALL due to the indirect call to memfd_create. // Need to disable CFI_ICALL due to the indirect call to memfd_create.
DISABLE_CFI_ICALL DISABLE_CFI_ICALL
@ -657,7 +657,7 @@ void OS::DestroySharedMemoryHandle(PlatformSharedMemoryHandle handle) {
int fd = FileDescriptorFromSharedMemoryHandle(handle); int fd = FileDescriptorFromSharedMemoryHandle(handle);
CHECK_EQ(0, close(fd)); CHECK_EQ(0, close(fd));
} }
#endif // !defined(V8_OS_MACOS) #endif // !defined(V8_OS_DARWIN)
// static // static
bool OS::HasLazyCommits() { bool OS::HasLazyCommits() {
@ -1016,7 +1016,7 @@ bool AddressSpaceReservation::Free(void* address, size_t size) {
} }
// macOS specific implementation in platform-macos.cc. // 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, bool AddressSpaceReservation::AllocateShared(void* address, size_t size,
OS::MemoryPermission access, OS::MemoryPermission access,
PlatformSharedMemoryHandle handle, 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) != return mmap(address, size, prot, MAP_SHARED | MAP_FIXED, fd, offset) !=
MAP_FAILED; MAP_FAILED;
} }
#endif // !defined(V8_OS_MACOS) #endif // !defined(V8_OS_DARWIN)
bool AddressSpaceReservation::FreeShared(void* address, size_t size) { bool AddressSpaceReservation::FreeShared(void* address, size_t size) {
DCHECK(Contains(address, size)); DCHECK(Contains(address, size));