diff options
author | Denys Smirnov <denis.smirnov.91@gmail.com> | 2018-10-19 19:04:29 +0000 |
---|---|---|
committer | Richard Musiol <neelance@gmail.com> | 2018-10-19 21:05:33 +0000 |
commit | 6c631ae227cb6f15d5b0b8cc39c1715b8f4e9187 (patch) | |
tree | bf39ab50c425a946fe777009b492ad3aa0417520 /src/cmd/compile/internal/ssa/export_test.go | |
parent | f5636523998594af75ec87d3c2a2070dc1cb65f4 (diff) | |
download | go-6c631ae227cb6f15d5b0b8cc39c1715b8f4e9187.tar.gz go-6c631ae227cb6f15d5b0b8cc39c1715b8f4e9187.zip |
cmd/compile: in wasm, allocate approximately right number of locals for functions
Currently, WASM binary writer requests 16 int registers (locals) and
16 float registers for every function regardless of how many locals the
function uses.
This change counts the number of used registers and requests a number
of locals matching the highest register index. The change has no effect
on performance and neglectable binary size improvement, but it makes
WASM code more readable and easy to analyze.
Change-Id: Ic1079623c0d632b215c68482db909fa440892700
GitHub-Last-Rev: 184634fa918aff74e280904dc2efafcc80735a8b
GitHub-Pull-Request: golang/go#28116
Reviewed-on: https://go-review.googlesource.com/c/140999
Reviewed-by: Richard Musiol <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
0 files changed, 0 insertions, 0 deletions