]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: eliminate runtime.hselect
authorMatthew Dempsky <mdempsky@google.com>
Tue, 7 Mar 2017 21:44:53 +0000 (13:44 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 1 May 2018 03:17:31 +0000 (03:17 +0000)
commit3aa53b31350dff905deefb97e6670a14f166d2a9
treecbd22926cedf9f2480ad6e137f3a219beea2d9fc
parenta4aa2e0c280237f5e4d22f84386bcfee2f9cec3f
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>
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/inl_test.go
src/cmd/compile/internal/gc/select.go
src/runtime/select.go
test/live.go