runtime: omit nil-channel cases from selectgo's orders
authorIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2020 04:51:18 +0000 (20:51 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2020 19:56:41 +0000 (11:56 -0800)
commit48357ce4f22c8298ea5fb01d6873bc7bf56180e5
treebafb432735bae6fde8265a5c2d4a032c56c7780d
parent1fa5fc7408d05710cb63a5e91c5df6c787b51019
runtime: omit nil-channel cases from selectgo's orders

This is the gofrontend version of https://golang.org/cl/245123.
Original CL description:

    Currently, selectgo does an initial pass over the cases array to look
    for entries with nil channels, so they can be easily recognized and
    skipped later on. But this still involves actually visiting the cases.

    This commit changes selectgo to omit cases with nil channels when
    constructing pollorder, so that they'll be skipped over entirely later
    on. It also checks for caseDefault up front, which will facilitate
    changing it to use a "block bool" parameter instead.

    Updates golang/go#40410

This is being brought over to gofrontend as a step toward upgrading to
Go1.16beta1, setting up for more compiler changes related to select handling.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/279733
gcc/go/gofrontend/MERGE
libgo/go/runtime/select.go