Skip to content

Commit cc6a3b7

Browse files
committed
build: enable V8's shared read-only heap
nodejs/node#42809
1 parent 5cf549b commit cc6a3b7

2 files changed

+14
-14
lines changed

patches/node/build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ index a80b57fbba17b5025351ef41dd83f62832bbd781..8441a5270212af7e4643e6b4ee100a22
4040
'defines': [
4141
'V8_COMPRESS_POINTERS',
4242
diff --git a/configure.py b/configure.py
43-
index 08894bf3908916d1cb639810c5e1b2afae74ff4d..19cbde58df38009258db145c5f7dbe73b0dc5cdf 100755
43+
index 1b7a721585764aecfd855ee47c47a3bd235d2ef3..c152ea9f29478729ec3752132140e3ec44dbd366 100755
4444
--- a/configure.py
4545
+++ b/configure.py
46-
@@ -1447,6 +1447,7 @@ def configure_library(lib, output, pkgname=None):
46+
@@ -1464,6 +1464,7 @@ def configure_library(lib, output, pkgname=None):
4747

4848

4949
def configure_v8(o):
5050
+ o['variables']['using_electron_config_gypi'] = 1
5151
o['variables']['v8_enable_webassembly'] = 1
52+
o['variables']['v8_enable_javascript_promise_hooks'] = 1
5253
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
53-
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
54+
5455
diff --git a/src/node.h b/src/node.h
5556
index b6a26f8adf11959f94a00de0cbf9016fcc8707cb..38bbb20968772a4ba6bceddb04a83589f8582fc8 100644
5657
--- a/src/node.h

patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Aligns common.gypi with the current build flag state of //v8.
88
Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`.
99

1010
diff --git a/common.gypi b/common.gypi
11-
index fcd55b95b44050e4d88eeb0d3100ba6e6a5d5e78..a80b57fbba17b5025351ef41dd83f62832bbd781 100644
11+
index 4fd15f8e80ba82f69aa651a78dd4d567b5e34c5d..d92f1daeb4fd78c4ec66ace0102b09db118f779a 100644
1212
--- a/common.gypi
1313
+++ b/common.gypi
1414
@@ -65,6 +65,7 @@
@@ -17,17 +17,17 @@ index fcd55b95b44050e4d88eeb0d3100ba6e6a5d5e78..a80b57fbba17b5025351ef41dd83f628
1717
'v8_enable_31bit_smis_on_64bit_arch%': 0,
1818
+ 'v8_enable_sandbox%': 0,
1919

20-
# Disable V8 untrusted code mitigations.
21-
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
22-
@@ -132,6 +133,7 @@
20+
# Disable v8 hugepage by default.
21+
'v8_enable_hugepage%': 0,
22+
@@ -125,6 +126,7 @@
2323
['target_arch in "arm ia32 mips mipsel ppc"', {
2424
'v8_enable_pointer_compression': 0,
2525
'v8_enable_31bit_smis_on_64bit_arch': 0,
2626
+ 'v8_enable_sandbox': 0,
2727
}],
2828
['target_arch in "ppc64 s390x"', {
2929
'v8_enable_backtrace': 1,
30-
@@ -396,9 +398,14 @@
30+
@@ -395,9 +397,12 @@
3131
['v8_enable_pointer_compression == 1', {
3232
'defines': [
3333
'V8_COMPRESS_POINTERS',
@@ -36,22 +36,21 @@ index fcd55b95b44050e4d88eeb0d3100ba6e6a5d5e78..a80b57fbba17b5025351ef41dd83f628
3636
],
3737
}],
3838
+ ['v8_enable_sandbox == 1', {
39-
+ 'defines': [
40-
+ 'V8_ENABLE_SANDBOX',
41-
+ ]
39+
+ 'defines': ['V8_ENABLE_SANDBOX']
4240
+ }],
4341
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
4442
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
4543
}],
4644
diff --git a/configure.py b/configure.py
47-
index 1a7023dece588631b8281c67b223204c1ebb5ee7..08894bf3908916d1cb639810c5e1b2afae74ff4d 100755
45+
index a4e5723067f286d4a836f329d0049b6bbaac9419..1b7a721585764aecfd855ee47c47a3bd235d2ef3 100755
4846
--- a/configure.py
4947
+++ b/configure.py
50-
@@ -1459,6 +1459,7 @@ def configure_v8(o):
48+
@@ -1477,6 +1477,7 @@ def configure_v8(o):
5149
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
5250
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
5351
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
5452
+ o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0
53+
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression else 1
5554
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
5655
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
57-
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
56+

0 commit comments

Comments
 (0)