The compiler allows printing the Wasm code for all functions by using --print-wasm
pkg/dart2Wasm/tool/compile_benchmark --compiler-asserts --print-wasm app.dart app.wasm
wami
to inspect Wasm filesThe V8 repository contains a wami
tool to inspect Wasm files.
First ensure you Checkout & Build V8. That will result in a out/x64.release/wami
binary.
Consider putting it into PATH
or adding an alias wami=<path-to-v8>/out/x64.release/wami
into shellrc.
It can be used to dump section statistics
% wami --section-stats -o app.stats app.wasm
It can be used to dump the entire Wasm file with or without offsets
% wami --offsets --full-wat -o app.wat app.wasm % wami --full-wat -o app.wat app.wasm