/
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
46 lines (42 loc) · 1.53 KB
/
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Tue, 10 Dec 2019 15:02:21 -0800
Subject: enable 31 bit smis on 64bit arch and ptr compression
This aligns with the defaults set on the Chromium build. Without this, native
node modules will have different (wrong) ideas about how v8 structs are laid
out in memory on 64-bit machines, and will summarily fail to work.
diff --git a/common.gypi b/common.gypi
index 572597ef60c13dfc332c7da49b606867f0561c54..db8dc7452552beb6a758d1b6175bd402b6a09d24 100644
--- a/common.gypi
+++ b/common.gypi
@@ -71,6 +71,9 @@
# TODO(refack): make v8-perfetto happen
'v8_use_perfetto': 0,
+ 'v8_enable_pointer_compression%': 0,
+ 'v8_enable_31bit_smis_on_64bit_arch': 1,
+
##### end V8 defaults #####
# When building native modules using 'npm install' with the system npm,
@@ -148,6 +151,9 @@
['OS=="mac"', {
'clang%': 1,
}],
+ ['target_arch == "arm64" or target_arch == "x64"', {
+ 'v8_enable_pointer_compression': 1,
+ }],
['target_arch in "ppc64 s390x"', {
'v8_enable_backtrace': 1,
}],
@@ -378,6 +384,12 @@
}],
],
}],
+ ['v8_enable_pointer_compression == 1', {
+ 'defines': ['V8_COMPRESS_POINTERS'],
+ }],
+ ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
+ 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
+ }],
['OS == "win"', {
'defines': [
'WIN32',