Skip to content

build: fix pointer compression builds #58171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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,
Expand Down Expand Up @@ -115,6 +116,7 @@
['target_arch in "arm ia32 mips mipsel"', {
'v8_enable_pointer_compression': 0,
'v8_enable_31bit_smis_on_64bit_arch': 0,
'v8_enable_external_code_space': 0,
'v8_enable_sandbox': 0
}],
['target_arch in "ppc64 s390x"', {
Expand Down Expand Up @@ -455,6 +457,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',],
}],
Expand Down
10 changes: 9 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,15 @@ def configure_v8(o, configs):
o['variables']['v8_enable_maglev'] = B(not options.v8_disable_maglev and
o['variables']['target_arch'] in maglev_enabled_architectures)
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_extensible_ro_snapshot'] = 0
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
Expand Down
3 changes: 0 additions & 3 deletions test/cctest/node_test_fixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,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());

Expand Down
2 changes: 1 addition & 1 deletion test/wasm-allocation/wasm-allocation.status
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ prefix wasm-allocation

[true] # This section applies to all platforms

[$system!=linux || $asan==on]
[$system!=linux || $asan==on || $pointer_compression==on]
test-wasm-allocation: SKIP
4 changes: 4 additions & 0 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,9 @@ def get_asan_state(vm, context):
asan = Execute([vm, '-p', 'process.config.variables.asan'], context).stdout.strip()
return "on" if asan == "1" else "off"

def get_pointer_compression_state(vm, context):
pointer_compression = Execute([vm, '-p', 'process.config.variables.v8_enable_pointer_compression'], context).stdout.strip()
return "on" if pointer_compression == "1" else "off"

def Main():
parser = BuildOptions()
Expand Down Expand Up @@ -1717,6 +1720,7 @@ def Main():
'arch': vmArch,
'type': get_env_type(vm, options.type, context),
'asan': get_asan_state(vm, context),
'pointer_compression': get_pointer_compression_state(vm, context),
}
test_list = root.ListTests([], path, context, arch, mode)
unclassified_tests += test_list
Expand Down
8 changes: 8 additions & 0 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,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,
Expand Down Expand Up @@ -380,6 +385,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',],
}],
Expand Down
Loading