1
0
mirror of https://github.com/golang/go synced 2024-11-11 23:20:24 -07:00
go/src
Cherry Zhang 1d303a0086 cmd/compile: fold offset into address on Wasm
On Wasm, the offset was not folded into LoweredAddr, so it was
not rematerializeable. This led to the address-taken operation
in some cases generated too early, before the local variable
becoming live. The liveness code thinks the variable live when
the address is taken, then backs it up to live at function
entry, then complains about it, because nothing other than
arguments should be live on entry.

This CL folds the offset into the address operation, so it is
rematerializeable and so generated right before use, after the
variable actually becomes live.

It might be possible to relax the liveness code not to think a
variable live when its address being taken, but until the address
actually being used. But it would be quite complicated. As we're
late in Go 1.11 freeze, it would be better not to do it. Also,
I think the address operation is rematerializeable now on all
architectures, so this is probably less necessary.

This may also be a slight optimization, as the address+offset is
now rematerializeable, which can be generated on the Wasm stack,
without using any "registers" which are emulated by local
variables on Wasm. I don't know how to do benchmarks on Wasm. At
least, cmd/go binary size shrinks 9K.

Fixes #25966.

Change-Id: I01e5869515d6a3942fccdcb857f924a866876e57
Reviewed-on: https://go-review.googlesource.com/120599
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
2018-06-27 14:30:00 +00:00
..
archive archive/zip: warn about FileHeader.Name being unvalidated on read 2018-06-13 21:57:41 +00:00
bufio bufio: clarify SplitFunc docs for nil token 2018-06-13 21:43:06 +00:00
builtin
bytes bytes: re-slice buffer to its previous length after call to grow() 2018-05-29 19:46:33 +00:00
cmd cmd/compile: fold offset into address on Wasm 2018-06-27 14:30:00 +00:00
compress all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
container
context context: add docs to ExampleWithValue 2018-06-12 22:33:54 +00:00
crypto syscall/js: turn constant package vars into functions 2018-06-25 17:04:01 +00:00
database/sql database/sql: update doc related to per-connection state 2018-06-06 18:18:20 +00:00
debug debug/elf,macho,pe: support compressed DWARF 2018-06-19 22:13:51 +00:00
encoding encoding/gob: correct issue number typo in comment 2018-06-13 05:33:59 +00:00
errors
expvar
flag flag: add a Value example 2018-06-21 23:32:53 +00:00
fmt
go ast: refer to "embedded" rather than "anonymous" fields in 2018-06-26 19:40:44 +00:00
hash all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
html text/template/parse: undo breaking API changes 2018-06-22 08:05:11 +00:00
image all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
index/suffixarray index/suffixarray: fix a typo mistake in comments 2018-05-29 12:16:51 +00:00
internal syscall, internal/poll: fix build on js/wasm 2018-06-22 17:58:16 +00:00
io io: calculate buffer size only when needed 2018-05-06 15:52:31 +00:00
log log/syslog: skip tests that depend on daemon on builders 2018-05-22 18:26:03 +00:00
math math/big: handle negative exponents in Exp 2018-06-14 22:26:30 +00:00
mime mime/multipart: restore 1.9 handling of missing/empty form-data file name 2018-06-26 23:56:13 +00:00
net net: improve ExampleUDPConn_WriteTo docs 2018-06-26 21:30:43 +00:00
os os: have UserCacheDir return an error on failure 2018-06-25 18:59:39 +00:00
path os: add js/wasm architecture 2018-06-01 05:18:38 +00:00
plugin plugin: make stub lookup signature match dlopen version 2018-05-08 17:09:05 +00:00
reflect reflect: add StructOf test case that gccgo used to fail 2018-06-06 14:08:42 +00:00
regexp regexp: add QuoteMeta example 2018-06-12 22:37:01 +00:00
runtime cmd/compile: map delete should clear value always 2018-06-26 01:57:01 +00:00
sort all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
strconv strconv: add missing period to godoc comment 2018-06-09 01:26:25 +00:00
strings all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
sync sync: fix deficiency in RWMutex race annotations 2018-06-22 14:43:09 +00:00
syscall syscall/js: use stable references to JavaScript values 2018-06-26 16:40:09 +00:00
testing Revert "testing: only compute b.N once when passed -count > 1" 2018-05-31 14:22:44 +00:00
text text/template/parse: undo breaking API changes 2018-06-22 08:05:11 +00:00
time time: run genzabbrs.go to update zoneinfo_abbrs_windows.go 2018-06-26 09:55:39 +00:00
unicode unicode: fix SpecialCase to follow its docs & respect explict no-op mappings 2018-06-17 08:48:39 +00:00
unsafe
vendor/golang_org/x net/http: vendor x/net/http/httpproxy, use it in net/http 2018-05-29 21:54:57 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash make.bash: don't pass GOOS and GOARCH to cmd/go when finding GOROOT_BOOTSTRAP 2018-06-20 16:04:33 +00:00
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash runtime/race: implement race detector for ppc64le 2018-06-11 17:45:36 +00:00
race.bat
run.bash
run.bat
run.rc