runtime: remove unused *chantype parameters

The chanrecv funcs don't use it at all. The chansend ones do, but the
element type is now part of the hchan struct, which is already a
parameter.

hchan can be nil in chansend when sending to a nil channel, so when
instrumenting we must copy to the stack to be able to read the channel
type.

name             old time/op  new time/op  delta
ChanUncontended  6.42µs ± 1%  6.22µs ± 0%  -3.06%  (p=0.000 n=19+18)

Initially found by github.com/mvdan/unparam.

Fixes #19591.

Change-Id: I3a5e8a0082e8445cc3f0074695e3593fd9c88412
Reviewed-on: https://go-review.googlesource.com/38351
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Daniel Martí 2017-03-18 15:55:41 +00:00 committed by Brad Fitzpatrick
parent c65ceff125
commit 2e29eb57db
7 changed files with 106 additions and 106 deletions

View file

@ -916,7 +916,13 @@ func orderstmt(n *Node, order *Order) {
n.Left = orderexpr(n.Left, order, nil)
n.Right = orderexpr(n.Right, order, nil)
n.Right = orderaddrtemp(n.Right, order)
if instrumenting {
// Force copying to the stack so that (chan T)(nil) <- x
// is still instrumented as a read of x.
n.Right = ordercopyexpr(n.Right, n.Right.Type, order, 0)
} else {
n.Right = orderaddrtemp(n.Right, order)
}
order.out = append(order.out, n)
cleantemp(t, order)