Commit 87311b5c authored by bradnelson's avatar bradnelson Committed by Commit bot

[wasm][asm.js] Make asm.js -> wasm message allocations predictable.

We allocate console timing messages for now,
as previously skipping this tickled unrelated flake.
Use a fixed message to make them consistent in predictable mode.

BUG=v8:4203
TBR=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2628173003
Cr-Commit-Position: refs/heads/master@{#42303}
parent d5be8cf8
......@@ -212,9 +212,15 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
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);
int length;
if (FLAG_predictable) {
length = base::OS::SNPrintF(text, arraysize(text), "success");
} else {
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));
......@@ -321,9 +327,13 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
}
MessageLocation location(script, position, position);
char text[50];
int length =
base::OS::SNPrintF(text, arraysize(text), "success, %0.3f ms",
instantiate_timer.Elapsed().InMillisecondsF());
int length;
if (FLAG_predictable) {
length = base::OS::SNPrintF(text, arraysize(text), "success");
} else {
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));
......
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