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

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

Reland of [wasm][asm.js] Do same work even when not printing asm info. (patchset #1 id:1 of https://codereview.chromium.org/2627223002/ )

Reason for revert:
Triggers flaky tests.

Original issue's description:
> Revert of [wasm][asm.js] Do same work even when not printing asm info. (patchset #1 id:1 of https://codereview.chromium.org/2629043002/ )
>
> Reason for revert:
> Triggers flaky tests.
>
> Original issue's description:
> > [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}
> > Committed: https://chromium.googlesource.com/v8/v8/+/785cedf1ee6671399c2b2b7f6c6a8119f55195b4
>
> TBR=danno@chromium.org,bradnelson@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=v8:4203
>
> Review-Url: https://codereview.chromium.org/2627223002
> Cr-Commit-Position: refs/heads/master@{#42250}
> Committed: https://chromium.googlesource.com/v8/v8/+/636df54873c966eceed4264cabc2360b76221e26

TBR=danno@chromium.org,bradnelson@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4203

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