runtime: eliminate scase.kind field
This is the gofrontend version of https://golang.org/cl/245125.
Original CL description:
Currently, we include a "kind" field on scase to distinguish the three
kinds of cases in a select statement: sends, receives, and defaults.
This commit removes by kind field by instead arranging for the
compiler to always place sends before receives, and to provide their
counts separately. It also passes an explicit "block bool" parameter
to avoid needing to include a default case in the array.
It's safe to shuffle cases like this because the runtime will
randomize the order they're polled in anyway.
This is being brought over to gofrontend as a step toward upgrading to
Trust: Ian Lance Taylor <firstname.lastname@example.org>
Reviewed-by: Than McIntosh <email@example.com>
Reviewed-by: Cherry Zhang <firstname.lastname@example.org>
5 files changed