diff options
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index fb9635018..33e84bc33 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1363,6 +1363,13 @@ void Asm2WasmBuilder::processAsm(Ref ast) { if (runOptimizationPasses) { optimizingBuilder->finish(); + // Now that we have a full module, do memory packing optimizations + { + PassRunner passRunner(&wasm, passOptions); + passRunner.options.lowMemoryUnused = true; + passRunner.add("memory-packing"); + passRunner.run(); + } // if we added any helper functions (like non-trapping i32-div, etc.), then // those have not been optimized (the optimizing builder has just been fed // the asm.js functions). Optimize those now. Typically there are very few, |