diff options
author | Matthew Dempsky <mdempsky@google.com> | 2017-03-07 13:44:53 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2018-05-01 03:17:31 +0000 |
commit | 3aa53b31350dff905deefb97e6670a14f166d2a9 (patch) | |
tree | cbd22926cedf9f2480ad6e137f3a219beea2d9fc /test/live.go | |
parent | a4aa2e0c280237f5e4d22f84386bcfee2f9cec3f (diff) | |
download | go-3aa53b31350dff905deefb97e6670a14f166d2a9.tar.gz go-3aa53b31350dff905deefb97e6670a14f166d2a9.zip |
runtime: eliminate runtime.hselect
Now the registration phase looks like:
var cases [4]runtime.scases
var order [8]uint16
selectsend(&cases[0], c1, &v1)
selectrecv(&cases[1], c2, &v2, nil)
selectrecv(&cases[2], c3, &v3, &ok)
selectdefault(&cases[3])
chosen := selectgo(&cases[0], &order[0], 4)
Primarily, this is just preparation for having the compiler open-code
selectsend, selectrecv, and selectdefault.
As a minor benefit, order can now be layed out separately on the stack
in the pointer-free segment, so it won't take up space in the
function's stack pointer maps.
Change-Id: I5552ba594201efd31fcb40084da20b42ea569a45
Reviewed-on: https://go-review.googlesource.com/37933
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'test/live.go')
-rw-r--r-- | test/live.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/live.go b/test/live.go index ecab83e276..43ef9bdad2 100644 --- a/test/live.go +++ b/test/live.go @@ -163,7 +163,7 @@ var b bool // this used to have a spurious "live at entry to f11a: ~r0" func f11a() *int { - select { // ERROR "live at call to newselect: .autotmp_[0-9]+$" "live at call to selectgo: .autotmp_[0-9]+$" + select { // ERROR "live at call to selectgo: .autotmp_[0-9]+$" case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" return nil case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" @@ -178,7 +178,7 @@ func f11b() *int { // get to the bottom of the function. // This used to have a spurious "live at call to printint: p". printint(1) // nothing live here! - select { // ERROR "live at call to newselect: .autotmp_[0-9]+$" "live at call to selectgo: .autotmp_[0-9]+$" + select { // ERROR "live at call to selectgo: .autotmp_[0-9]+$" case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" return nil case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" @@ -198,7 +198,7 @@ func f11c() *int { // Unlike previous, the cases in this select fall through, // so we can get to the println, so p is not dead. printint(1) // ERROR "live at call to printint: p$" - select { // ERROR "live at call to newselect: .autotmp_[0-9]+ p$" "live at call to selectgo: .autotmp_[0-9]+ p$" + select { // ERROR "live at call to selectgo: .autotmp_[0-9]+ p$" case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+ p$" case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+ p$" } @@ -589,7 +589,7 @@ func f38(b bool) { // we care that the println lines have no live variables // and therefore no output. if b { - select { // ERROR "live at call to newselect:( .autotmp_[0-9]+)+$" "live at call to selectgo:( .autotmp_[0-9]+)+$" + select { // ERROR "live at call to selectgo:( .autotmp_[0-9]+)+$" case <-fc38(): // ERROR "live at call to selectrecv:( .autotmp_[0-9]+)+$" printnl() case fc38() <- *fi38(1): // ERROR "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" "live at call to selectsend:( .autotmp_[0-9]+)+$" |