diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-01-12 11:58:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-12 11:58:33 -0800 |
commit | d9ef39df1139837df5d7f7294ca45b62e3e282aa (patch) | |
tree | d20c13fbfa4ee929b1ded6dce0ebd0f3cde0225e /src/wasm/wasm-binary.cpp | |
parent | 2bdd116719017bf13d8d4bda37b81be1baf13b37 (diff) | |
download | binaryen-d9ef39df1139837df5d7f7294ca45b62e3e282aa.tar.gz binaryen-d9ef39df1139837df5d7f7294ca45b62e3e282aa.tar.bz2 binaryen-d9ef39df1139837df5d7f7294ca45b62e3e282aa.zip |
Function metrics pass (#1353)
Emits binary size and opcode counts for each function, which helps investigating what's taking up space in a wasm binary.
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r-- | src/wasm/wasm-binary.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 1a7ab6267..514b489a9 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -287,6 +287,7 @@ void WasmBinaryWriter::writeFunctions() { std::move(&o[start], &o[start] + size, &o[sizePos] + sizeFieldSize); o.resize(o.size() - (MaxLEB32Bytes - sizeFieldSize)); } + tableOfContents.functionBodies.emplace_back(function->name, sizePos + sizeFieldSize, size); } currFunction = nullptr; finishSection(start); |