diff options
Diffstat (limited to 'deps/v8/src/base/platform/platform-posix.cc')
-rw-r--r-- | deps/v8/src/base/platform/platform-posix.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index cb25196970..c93974bcfc 100644 --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc @@ -86,7 +86,7 @@ namespace base { namespace { // 0 is never a valid thread id. -const pthread_t kNoThread = (pthread_t) 0; +const pthread_t kNoThread = static_cast<pthread_t>(0); bool g_hard_abort = false; @@ -254,10 +254,6 @@ void* OS::GetRandomMmapAddr() { // Little-endian Linux: 46 bits of virtual addressing. raw_addr &= uint64_t{0x3FFFFFFF0000}; #endif -#elif V8_TARGET_ARCH_MIPS64 - // We allocate code in 256 MB aligned segments because of optimizations using - // J instruction that require that all code is within a single 256 MB segment - raw_addr &= uint64_t{0x3FFFE0000000}; #elif V8_TARGET_ARCH_S390X // Linux on Z uses bits 22-32 for Region Indexing, which translates to 42 bits // of virtual addressing. Truncate to 40 bits to allow kernel chance to @@ -267,6 +263,10 @@ void* OS::GetRandomMmapAddr() { // 31 bits of virtual addressing. Truncate to 29 bits to allow kernel chance // to fulfill request. raw_addr &= 0x1FFFF000; +#elif V8_TARGET_ARCH_MIPS64 + // 42 bits of virtual addressing. Truncate to 40 bits to allow kernel chance + // to fulfill request. + raw_addr &= uint64_t{0xFFFFFF0000}; #else raw_addr &= 0x3FFFF000; @@ -313,7 +313,8 @@ void* OS::Allocate(void* address, size_t size, size_t alignment, // Unmap memory allocated before the aligned base address. uint8_t* base = static_cast<uint8_t*>(result); - uint8_t* aligned_base = RoundUp(base, alignment); + uint8_t* aligned_base = reinterpret_cast<uint8_t*>( + RoundUp(reinterpret_cast<uintptr_t>(base), alignment)); if (aligned_base != base) { DCHECK_LT(base, aligned_base); size_t prefix_size = static_cast<size_t>(aligned_base - base); |