]> Cypherpunks repositories - gostls13.git/commit
src/cmd/internal/obj/wasm: optimize blocks in wasm binary
authorRichard Musiol <mail@richard-musiol.de>
Sun, 17 Mar 2019 12:45:46 +0000 (13:45 +0100)
committerRichard Musiol <neelance@gmail.com>
Sat, 23 Mar 2019 12:34:20 +0000 (12:34 +0000)
commit2396101e0590cb7d77556924249c26af0ccd9eff
treea54a8f64f2d42a1d86b3ecf50df94da5f22ca283
parenta189467cdae5421c863cf940778d681ecb1d3d2f
src/cmd/internal/obj/wasm: optimize blocks in wasm binary

This change optimizes the blocks in the wasm binary by generating the
entryPointLoop only if it is used and adding an unwindExit block to
be able to use the short BrIf instruction for unwinding the stack.
These changes were suggested by the wasm-opt tool and reduce the
wasm binary size of "hello world" by 1.5%.

Change-Id: Ie52db2fa2d9b8482f9a78b7c189231750811fe97
Reviewed-on: https://go-review.googlesource.com/c/go/+/167937
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/internal/obj/wasm/wasmobj.go