Skip to content

Commit 7357bcb

Browse files
committed
v8: reapply floating patches
1 parent 587e83c commit 7357bcb

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

deps/v8/build/common.gypi

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,6 @@
409409
}],
410410
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
411411
or OS=="android"', {
412-
'cflags!': [
413-
'-O2',
414-
'-Os',
415-
],
416-
'cflags': [
417-
'-fdata-sections',
418-
'-ffunction-sections',
419-
'-O3',
420-
],
421412
'conditions': [
422413
[ 'gcc_version==44 and clang==0', {
423414
'cflags': [

deps/v8/src/platform-posix.cc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,26 @@ void* OS::GetRandomMmapAddr() {
109109
raw_addr &= V8_UINT64_C(0x3ffffffff000);
110110
#else
111111
uint32_t raw_addr = V8::RandomPrivate(isolate);
112+
113+
raw_addr &= 0x3ffff000;
114+
115+
# ifdef __sun
116+
// For our Solaris/illumos mmap hint, we pick a random address in the bottom
117+
// half of the top half of the address space (that is, the third quarter).
118+
// Because we do not MAP_FIXED, this will be treated only as a hint -- the
119+
// system will not fail to mmap() because something else happens to already
120+
// be mapped at our random address. We deliberately set the hint high enough
121+
// to get well above the system's break (that is, the heap); Solaris and
122+
// illumos will try the hint and if that fails allocate as if there were
123+
// no hint at all. The high hint prevents the break from getting hemmed in
124+
// at low values, ceding half of the address space to the system heap.
125+
raw_addr += 0x80000000;
126+
# else
112127
// The range 0x20000000 - 0x60000000 is relatively unpopulated across a
113128
// variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos
114129
// 10.6 and 10.7.
115-
raw_addr &= 0x3ffff000;
116130
raw_addr += 0x20000000;
131+
# endif
117132
#endif
118133
return reinterpret_cast<void*>(raw_addr);
119134
}

0 commit comments

Comments
 (0)