Commit 6dc56052 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[wasm] Introduce --liftoff-only flag

This flag disables the implicit fallback to Turbofan when
Liftoff bails out due to an unsupported instruction/type.
Instead, Liftoff bailouts are treated as fatal errors.

This is meant for testing; it is not (yet?) a configuration
we support in production.

Change-Id: I04e2045f1976e202e65da0ba8e8d660c47859bf4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584949Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71721}
parent 95f8ac49
......@@ -814,6 +814,11 @@ DEFINE_INT(trace_wasm_ast_start, 0,
DEFINE_INT(trace_wasm_ast_end, 0, "end function for wasm AST trace (exclusive)")
DEFINE_BOOL(liftoff, true,
"enable Liftoff, the baseline compiler for WebAssembly")
DEFINE_BOOL(liftoff_only, false,
"disallow Turbofan compilation for WebAssembly (for testing)")
DEFINE_IMPLICATION(liftoff_only, liftoff)
DEFINE_NEG_IMPLICATION(liftoff_only, wasm_tier_up)
DEFINE_NEG_IMPLICATION(fuzzing, liftoff_only)
DEFINE_BOOL(experimental_liftoff_extern_ref, false,
"enable support for externref in Liftoff")
// We can't tier up (from Liftoff to TurboFan) in single-threaded mode, hence
......
......@@ -269,10 +269,17 @@ struct Flag {
break;
case SetBy::kCommandLine:
if (new_set_by == SetBy::kImplication && check_command_line_flags) {
FATAL(
"Flag --%s is implied by --%s but also specified "
"explicitly.\n%s",
name(), implied_by, hint);
if (is_bool_flag) {
FATAL(
"Flag --%s: value implied by --%s conflicts with explicit "
"specification\n%s",
name(), implied_by, hint);
} else {
FATAL(
"Flag --%s is implied by --%s but also specified "
"explicitly.\n%s",
name(), implied_by, hint);
}
} else if (new_set_by == SetBy::kCommandLine &&
check_command_line_flags) {
if (is_bool_flag) {
......
......@@ -414,6 +414,10 @@ class LiftoffCompiler {
decoder->errorf(decoder->pc_offset(), "unsupported liftoff operation: %s",
detail);
UnuseLabels(decoder);
if (FLAG_liftoff_only) {
FATAL("--liftoff-only: treating bailout as fatal error. Cause: %s",
detail);
}
}
bool DidAssemblerBailout(FullDecoder* decoder) {
......
......@@ -196,6 +196,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteFunctionCompilation(
func_body, func_index_,
for_debugging_, counters, detected);
if (result.succeeded()) break;
// In --liftoff-only mode, we should have aborted the process
// on bailout, i.e. before getting here.
DCHECK(!FLAG_liftoff_only);
}
// If Liftoff failed, fall back to turbofan.
......
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