Commit 807daee7 authored by Pierre Langlois's avatar Pierre Langlois Committed by Commit Bot

[arm64] Make sure hints passed to mmap are paged-aligned on 64K systems.

We already make sure hints are 16K aligned on the Mac. On linux, it's
possible to run with 64K pages enabled so we also need to align the
hint there.

Bug: v8:10808
Change-Id: I4ae7a56828135f6aa2980f164f25e2eb932b3cc0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2369176Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#69554}
parent d77e12bc
......@@ -270,9 +270,13 @@ void* OS::GetRandomMmapAddr() {
MutexGuard guard(rng_mutex.Pointer());
GetPlatformRandomNumberGenerator()->NextBytes(&raw_addr, sizeof(raw_addr));
}
#if defined(__APPLE__) && V8_TARGET_ARCH_ARM64
#if V8_TARGET_ARCH_ARM64
#if defined(__APPLE__)
DCHECK_EQ(1 << 14, AllocatePageSize());
raw_addr = RoundDown(raw_addr, 1 << 14);
#endif
// Keep the address page-aligned, AArch64 supports 4K, 16K and 64K
// configurations.
raw_addr = RoundDown(raw_addr, AllocatePageSize());
#endif
#if defined(V8_USE_ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
defined(THREAD_SANITIZER) || defined(LEAK_SANITIZER)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment