Commit 9914f26d authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Allow --trace-liftoff without --trace-wasm-decoder

There is not really a reason to guard the first by the latter. Just emit
a hint if --trace-liftoff is used without --trace-wasm-decoder, but
still make it work.
Also, used DEFINE_DEBUG_BOOL instead of guarding the output by another
"#ifdef DEBUG".

R=ahaas@chromium.org

Change-Id: Ia7d3f504df92779447877612e98b9c2a847b9f6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011828Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65894}
parent c46a41fa
......@@ -699,8 +699,8 @@ DEFINE_BOOL(liftoff, false,
"enable Liftoff, the baseline compiler for WebAssembly")
DEFINE_IMPLICATION(future, liftoff)
#endif
DEFINE_BOOL(trace_liftoff, false,
"trace Liftoff, the baseline compiler for WebAssembly")
DEFINE_DEBUG_BOOL(trace_liftoff, false,
"trace Liftoff, the baseline compiler for WebAssembly")
DEFINE_BOOL(trace_wasm_memory, false,
"print all memory updates performed in wasm code")
// Fuzzers use {wasm_tier_mask_for_testing} together with {liftoff} and
......
......@@ -388,6 +388,10 @@ class LiftoffCompiler {
}
void StartFunction(FullDecoder* decoder) {
if (FLAG_trace_liftoff && !FLAG_trace_wasm_decoder) {
StdoutStream{} << "hint: add --trace-wasm-decoder to also see the wasm "
"instructions being decoded\n";
}
int num_locals = decoder->num_locals();
__ set_num_locals(num_locals);
for (int i = 0; i < num_locals; ++i) {
......@@ -2368,8 +2372,7 @@ class LiftoffCompiler {
}
void TraceCacheState(FullDecoder* decoder) const {
#ifdef DEBUG
if (!FLAG_trace_liftoff || !FLAG_trace_wasm_decoder) return;
if (!FLAG_trace_liftoff) return;
StdoutStream os;
for (int control_depth = decoder->control_depth() - 1; control_depth >= -1;
--control_depth) {
......@@ -2381,7 +2384,6 @@ class LiftoffCompiler {
if (control_depth != -1) PrintF("; ");
}
os << "\n";
#endif
}
DISALLOW_IMPLICIT_CONSTRUCTORS(LiftoffCompiler);
......
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