mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
build: fix pointer compression builds
- Remove usage of deprecated V8::InitializeSandbox(). - External code space and pointer compression shared cage must be enabled when pointer compression builds are enabled. - We cannot enable the sandbox because that requires allocating the array buffer backing stores in the sandbox - we currently have many backing stores tied to pointers from C++ land that are not even necessarily dynamic (e.g. in static storage). Until we manage to get rid of all those, sandbox cannot be enabled. Note that enabling pointer compression without enabling sandbox is unsupported by V8, and can be broken at any time. PR-URL: https://github.com/nodejs/node/pull/58171 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
d2c5e609ae
commit
c647aa4b30
@ -80,6 +80,7 @@
|
||||
'v8_enable_direct_local%': 0,
|
||||
'v8_enable_map_packing%': 0,
|
||||
'v8_enable_pointer_compression_shared_cage%': 0,
|
||||
'v8_enable_external_code_space%': 0,
|
||||
'v8_enable_sandbox%': 0,
|
||||
'v8_enable_v8_checks%': 0,
|
||||
'v8_enable_zone_compression%': 0,
|
||||
@ -114,6 +115,7 @@
|
||||
'v8_enable_pointer_compression': 0,
|
||||
'v8_enable_pointer_compression_shared_cage': 0,
|
||||
'v8_enable_31bit_smis_on_64bit_arch': 0,
|
||||
'v8_enable_external_code_space': 0,
|
||||
'v8_enable_sandbox': 0
|
||||
}],
|
||||
['target_arch in "ppc64 s390x"', {
|
||||
@ -424,6 +426,9 @@
|
||||
['v8_enable_sandbox == 1', {
|
||||
'defines': ['V8_ENABLE_SANDBOX',],
|
||||
}],
|
||||
['v8_enable_external_code_space == 1', {
|
||||
'defines': ['V8_EXTERNAL_CODE_SPACE',],
|
||||
}],
|
||||
['v8_deprecation_warnings == 1', {
|
||||
'defines': ['V8_DEPRECATION_WARNINGS',],
|
||||
}],
|
||||
|
||||
10
configure.py
10
configure.py
@ -1608,7 +1608,15 @@ def configure_v8(o):
|
||||
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
|
||||
o['variables']['v8_enable_maglev'] = 1 if options.v8_enable_maglev else 0
|
||||
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0
|
||||
# Using the sandbox requires always allocating array buffer backing stores in the sandbox.
|
||||
# We currently have many backing stores tied to pointers from C++ land that are not
|
||||
# even necessarily dynamic (e.g. in static storage) for fast communication between JS and C++.
|
||||
# Until we manage to get rid of all those, v8_enable_sandbox cannot be used.
|
||||
# Note that enabling pointer compression without enabling sandbox is unsupported by V8,
|
||||
# so this can be broken at any time.
|
||||
o['variables']['v8_enable_sandbox'] = 0
|
||||
o['variables']['v8_enable_pointer_compression_shared_cage'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression or options.disable_shared_ro_heap else 1
|
||||
o['variables']['v8_enable_extensible_ro_snapshot'] = 0
|
||||
|
||||
@ -20,9 +20,6 @@ void NodeTestEnvironment::SetUp() {
|
||||
NodeZeroIsolateTestFixture::platform.reset(
|
||||
new node::NodePlatform(kV8ThreadPoolSize, tracing_controller));
|
||||
v8::V8::InitializePlatform(NodeZeroIsolateTestFixture::platform.get());
|
||||
#ifdef V8_ENABLE_SANDBOX
|
||||
ASSERT_TRUE(v8::V8::InitializeSandbox());
|
||||
#endif
|
||||
cppgc::InitializeProcess(
|
||||
NodeZeroIsolateTestFixture::platform->GetPageAllocator());
|
||||
|
||||
|
||||
@ -253,6 +253,11 @@
|
||||
# Sets -DV8_ENABLE_SANDBOX.
|
||||
'v8_enable_sandbox%': 0,
|
||||
|
||||
# Enable support for external code range relative to the pointer compression
|
||||
# cage.
|
||||
# Sets -DV8_EXTERNAL_CODE_SPACE.
|
||||
'v8_enable_external_code_space%': 0,
|
||||
|
||||
# Experimental feature for collecting per-class zone memory stats.
|
||||
# Requires use_rtti = true
|
||||
'v8_enable_precise_zone_stats%': 0,
|
||||
@ -371,6 +376,9 @@
|
||||
['v8_enable_sandbox==1', {
|
||||
'defines': ['V8_ENABLE_SANDBOX',],
|
||||
}],
|
||||
['v8_enable_external_code_space==1', {
|
||||
'defines': ['V8_EXTERNAL_CODE_SPACE',],
|
||||
}],
|
||||
['v8_enable_object_print==1', {
|
||||
'defines': ['OBJECT_PRINT',],
|
||||
}],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user