summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-04-08 20:34:11 +0200
committerTrevor Norris <trev.norris@gmail.com>2013-05-22 13:14:43 -0700
commite761ac2306e9d82a75e31156ccf96262c96403a9 (patch)
tree23241da7d9239a97f01e602b923e0e6747409de9 /deps
parent506fc4de1e820d97b637f6e01dda2ab97667efa7 (diff)
downloadandroid-node-v8-e761ac2306e9d82a75e31156ccf96262c96403a9.tar.gz
android-node-v8-e761ac2306e9d82a75e31156ccf96262c96403a9.tar.bz2
android-node-v8-e761ac2306e9d82a75e31156ccf96262c96403a9.zip
v8: reapply floating patches
Diffstat (limited to 'deps')
-rw-r--r--deps/v8/build/common.gypi9
-rw-r--r--deps/v8/src/platform-posix.cc17
2 files changed, 16 insertions, 10 deletions
diff --git a/deps/v8/build/common.gypi b/deps/v8/build/common.gypi
index 2e3c7854d5..ad6ccdf973 100644
--- a/deps/v8/build/common.gypi
+++ b/deps/v8/build/common.gypi
@@ -453,15 +453,6 @@
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
or OS=="android"', {
- 'cflags!': [
- '-O2',
- '-Os',
- ],
- 'cflags': [
- '-fdata-sections',
- '-ffunction-sections',
- '-O3',
- ],
'conditions': [
[ 'gcc_version==44 and clang==0', {
'cflags': [
diff --git a/deps/v8/src/platform-posix.cc b/deps/v8/src/platform-posix.cc
index f76ec44332..054d5b5a50 100644
--- a/deps/v8/src/platform-posix.cc
+++ b/deps/v8/src/platform-posix.cc
@@ -115,11 +115,26 @@ void* OS::GetRandomMmapAddr() {
raw_addr &= V8_UINT64_C(0x3ffffffff000);
#else
uint32_t raw_addr = V8::RandomPrivate(isolate);
+
+ raw_addr &= 0x3ffff000;
+
+# ifdef __sun
+ // For our Solaris/illumos mmap hint, we pick a random address in the bottom
+ // half of the top half of the address space (that is, the third quarter).
+ // Because we do not MAP_FIXED, this will be treated only as a hint -- the
+ // system will not fail to mmap() because something else happens to already
+ // be mapped at our random address. We deliberately set the hint high enough
+ // to get well above the system's break (that is, the heap); Solaris and
+ // illumos will try the hint and if that fails allocate as if there were
+ // no hint at all. The high hint prevents the break from getting hemmed in
+ // at low values, ceding half of the address space to the system heap.
+ raw_addr += 0x80000000;
+# else
// The range 0x20000000 - 0x60000000 is relatively unpopulated across a
// variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos
// 10.6 and 10.7.
- raw_addr &= 0x3ffff000;
raw_addr += 0x20000000;
+# endif
#endif
return reinterpret_cast<void*>(raw_addr);
}