1
0
mirror of https://github.com/golang/go synced 2024-11-05 18:26:10 -07:00
go/test/interface
Russ Cox 4224d81fae cmd/internal/gc: inline x := y.(*T) and x, ok := y.(*T)
These can be implemented with just a compare and a move instruction.
Do so, avoiding the overhead of a call into the runtime.

These assertions are a significant cost in Go code that uses interface{}
as a safe alternative to C's void* (or unsafe.Pointer), such as the
current version of the Go compiler.

*T here includes pointer to T but also any Go type represented as
a single pointer (chan, func, map). It does not include [1]*T or struct{*int}.
That requires more work in other parts of the compiler; there is a TODO.

Change-Id: I7ff681c20d2c3eb6ad11dd7b3a37b1f3dda23965
Reviewed-on: https://go-review.googlesource.com/7862
Reviewed-by: Rob Pike <r@golang.org>
2015-03-20 20:05:37 +00:00
..
embed1.dir test: convert tests to run.go whenever possible. 2012-10-10 22:35:27 +02:00
private.dir test: convert tests to run.go whenever possible. 2012-10-10 22:35:27 +02:00
recursive1.dir test: convert tests to run.go whenever possible. 2012-10-10 22:35:27 +02:00
assertinline.go cmd/internal/gc: inline x := y.(*T) and x, ok := y.(*T) 2015-03-20 20:05:37 +00:00
bigdata.go test/interface: document tests 2012-02-19 17:33:41 +11:00
convert1.go test/interface: document tests 2012-02-19 17:33:41 +11:00
convert2.go test/interface: document tests 2012-02-19 17:33:41 +11:00
convert.go test/interface: document tests 2012-02-19 17:33:41 +11:00
embed1.go test: convert tests to run.go whenever possible. 2012-10-10 22:35:27 +02:00
embed2.go test/interface: document tests 2012-02-19 17:33:41 +11:00
embed.go test/interface: document tests 2012-02-19 17:33:41 +11:00
explicit.go cmd/gc: blank methods are not permitted in interface types 2014-10-15 09:55:13 -07:00
fail.go cmd/gc: blank methods are not permitted in interface types 2014-10-15 09:55:13 -07:00
fake.go test/interface: document tests 2012-02-19 17:33:41 +11:00
noeq.go test/interface: document tests 2012-02-19 17:33:41 +11:00
pointer.go test/interface: document tests 2012-02-19 17:33:41 +11:00
private.go test: convert tests to run.go whenever possible. 2012-10-10 22:35:27 +02:00
receiver1.go test/interface: document tests 2012-02-19 17:33:41 +11:00
receiver.go test/interface: document tests 2012-02-19 17:33:41 +11:00
recursive1.go test: convert tests to run.go whenever possible. 2012-10-10 22:35:27 +02:00
recursive.go test: use testlib (another bunch). 2012-02-18 22:15:42 +01:00
returntype.go test/interface: document tests 2012-02-19 17:33:41 +11:00
struct.go test/interface: document tests 2012-02-19 17:33:41 +11:00