Commit 05265d88 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[no-wasm][flags] Remove wasm flags

This removes all wasm-related flags in no-wasm builds.
We could have made them read-only, but fully removing them actually
forces us to consider the no-wasm case at every use site, which often
hints at further cleanups.

R=jkummerow@chromium.org

Bug: v8:11238
Change-Id: Ic140031a2732975b2a46116a58e26fe49f1f7c8c
Cq-Include-Trybots: luci.v8.try:v8_linux64_no_wasm_compile_rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2759518
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73420}
parent 6906be2c
......@@ -5878,7 +5878,9 @@ void V8::GetSharedMemoryStatistics(SharedMemoryStatistics* statistics) {
void V8::SetIsCrossOriginIsolated() {
i::FLAG_harmony_sharedarraybuffer = true;
#if V8_ENABLE_WEBASSEMBLY
i::FLAG_experimental_wasm_threads = true;
#endif // V8_ENABLE_WEBASSEMBLY
}
template <typename ObjectType>
......
......@@ -123,8 +123,10 @@ bool OSHasAVXSupport() {
} // namespace
bool CpuFeatures::SupportsWasmSimd128() {
#if V8_ENABLE_WEBASSEMBLY
if (IsSupported(SSE4_1)) return true;
if (FLAG_wasm_simd_ssse3_codegen && IsSupported(SSSE3)) return true;
#endif // V8_ENABLE_WEBASSEMBLY
return false;
}
......
......@@ -72,8 +72,10 @@ bool OSHasAVXSupport() {
} // namespace
bool CpuFeatures::SupportsWasmSimd128() {
#if V8_ENABLE_WEBASSEMBLY
if (IsSupported(SSE4_1)) return true;
if (FLAG_wasm_simd_ssse3_codegen && IsSupported(SSSE3)) return true;
#endif // V8_ENABLE_WEBASSEMBLY
return false;
}
......
......@@ -2546,19 +2546,27 @@ void Isolate::SetAbortOnUncaughtExceptionCallback(
}
bool Isolate::IsWasmSimdEnabled(Handle<Context> context) {
#if V8_ENABLE_WEBASSEMBLY
if (wasm_simd_enabled_callback()) {
v8::Local<v8::Context> api_context = v8::Utils::ToLocal(context);
return wasm_simd_enabled_callback()(api_context);
}
return FLAG_experimental_wasm_simd;
#else
return false;
#endif // V8_ENABLE_WEBASSEMBLY
}
bool Isolate::AreWasmExceptionsEnabled(Handle<Context> context) {
#if V8_ENABLE_WEBASSEMBLY
if (wasm_exceptions_enabled_callback()) {
v8::Local<v8::Context> api_context = v8::Utils::ToLocal(context);
return wasm_exceptions_enabled_callback()(api_context);
}
return FLAG_experimental_wasm_eh;
#else
return false;
#endif // V8_ENABLE_WEBASSEMBLY
}
Handle<Context> Isolate::GetIncumbentContext() {
......
......@@ -448,9 +448,6 @@ DEFINE_IMPLICATION(jitless, regexp_interpret_all)
DEFINE_NEG_IMPLICATION(jitless, sparkplug)
DEFINE_NEG_IMPLICATION(jitless, always_sparkplug)
#endif
// asm.js validation is disabled since it triggers wasm code generation.
DEFINE_NEG_IMPLICATION(jitless, validate_asm)
// --jitless also implies --no-expose-wasm, see InitializeOncePerProcessImpl.
#ifndef V8_TARGET_ARCH_ARM
// Unsupported on arm. See https://crbug.com/v8/8713.
......@@ -824,17 +821,16 @@ DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS,
"Enable mitigations for executing untrusted code")
#undef V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS
// Flags for native WebAssembly.
// Flags for WebAssembly.
#if V8_ENABLE_WEBASSEMBLY
DEFINE_BOOL(wasm_generic_wrapper, true,
"allow use of the generic js-to-wasm wrapper instead of "
"per-signature wrappers")
#ifdef V8_ENABLE_WEBASSEMBLY
DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript")
#else
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")
DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0)
DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
"trace wasm native heap events")
DEFINE_BOOL(wasm_write_protect_code_memory, false,
......@@ -843,6 +839,7 @@ DEFINE_DEBUG_BOOL(trace_wasm_serialization, false,
"trace serialization/deserialization")
DEFINE_BOOL(wasm_async_compilation, true,
"enable actual asynchronous compilation for WebAssembly.compile")
DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation)
DEFINE_BOOL(wasm_test_streaming, false,
"use streaming compilation instead of async compilation for tests")
DEFINE_UINT(wasm_max_mem_pages, v8::internal::wasm::kSpecMaxMemoryPages,
......@@ -890,6 +887,9 @@ DEFINE_INT(wasm_tier_mask_for_testing, 0,
"bitmask of functions to compile with TurboFan instead of Liftoff")
DEFINE_BOOL(validate_asm, true, "validate asm.js modules before compiling")
// asm.js validation is disabled since it triggers wasm code generation.
// --jitless also implies --no-expose-wasm, see InitializeOncePerProcessImpl.
DEFINE_NEG_IMPLICATION(jitless, validate_asm)
DEFINE_BOOL(suppress_asm_messages, false,
"don't emit asm.js related messages (for golden file testing)")
DEFINE_BOOL(trace_asm_time, false, "print asm.js timing info to the console")
......@@ -969,6 +969,28 @@ DEFINE_INT(wasm_max_initial_code_space_reservation, 0,
DEFINE_BOOL(experimental_wasm_allow_huge_modules, false,
"allow wasm modules bigger than 1GB, but below ~2GB")
DEFINE_BOOL(trace_wasm, false, "trace wasm function calls")
// Flags for Wasm GDB remote debugging.
#ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
#define DEFAULT_WASM_GDB_REMOTE_PORT 8765
DEFINE_BOOL(wasm_gdb_remote, false,
"enable GDB-remote for WebAssembly debugging")
DEFINE_NEG_IMPLICATION(wasm_gdb_remote, wasm_tier_up)
DEFINE_INT(wasm_gdb_remote_port, DEFAULT_WASM_GDB_REMOTE_PORT,
"default port for WebAssembly debugging with LLDB.")
DEFINE_BOOL(wasm_pause_waiting_for_debugger, false,
"pause at the first Webassembly instruction waiting for a debugger "
"to attach")
DEFINE_BOOL(trace_wasm_gdb_remote, false, "trace Webassembly GDB-remote server")
#endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
// wasm instance management
DEFINE_DEBUG_BOOL(trace_wasm_instances, false,
"trace creation and collection of wasm instances")
#endif // V8_ENABLE_WEBASSEMBLY
DEFINE_INT(stress_sampling_allocation_profiler, 0,
"Enables sampling allocation profiler with X as a sample interval")
......@@ -1311,7 +1333,6 @@ DEFINE_NEG_NEG_IMPLICATION(inline_new, turbo_allocation_folding)
// codegen-ia32.cc / codegen-arm.cc
DEFINE_BOOL(trace, false, "trace javascript function calls")
DEFINE_BOOL(trace_wasm, false, "trace wasm function calls")
// codegen.cc
DEFINE_BOOL(lazy, true, "use lazy compilation")
......@@ -1643,19 +1664,6 @@ DEFINE_BOOL(multi_mapped_mock_allocator, false,
"Use a multi-mapped mock ArrayBuffer allocator for testing.")
#endif
// Flags for Wasm GDB remote debugging.
#ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
#define DEFAULT_WASM_GDB_REMOTE_PORT 8765
DEFINE_BOOL(wasm_gdb_remote, false,
"enable GDB-remote for WebAssembly debugging")
DEFINE_NEG_IMPLICATION(wasm_gdb_remote, wasm_tier_up)
DEFINE_INT(wasm_gdb_remote_port, DEFAULT_WASM_GDB_REMOTE_PORT,
"default port for WebAssembly debugging with LLDB.")
DEFINE_BOOL(wasm_pause_waiting_for_debugger, false,
"pause at the first Webassembly instruction waiting for a debugger "
"to attach")
#endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
//
// GDB JIT integration flags.
//
......@@ -1734,14 +1742,6 @@ DEFINE_BOOL(regexp_possessive_quantifier, false,
// Debugger
DEFINE_BOOL(print_break_location, false, "print source location on debug break")
// wasm instance management
DEFINE_DEBUG_BOOL(trace_wasm_instances, false,
"trace creation and collection of wasm instances")
#ifdef V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
DEFINE_BOOL(trace_wasm_gdb_remote, false, "trace Webassembly GDB-remote server")
#endif // V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING
//
// Logging and profiling flags
//
......@@ -1827,7 +1827,9 @@ DEFINE_PERF_PROF_BOOL(
DEFINE_NEG_IMPLICATION(perf_prof, compact_code_space)
// TODO(v8:8462) Remove implication once perf supports remapping.
DEFINE_NEG_IMPLICATION(perf_prof, write_protect_code_memory)
#if V8_ENABLE_WEBASSEMBLY
DEFINE_NEG_IMPLICATION(perf_prof, wasm_write_protect_code_memory)
#endif // V8_ENABLE_WEBASSEMBLY
// --perf-prof-unwinding-info is available only on selected architectures.
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \
......@@ -1924,8 +1926,6 @@ DEFINE_IMPLICATION(print_all_code, print_regexp_code)
DEFINE_BOOL(predictable, false, "enable predictable mode")
DEFINE_IMPLICATION(predictable, single_threaded)
DEFINE_NEG_IMPLICATION(predictable, memory_reducer)
DEFINE_VALUE_IMPLICATION(single_threaded, wasm_num_compilation_tasks, 0)
DEFINE_NEG_IMPLICATION(single_threaded, wasm_async_compilation)
DEFINE_BOOL(predictable_gc_schedule, false,
"Predictable garbage collection schedule. Fixes heap growing, "
......
......@@ -20,7 +20,10 @@
#include "src/utils/memcopy.h"
#include "src/utils/ostreams.h"
#include "src/utils/utils.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/wasm-limits.h"
#endif // V8_ENABLE_WEBASSEMBLY
namespace v8 {
namespace internal {
......
......@@ -8,7 +8,6 @@
#include <vector>
#include "src/common/globals.h"
#include "src/wasm/wasm-limits.h"
namespace v8 {
namespace internal {
......
......@@ -127,13 +127,11 @@ void V8::InitializeOncePerProcessImpl() {
// continue exposing wasm on correctness fuzzers even in jitless mode.
// TODO(jgruber): Remove this once / if wasm can run without executable
// memory.
if (FLAG_jitless && !FLAG_correctness_fuzzer_suppressions) {
#if V8_ENABLE_WEBASSEMBLY
if (FLAG_jitless && !FLAG_correctness_fuzzer_suppressions) {
FLAG_expose_wasm = false;
#else
STATIC_ASSERT(!FLAG_expose_wasm);
#endif
}
#endif
if (FLAG_regexp_interpret_all && FLAG_regexp_tier_up) {
// Turning off the tier-up strategy, because the --regexp-interpret-all and
......
......@@ -202,9 +202,11 @@ TEST(FlagsJitlessImplications) {
// fairly primitive and can break easily depending on the implication
// definition order in flag-definitions.h.
CHECK(!FLAG_opt);
#if V8_ENABLE_WEBASSEMBLY
CHECK(!FLAG_validate_asm);
CHECK(!FLAG_asm_wasm_lazy_compilation);
CHECK(!FLAG_wasm_lazy_compilation);
#endif // V8_ENABLE_WEBASSEMBLY
}
}
......
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