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

[wasm][asm.js] Enable --validate-asm by default.

This directs all asm.js traffic via the Wasm backend.
Make asm.js console output less noisy.

R=titzer@chromium.org,aseemgarg@chromium.org
BUG=v8:4203

Review-Url: https://codereview.chromium.org/2624813002
Cr-Original-Original-Commit-Position: refs/heads/master@{#42194}
Committed: https://chromium.googlesource.com/v8/v8/+/946cc371ed4b34d1a9f5cc615b14c41b652562ad
Review-Url: https://codereview.chromium.org/2624813002
Cr-Original-Commit-Position: refs/heads/master@{#42244}
Committed: https://chromium.googlesource.com/v8/v8/+/3169fb94c98953f002908974a606b51a35178046
Review-Url: https://codereview.chromium.org/2624813002
Cr-Commit-Position: refs/heads/master@{#42300}
parent f488a412
...@@ -212,15 +212,9 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) { ...@@ -212,15 +212,9 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
MessageLocation location(info->script(), info->literal()->position(), MessageLocation location(info->script(), info->literal()->position(),
info->literal()->position()); info->literal()->position());
char text[100]; char text[100];
int length; int length = base::OS::SNPrintF(
if (FLAG_trace_asm_time) { text, arraysize(text), "success, asm->wasm: %0.3f ms, compile: %0.3f ms",
length = asm_wasm_time, compile_time);
base::OS::SNPrintF(text, arraysize(text),
"success, asm->wasm: %0.3f ms, compile: %0.3f ms",
asm_wasm_time, compile_time);
} else {
length = base::OS::SNPrintF(text, arraysize(text), "success");
}
DCHECK_NE(-1, length); DCHECK_NE(-1, length);
USE(length); USE(length);
Handle<String> stext(info->isolate()->factory()->InternalizeUtf8String(text)); Handle<String> stext(info->isolate()->factory()->InternalizeUtf8String(text));
...@@ -228,7 +222,7 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) { ...@@ -228,7 +222,7 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
info->isolate(), MessageTemplate::kAsmJsCompiled, &location, stext, info->isolate(), MessageTemplate::kAsmJsCompiled, &location, stext,
Handle<JSArray>::null()); Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo); message->set_error_level(v8::Isolate::kMessageInfo);
if (!FLAG_suppress_asm_messages) { if (!FLAG_suppress_asm_messages && FLAG_trace_asm_time) {
MessageHandler::ReportMessage(info->isolate(), &location, message); MessageHandler::ReportMessage(info->isolate(), &location, message);
} }
...@@ -327,13 +321,9 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate, ...@@ -327,13 +321,9 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
} }
MessageLocation location(script, position, position); MessageLocation location(script, position, position);
char text[50]; char text[50];
int length; int length =
if (FLAG_trace_asm_time) { base::OS::SNPrintF(text, arraysize(text), "success, %0.3f ms",
length = base::OS::SNPrintF(text, arraysize(text), "success, %0.3f ms", instantiate_timer.Elapsed().InMillisecondsF());
instantiate_timer.Elapsed().InMillisecondsF());
} else {
length = base::OS::SNPrintF(text, arraysize(text), "success");
}
DCHECK_NE(-1, length); DCHECK_NE(-1, length);
USE(length); USE(length);
Handle<String> stext(isolate->factory()->InternalizeUtf8String(text)); Handle<String> stext(isolate->factory()->InternalizeUtf8String(text));
...@@ -341,7 +331,9 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate, ...@@ -341,7 +331,9 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
isolate, MessageTemplate::kAsmJsInstantiated, &location, stext, isolate, MessageTemplate::kAsmJsInstantiated, &location, stext,
Handle<JSArray>::null()); Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo); message->set_error_level(v8::Isolate::kMessageInfo);
MessageHandler::ReportMessage(isolate, &location, message); if (!FLAG_suppress_asm_messages && FLAG_trace_asm_time) {
MessageHandler::ReportMessage(isolate, &location, message);
}
return module_object; return module_object;
} }
......
...@@ -517,7 +517,7 @@ DEFINE_BOOL(wasm_break_on_decoder_error, false, ...@@ -517,7 +517,7 @@ DEFINE_BOOL(wasm_break_on_decoder_error, false,
DEFINE_BOOL(wasm_loop_assignment_analysis, true, DEFINE_BOOL(wasm_loop_assignment_analysis, true,
"perform loop assignment analysis for WASM") "perform loop assignment analysis for WASM")
DEFINE_BOOL(validate_asm, false, "validate asm.js modules before compiling") DEFINE_BOOL(validate_asm, true, "validate asm.js modules before compiling")
DEFINE_IMPLICATION(ignition_staging, validate_asm) DEFINE_IMPLICATION(ignition_staging, validate_asm)
DEFINE_BOOL(suppress_asm_messages, false, DEFINE_BOOL(suppress_asm_messages, false,
"don't emit asm.js related messages (for golden file testing)") "don't emit asm.js related messages (for golden file testing)")
......
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