| Index: src/platform-posix.cc
|
| diff --git a/src/platform-posix.cc b/src/platform-posix.cc
|
| index 62fae90e20aafd6e6bf5222b0b5bcaa6b1c45b4b..a6ebf79bb0c9d0a0d7390c732ea1a3bd40eaa052 100644
|
| --- a/src/platform-posix.cc
|
| +++ b/src/platform-posix.cc
|
| @@ -69,6 +69,7 @@
|
| #include "v8.h"
|
|
|
| #include "codegen.h"
|
| +#include "isolate-inl.h"
|
| #include "platform.h"
|
|
|
| namespace v8 {
|
| @@ -152,7 +153,7 @@ void OS::ProtectCode(void* address, const size_t size) {
|
| void OS::Guard(void* address, const size_t size) {
|
| #if defined(__CYGWIN__)
|
| DWORD oldprotect;
|
| - VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect);
|
| + VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect);
|
| #else
|
| mprotect(address, size, PROT_NONE);
|
| #endif
|
| @@ -171,17 +172,14 @@ void* OS::GetRandomMmapAddr() {
|
| // CpuFeatures::Probe. We don't care about randomization in this case because
|
| // the code page is immediately freed.
|
| if (isolate != NULL) {
|
| + uintptr_t raw_addr;
|
| + isolate->random_number_generator()->NextBytes(&raw_addr, sizeof(raw_addr));
|
| #if V8_TARGET_ARCH_X64
|
| - uint64_t rnd1 = V8::RandomPrivate(isolate);
|
| - uint64_t rnd2 = V8::RandomPrivate(isolate);
|
| - uint64_t raw_addr = (rnd1 << 32) ^ rnd2;
|
| // Currently available CPUs have 48 bits of virtual addressing. Truncate
|
| // the hint address to 46 bits to give the kernel a fighting chance of
|
| // fulfilling our placement request.
|
| raw_addr &= V8_UINT64_C(0x3ffffffff000);
|
| #else
|
| - uint32_t raw_addr = V8::RandomPrivate(isolate);
|
| -
|
| raw_addr &= 0x3ffff000;
|
|
|
| # ifdef __sun
|
|
|