runtime: eliminate scase.kind field
authorIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2020 19:04:35 +0000 (11:04 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2020 22:42:22 +0000 (14:42 -0800)
commit313890530c53475f2b76c4cae0d69b9b73de648c
treea8c5993ce3f5d7c25bd54cf3b5522c2ddf1cbe06
parent6aff491f7b1d3a8373310cf596f5079cc4e37076
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.

    For golang/go#40410.

This is being brought over to gofrontend as a step toward upgrading to
Go1.16beta1.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/279735
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/runtime.def
gcc/go/gofrontend/statements.cc
gcc/go/gofrontend/statements.h
gcc/go/gofrontend/types.cc
libgo/go/runtime/select.go