Index: src/wasm/wasm-js.cc |
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc |
index 663e4b56b1b07975b61aba64a7e7d67ef7fde33a..62a2676032e5096f63921605205d403795a85666 100644 |
--- a/src/wasm/wasm-js.cc |
+++ b/src/wasm/wasm-js.cc |
@@ -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; |
} |