Commit 96bfcfb8 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[no-wasm] Make --expose-wasm flag readonly

If webassembly is disabled via a gn arg, we will not be able to enable
it via command-line switch. Hence make this flag read-only in that
configuration.

R=ecmziegler@chromium.org

Bug: v8:11238
Change-Id: Ib93a55f74d4f018477f110b8b52aa9b645e86553
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2710426Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarEmanuel Ziegler <ecmziegler@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72905}
parent 2e844377
......@@ -829,7 +829,7 @@ DEFINE_BOOL(wasm_generic_wrapper, true,
#ifdef V8_ENABLE_WEBASSEMBLY
DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript")
#else
DEFINE_BOOL(expose_wasm, false, "expose wasm interface to JavaScript")
DEFINE_BOOL_READONLY(expose_wasm, false, "expose wasm interface to JavaScript")
#endif
DEFINE_INT(wasm_num_compilation_tasks, 128,
"maximum number of parallel compilation tasks for wasm")
......
......@@ -119,7 +119,11 @@ void V8::InitializeOncePerProcessImpl() {
// TODO(jgruber): Remove this once / if wasm can run without executable
// memory.
if (FLAG_jitless && !FLAG_correctness_fuzzer_suppressions) {
#if V8_ENABLE_WEBASSEMBLY
FLAG_expose_wasm = false;
#else
STATIC_ASSERT(!FLAG_expose_wasm);
#endif
}
if (FLAG_regexp_interpret_all && FLAG_regexp_tier_up) {
......
......@@ -2480,6 +2480,7 @@ TEST_F(ValueSerializerTestWithHostArrayBufferView, RoundTripUint8ArrayInput) {
ExpectScriptTrue("result.a === result.b");
}
#if V8_ENABLE_WEBASSEMBLY
// It's expected that WebAssembly has more exhaustive tests elsewhere; this
// mostly checks that the logic to embed it in structured clone serialization
// works correctly.
......@@ -2731,6 +2732,7 @@ TEST_F(ValueSerializerTestWithWasm, ComplexObjectWithManyTransfer) {
VerifyComplexObject(value);
ExpectScriptTrue("result.mod1 != result.mod2");
}
#endif // V8_ENABLE_WEBASSEMBLY
class ValueSerializerTestWithLimitedMemory : public ValueSerializerTest {
protected:
......
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