]> Cypherpunks repositories - gostls13.git/commit
cmd/compile,runtime: skip zero'ing order array for select statements
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 28 Aug 2020 20:25:21 +0000 (03:25 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 29 Aug 2020 08:02:52 +0000 (08:02 +0000)
commit27a30186abc18a8fc22b8ab40e3ee9f29d81c1d4
tree0eb89a0317307b9b7409943e3ee8c8a7b38a7627
parent49bae984955bd57302895beba2ecd8b9d5cd764c
cmd/compile,runtime: skip zero'ing order array for select statements

The order array was zero initialized by the compiler, but ends up being
overwritten by the runtime anyway.

So let the runtime takes full responsibility for initializing, save us
one instruction per select.

Fixes #40399

Change-Id: Iec1eca27ad7180d4fcb3cc9ef97348206b7fe6b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/251517
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/select.go
src/runtime/select.go
test/codegen/select.go [new file with mode: 0644]