Skip to content

Commit 2efb6cf

Browse files
bnoordhuisisaacs
authored andcommitted
v8: reapply floating patches
1 parent 50624a5 commit 2efb6cf

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

deps/v8/build/common.gypi

-9
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,6 @@
454454
}],
455455
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
456456
or OS=="android"', {
457-
'cflags!': [
458-
'-O2',
459-
'-Os',
460-
],
461-
'cflags': [
462-
'-fdata-sections',
463-
'-ffunction-sections',
464-
'-O3',
465-
],
466457
'conditions': [
467458
[ 'gcc_version==44 and clang==0', {
468459
'cflags': [

deps/v8/src/platform-posix.cc

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

0 commit comments

Comments
 (0)