Commit b5071c87 authored by bradnelson's avatar bradnelson Committed by Commit bot

[wasm][asm.js] Add flag to optionally suppress asm.js messages.

Asm.js warnings / info is non-canonical.
It may be useful to suppress it in golden file tests
(for instance LayoutTests).

BUG=v8:4203
R=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2625833003
Cr-Commit-Position: refs/heads/master@{#42204}
parent 66178c8f
......@@ -170,9 +170,11 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
auto asm_wasm_result = builder.Run(&foreign_globals);
if (!asm_wasm_result.success) {
DCHECK(!info->isolate()->has_pending_exception());
MessageHandler::ReportMessage(info->isolate(),
builder.typer()->message_location(),
builder.typer()->error_message());
if (!FLAG_suppress_asm_messages) {
MessageHandler::ReportMessage(info->isolate(),
builder.typer()->message_location(),
builder.typer()->error_message());
}
return MaybeHandle<FixedArray>();
}
double asm_wasm_time = asm_wasm_timer.Elapsed().InMillisecondsF();
......@@ -226,7 +228,9 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
info->isolate(), MessageTemplate::kAsmJsCompiled, &location, stext,
Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo);
MessageHandler::ReportMessage(info->isolate(), &location, message);
if (!FLAG_suppress_asm_messages) {
MessageHandler::ReportMessage(info->isolate(), &location, message);
}
return result;
}
......
......@@ -520,6 +520,8 @@ DEFINE_BOOL(wasm_loop_assignment_analysis, true,
DEFINE_BOOL(validate_asm, false, "validate asm.js modules before compiling")
DEFINE_IMPLICATION(ignition_staging, validate_asm)
DEFINE_BOOL(suppress_asm_messages, false,
"don't emit asm.js related messages (for golden file testing)")
DEFINE_BOOL(trace_asm_time, false, "log asm.js timing info to the console")
DEFINE_BOOL(dump_wasm_module, false, "dump WASM module bytes")
......
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