Commit e253d974 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Remove --trace-wasm-decode-time flag

This seems like a very specific flag which is rarely used. It not only
adds local overhead, but also requires an additional parameter at
{BuildGraphForWasmFunction}.
Thus this CL removes it completely. Interested parties can still measure
timing locally.

R=titzer@chromium.org

Bug: v8:9183
Change-Id: I5f152cdb9456d1001ed38722d44c71cf5ae44ae3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631420Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61858}
parent 9a50c84f
......@@ -6389,14 +6389,9 @@ bool BuildGraphForWasmFunction(AccountingAllocator* allocator,
wasm::CompilationEnv* env,
const wasm::FunctionBody& func_body,
int func_index, wasm::WasmFeatures* detected,
double* decode_ms, MachineGraph* mcgraph,
MachineGraph* mcgraph,
NodeOriginTable* node_origins,
SourcePositionTable* source_positions) {
base::ElapsedTimer decode_timer;
if (FLAG_trace_wasm_decode_time) {
decode_timer.Start();
}
// Create a TF graph during decoding.
WasmGraphBuilder builder(env, mcgraph->zone(), mcgraph, func_body.sig,
source_positions);
......@@ -6425,9 +6420,6 @@ bool BuildGraphForWasmFunction(AccountingAllocator* allocator,
func_index < FLAG_trace_wasm_ast_end) {
PrintRawWasmCode(allocator, func_body, env->module, wasm::kPrintLocals);
}
if (FLAG_trace_wasm_decode_time) {
*decode_ms = decode_timer.Elapsed().InMillisecondsF();
}
return true;
}
......@@ -6454,9 +6446,6 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
"ExecuteTurbofanCompilation", "func_index", func_index,
"body_size",
static_cast<uint32_t>(func_body.end - func_body.start));
double decode_ms = 0;
size_t node_count = 0;
Zone zone(wasm_engine->allocator(), ZONE_NAME);
MachineGraph* mcgraph = new (&zone) MachineGraph(
new (&zone) Graph(&zone), new (&zone) CommonOperatorBuilder(&zone),
......@@ -6483,8 +6472,8 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
SourcePositionTable* source_positions =
new (mcgraph->zone()) SourcePositionTable(mcgraph->graph());
if (!BuildGraphForWasmFunction(wasm_engine->allocator(), env, func_body,
func_index, detected, &decode_ms, mcgraph,
node_origins, source_positions)) {
func_index, detected, mcgraph, node_origins,
source_positions)) {
return wasm::WasmCompilationResult{};
}
......@@ -6492,12 +6481,6 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
node_origins->AddDecorator();
}
base::ElapsedTimer pipeline_timer;
if (FLAG_trace_wasm_decode_time) {
node_count = mcgraph->graph()->NodeCount();
pipeline_timer.Start();
}
// Run the compiler pipeline to generate machine code.
auto call_descriptor = GetWasmCallDescriptor(&zone, func_body.sig);
if (mcgraph->machine()->Is32()) {
......@@ -6508,14 +6491,6 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
&info, wasm_engine, mcgraph, call_descriptor, source_positions,
node_origins, func_body, env->module, func_index);
if (FLAG_trace_wasm_decode_time) {
double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF();
PrintF(
"wasm-compilation phase 1 ok: %u bytes, %0.3f ms decode, %zu nodes, "
"%0.3f ms pipeline\n",
static_cast<unsigned>(func_body.end - func_body.start), decode_ms,
node_count, pipeline_ms);
}
// TODO(bradnelson): Improve histogram handling of size_t.
counters->wasm_compile_function_peak_memory_bytes()->AddSample(
static_cast<int>(mcgraph->graph()->zone()->allocation_size()));
......
......@@ -49,7 +49,7 @@ bool BuildGraphForWasmFunction(AccountingAllocator* allocator,
wasm::CompilationEnv* env,
const wasm::FunctionBody& func_body,
int func_index, wasm::WasmFeatures* detected,
double* decode_ms, MachineGraph* mcgraph,
MachineGraph* mcgraph,
NodeOriginTable* node_origins,
SourcePositionTable* source_positions);
......
......@@ -624,8 +624,6 @@ DEFINE_IMPLICATION(future, wasm_tier_up)
#endif
DEFINE_IMPLICATION(wasm_tier_up, liftoff)
DEFINE_DEBUG_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code")
DEFINE_DEBUG_BOOL(trace_wasm_decode_time, false,
"trace decoding time of wasm code")
DEFINE_DEBUG_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code")
DEFINE_DEBUG_BOOL(trace_wasm_interpreter, false,
"trace interpretation of wasm code")
......
......@@ -2052,10 +2052,6 @@ WasmCompilationResult ExecuteLiftoffCompilation(AccountingAllocator* allocator,
"ExecuteLiftoffCompilation", "func_index", func_index,
"body_size",
static_cast<uint32_t>(func_body.end - func_body.start));
base::ElapsedTimer compile_timer;
if (FLAG_trace_wasm_decode_time) {
compile_timer.Start();
}
Zone zone(allocator, "LiftoffCompilationZone");
const WasmModule* module = env ? env->module : nullptr;
......@@ -2082,14 +2078,6 @@ WasmCompilationResult ExecuteLiftoffCompilation(AccountingAllocator* allocator,
counters->liftoff_compiled_functions()->Increment();
if (FLAG_trace_wasm_decode_time) {
double compile_ms = compile_timer.Elapsed().InMillisecondsF();
PrintF(
"wasm-compilation liftoff phase 1 ok: %u bytes, %0.3f ms decode and "
"compile\n",
static_cast<unsigned>(func_body.end - func_body.start), compile_ms);
}
WasmCompilationResult result;
compiler->GetCode(&result.code_desc);
result.instr_buffer = instruction_buffer->ReleaseBuffer();
......
......@@ -1534,11 +1534,6 @@ class WasmFullDecoder : public WasmDecoder<validate> {
DCHECK(stack_.empty());
DCHECK(control_.empty());
base::ElapsedTimer decode_timer;
if (FLAG_trace_wasm_decode_time) {
decode_timer.Start();
}
if (this->end_ < this->pc_) {
this->error("function body end < start");
return false;
......@@ -1561,13 +1556,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
if (this->failed()) return this->TraceFailed();
if (FLAG_trace_wasm_decode_time) {
double ms = decode_timer.Elapsed().InMillisecondsF();
PrintF("wasm-decode %s (%0.3f ms)\n\n",
VALIDATE(this->ok()) ? "ok" : "failed", ms);
} else {
TRACE("wasm-decode %s\n\n", VALIDATE(this->ok()) ? "ok" : "failed");
}
TRACE("wasm-decode %s\n\n", VALIDATE(this->ok()) ? "ok" : "failed");
return true;
}
......
......@@ -1307,9 +1307,8 @@ class ModuleDecoderImpl : public Decoder {
const WasmModule* module, WasmFunction* function) {
WasmFunctionName func_name(function,
wire_bytes.GetNameOrNull(function, module));
if (FLAG_trace_wasm_decoder || FLAG_trace_wasm_decode_time) {
StdoutStream os;
os << "Verifying wasm function " << func_name << std::endl;
if (FLAG_trace_wasm_decoder) {
StdoutStream{} << "Verifying wasm function " << func_name << std::endl;
}
FunctionBody body = {
function->sig, function->code.offset(),
......
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