Commit 27771482 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[build] Introduce gn arg to disable WebAssembly

For now, that flag only avoid the installation of the 'WebAssembly'
global. Follow-up CLs will remove unneeded code from the binary if the gn
arg is not set to true.

R=ecmziegler@chromium.org, machenbach@chromium.org

Bug: v8:11238, v8:11344
Change-Id: Ie95b608ed12b0476470cb552138e369f863d249b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2646833
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarEmanuel Ziegler <ecmziegler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72296}
parent 5d1a7c64
...@@ -289,6 +289,11 @@ declare_args() { ...@@ -289,6 +289,11 @@ declare_args() {
# If enabled then macro definitions that are used in externally visible # If enabled then macro definitions that are used in externally visible
# header files are placed in a separate header file v8-gn.h. # header files are placed in a separate header file v8-gn.h.
v8_generate_external_defines_header = false v8_generate_external_defines_header = false
# Include support for WebAssembly. If disabled, the 'WebAssembly' global
# will not be available, and embedder APIs to generate WebAssembly modules
# will fail.
v8_enable_webassembly = true
} }
# Derived defaults. # Derived defaults.
...@@ -755,6 +760,9 @@ config("features") { ...@@ -755,6 +760,9 @@ config("features") {
if (v8_etw_guid != "") { if (v8_etw_guid != "") {
defines += [ "V8_ETW_GUID=\"$v8_etw_guid\"" ] defines += [ "V8_ETW_GUID=\"$v8_etw_guid\"" ]
} }
if (v8_enable_webassembly) {
defines += [ "V8_ENABLE_WEBASSEMBLY" ]
}
} }
config("toolchain") { config("toolchain") {
......
...@@ -782,7 +782,11 @@ DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS, ...@@ -782,7 +782,11 @@ DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS,
DEFINE_BOOL(wasm_generic_wrapper, true, DEFINE_BOOL(wasm_generic_wrapper, true,
"allow use of the generic js-to-wasm wrapper instead of " "allow use of the generic js-to-wasm wrapper instead of "
"per-signature wrappers") "per-signature wrappers")
#ifdef V8_ENABLE_WEBASSEMBLY
DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript") DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript")
#else
DEFINE_BOOL(expose_wasm, false, "expose wasm interface to JavaScript")
#endif
DEFINE_INT(wasm_num_compilation_tasks, 128, DEFINE_INT(wasm_num_compilation_tasks, 128,
"maximum number of parallel compilation tasks for wasm") "maximum number of parallel compilation tasks for wasm")
DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false, DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment