[wasm] Only print compiler for proper functions

The new DCHECK fires when the tier was set to {kNone}, which was the
case for wrappers.
Since the compiler is only interesting for proper Wasm functions, we
keep the DCHECK but only print the compiler for code objects that
represent actual Wasm functions.

R=thibaudm@chromium.org

Bug: chromium:1223839
Change-Id: Icc0f13b34b53fee2a8d53857a4769ab4d80ab805
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3003467
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75562}
This commit is contained in:
Clemens Backes 2021-07-05 14:44:48 +02:00 committed by V8 LUCI CQ
parent a1116f2d69
commit a41f5bee79
2 changed files with 21 additions and 5 deletions

View File

@ -363,11 +363,13 @@ void WasmCode::Disassemble(const char* name, std::ostream& os,
if (name) os << "name: " << name << "\n";
if (!IsAnonymous()) os << "index: " << index() << "\n";
os << "kind: " << GetWasmCodeKindAsString(kind()) << "\n";
DCHECK(is_liftoff() || tier() == ExecutionTier::kTurbofan);
const char* compiler = is_liftoff()
? (for_debugging() ? "Liftoff (debug)" : "Liftoff")
: "TurboFan";
os << "compiler: " << compiler << "\n";
if (kind() == kFunction) {
DCHECK(is_liftoff() || tier() == ExecutionTier::kTurbofan);
const char* compiler =
is_liftoff() ? (for_debugging() ? "Liftoff (debug)" : "Liftoff")
: "TurboFan";
os << "compiler: " << compiler << "\n";
}
size_t padding = instructions().size() - unpadded_binary_size_;
os << "Body (size = " << instructions().size() << " = "
<< unpadded_binary_size_ << " + " << padding << " padding)\n";

View File

@ -0,0 +1,14 @@
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --print-code
function module(global, imports) {
'use asm';
var x = imports.fn;
function f() {}
return f;
}
module(this, {fn: i => i});