Commit 2860c483 authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] Introduce the --print-wasm-code flag to print wasm code.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2663433003
Cr-Commit-Position: refs/heads/master@{#43129}
parent d401543f
......@@ -237,7 +237,8 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
? FLAG_print_builtin_code
: (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) ||
(info->IsOptimizing() && FLAG_print_opt_code &&
info->shared_info()->PassesFilter(FLAG_print_opt_code_filter)));
info->shared_info()->PassesFilter(FLAG_print_opt_code_filter)) ||
(info->IsWasm() && FLAG_print_wasm_code));
if (print_code) {
std::unique_ptr<char[]> debug_name = info->GetDebugName();
CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer());
......
......@@ -210,6 +210,7 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
// Accessors for the different compilation modes.
bool IsOptimizing() const { return mode_ == OPTIMIZE; }
bool IsStub() const { return mode_ == STUB; }
bool IsWasm() const { return output_code_kind() == Code::WASM_FUNCTION; }
void SetOptimizing();
void SetOptimizingForOsr(BailoutId osr_ast_id, JavaScriptFrame* osr_frame) {
SetOptimizing();
......
......@@ -573,6 +573,8 @@ DEFINE_BOOL(wasm_trap_if, true,
"enable the use of the trap_if operator for traps")
DEFINE_BOOL(wasm_code_fuzzer_gen_test, false,
"Generate a test case when running the wasm-code fuzzer")
DEFINE_BOOL(print_wasm_code, false, "Print WebAssembly code")
// Profiler flags.
DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
// 0x1800 fits in the immediate field of an ARM instruction.
......
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