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

Add command line flags to dump asm.js -> wasm conversion data.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=manual
R=titzer@chromium.org,aseemgarg@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1697723002

Cr-Commit-Position: refs/heads/master@{#34009}
parent 0835ed9c
......@@ -482,6 +482,10 @@ DEFINE_BOOL(wasm_break_on_decoder_error, false,
DEFINE_BOOL(enable_simd_asmjs, false, "enable SIMD.js in asm.js stdlib")
DEFINE_BOOL(dump_asmjs_wasm, false, "dump Asm.js to WASM module bytes")
DEFINE_STRING(asmjs_wasm_dumpfile, "asmjs.wasm",
"file to dump asm wasm conversion result to")
DEFINE_INT(typed_array_max_size_in_heap, 64,
"threshold for in-heap typed array")
......
......@@ -126,6 +126,15 @@ v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(
auto module = v8::internal::wasm::AsmWasmBuilder(
info->isolate(), info->zone(), info->literal(), foreign)
.Run();
if (i::FLAG_dump_asmjs_wasm) {
FILE* wasm_file = fopen(i::FLAG_asmjs_wasm_dumpfile, "wb");
if (wasm_file) {
fwrite(module->Begin(), module->End() - module->Begin(), 1, wasm_file);
fclose(wasm_file);
}
}
return module;
}
......
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