]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile, runtime: simplify multiway select implementation
authorMatthew Dempsky <mdempsky@google.com>
Wed, 1 Mar 2017 23:50:57 +0000 (15:50 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 7 Mar 2017 20:14:17 +0000 (20:14 +0000)
commitc310c688ffa46e2f91e40284c16d71f3921feed9
tree4eaf626a618d12018a5ae11be7a17e0634baef47
parent5ed952368e3777845afd934e38219c5567b09cc4
cmd/compile, runtime: simplify multiway select implementation

This commit reworks multiway select statements to use normal control
flow primitives instead of the previous setjmp/longjmp-like behavior.
This simplifies liveness analysis and should prevent issues around
"returns twice" function calls within SSA passes.

test/live.go is updated because liveness analysis's CFG is more
representative of actual control flow. The case bodies are the only
real successors of the selectgo call, but previously the selectsend,
selectrecv, etc. calls were included in the successors list too.

Updates #19331.

Change-Id: I7f879b103a4b85e62fc36a270d812f54c0aa3e83
Reviewed-on: https://go-review.googlesource.com/37661
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
17 files changed:
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/select.go
src/cmd/compile/internal/gc/ssa.go
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/asm_arm64.s
src/runtime/asm_mips64x.s
src/runtime/asm_mipsx.s
src/runtime/asm_ppc64x.s
src/runtime/asm_s390x.s
src/runtime/select.go
src/runtime/stubs.go
test/live.go