mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
a4aa2e0c28
commit
3aa53b3135
6 changed files with 145 additions and 205 deletions
|
|
@ -60,7 +60,6 @@ func TestIntendedInlining(t *testing.T) {
|
|||
"releasem",
|
||||
"round",
|
||||
"roundupsize",
|
||||
"selectsize",
|
||||
"stringStructOf",
|
||||
"subtract1",
|
||||
"subtractb",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue