runtime: eliminate scase.kind field

This is the gofrontend version of

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

Change-Id: I39a0a83c25e15fbd3cdfac7f31e01df9f2cddd3f
Trust: Ian Lance Taylor <>
Reviewed-by: Than McIntosh <>
Reviewed-by: Cherry Zhang <>
5 files changed