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) { ...@@ -212,9 +212,15 @@ 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 = base::OS::SNPrintF( int length;
text, arraysize(text), "success, asm->wasm: %0.3f ms, compile: %0.3f ms", if (FLAG_predictable) {
asm_wasm_time, compile_time); 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); DCHECK_NE(-1, length);
USE(length); USE(length);
Handle<String> stext(info->isolate()->factory()->InternalizeUtf8String(text)); Handle<String> stext(info->isolate()->factory()->InternalizeUtf8String(text));
...@@ -321,9 +327,13 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate, ...@@ -321,9 +327,13 @@ 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;
base::OS::SNPrintF(text, arraysize(text), "success, %0.3f ms", if (FLAG_predictable) {
instantiate_timer.Elapsed().InMillisecondsF()); 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); DCHECK_NE(-1, length);
USE(length); USE(length);
Handle<String> stext(isolate->factory()->InternalizeUtf8String(text)); 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