Commit 785cedf1 authored by bradnelson's avatar bradnelson Committed by Commit bot

[wasm][asm.js] Do same work even when not printing asm info.

Skipping this work seems to perturb a gc-stress issue.
More investigation is likely needed.

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

Review-Url: https://codereview.chromium.org/2629043002
Cr-Commit-Position: refs/heads/master@{#42248}
parent f056905f
......@@ -209,25 +209,21 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
result->set(kWasmDataScriptPosition,
Smi::FromInt(info->literal()->position()));
if (FLAG_trace_asm_time) {
MessageLocation location(info->script(), info->literal()->position(),
info->literal()->position());
char text[100];
int length =
base::OS::SNPrintF(text, arraysize(text),
"success, asm->wasm: %0.3f ms, compile: %0.3f ms",
asm_wasm_time, compile_time);
DCHECK_NE(-1, length);
USE(length);
Handle<String> stext(
info->isolate()->factory()->InternalizeUtf8String(text));
Handle<JSMessageObject> message = MessageHandler::MakeMessageObject(
info->isolate(), MessageTemplate::kAsmJsCompiled, &location, stext,
Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo);
if (!FLAG_suppress_asm_messages) {
MessageHandler::ReportMessage(info->isolate(), &location, message);
}
MessageLocation location(info->script(), info->literal()->position(),
info->literal()->position());
char text[100];
int length = base::OS::SNPrintF(
text, arraysize(text), "success, asm->wasm: %0.3f ms, compile: %0.3f ms",
asm_wasm_time, compile_time);
DCHECK_NE(-1, length);
USE(length);
Handle<String> stext(info->isolate()->factory()->InternalizeUtf8String(text));
Handle<JSMessageObject> message = MessageHandler::MakeMessageObject(
info->isolate(), MessageTemplate::kAsmJsCompiled, &location, stext,
Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo);
if (FLAG_trace_asm_time && !FLAG_suppress_asm_messages) {
MessageHandler::ReportMessage(info->isolate(), &location, message);
}
return result;
......@@ -318,28 +314,25 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
return single_function;
}
if (FLAG_trace_asm_time) {
i::Handle<i::Script> script(
i::Script::cast(wasm_data->get(kWasmDataScript)));
int32_t position = 0;
if (!wasm_data->get(kWasmDataScriptPosition)->ToInt32(&position)) {
UNREACHABLE();
}
MessageLocation location(script, position, position);
char text[50];
int length =
base::OS::SNPrintF(text, arraysize(text), "success, %0.3f ms",
instantiate_timer.Elapsed().InMillisecondsF());
DCHECK_NE(-1, length);
USE(length);
Handle<String> stext(isolate->factory()->InternalizeUtf8String(text));
Handle<JSMessageObject> message = MessageHandler::MakeMessageObject(
isolate, MessageTemplate::kAsmJsInstantiated, &location, stext,
Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo);
if (!FLAG_suppress_asm_messages) {
MessageHandler::ReportMessage(isolate, &location, message);
}
i::Handle<i::Script> script(i::Script::cast(wasm_data->get(kWasmDataScript)));
int32_t position = 0;
if (!wasm_data->get(kWasmDataScriptPosition)->ToInt32(&position)) {
UNREACHABLE();
}
MessageLocation location(script, position, position);
char text[50];
int length =
base::OS::SNPrintF(text, arraysize(text), "success, %0.3f ms",
instantiate_timer.Elapsed().InMillisecondsF());
DCHECK_NE(-1, length);
USE(length);
Handle<String> stext(isolate->factory()->InternalizeUtf8String(text));
Handle<JSMessageObject> message = MessageHandler::MakeMessageObject(
isolate, MessageTemplate::kAsmJsInstantiated, &location, stext,
Handle<JSArray>::null());
message->set_error_level(v8::Isolate::kMessageInfo);
if (FLAG_trace_asm_time && !FLAG_suppress_asm_messages) {
MessageHandler::ReportMessage(isolate, &location, message);
}
return module_object;
......
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