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
..
2014-07-16 19:27:10 -04:00
2012-02-25 08:47:04 +11:00
2013-12-12 17:18:12 -08:00
2012-11-08 09:04:27 -08:00
2012-09-10 13:03:07 -07:00
2012-09-10 13:03:07 -07:00
2012-09-24 00:06:41 -04:00
2012-02-16 23:48:57 -05:00
2015-01-29 13:07:30 +00:00
2012-07-01 21:59:50 +04:00
2013-12-12 17:18:12 -08:00
2012-09-28 08:30:30 -07:00
2013-06-26 18:05:02 +02:00
2012-09-28 08:30:30 -07:00
2012-10-07 21:52:57 +02:00
2012-02-24 13:17:26 +11:00
2012-02-19 14:28:53 +11:00
2012-02-18 21:18:13 -08:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2013-12-12 17:18:12 -08:00
2013-12-12 17:18:12 -08:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-19 14:28:53 +11:00
2012-02-24 13:17:26 +11:00
2012-02-23 18:47:26 +11:00
2012-02-29 15:28:36 -05:00
2012-02-23 18:47:26 +11:00
2012-11-07 12:33:54 -08:00
2012-11-07 12:33:54 -08:00
2012-11-07 12:33:54 -08:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2015-02-26 17:36:00 +00:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2014-11-06 15:14:08 -05:00
2012-02-23 18:47:26 +11:00
2012-06-07 03:06:40 -04:00
2014-10-27 18:59:02 -04:00
2012-02-23 18:47:26 +11:00
2012-02-23 18:47:26 +11:00
2013-03-20 17:11:09 -04:00
2013-02-11 18:20:52 -05:00
2012-02-21 22:54:07 -05:00
2013-09-05 23:06:34 -04:00
2012-11-08 09:04:27 -08:00
2012-02-24 10:30:39 +11:00
2012-02-24 10:30:39 +11:00
2012-02-24 13:17:26 +11:00
2014-07-16 19:27:10 -04:00
2012-02-16 23:51:04 -05:00
2012-02-16 23:51:04 -05:00
2014-10-22 08:06:15 -07:00
2013-02-11 18:20:52 -05:00
2015-02-19 20:14:21 +00:00
2015-02-19 20:14:21 +00:00
2015-02-19 20:14:21 +00:00
2015-02-19 20:14:21 +00:00
2012-02-24 10:30:39 +11:00
2012-02-24 10:30:39 +11:00
2012-02-24 11:48:19 +11:00
2014-01-29 09:28:23 +01:00
2012-02-24 11:48:19 +11:00
2014-11-09 21:10:49 -05:00
2014-11-06 15:14:08 -05:00
2013-06-02 19:10:11 +02:00
2013-12-12 17:18:12 -08:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00
2012-02-24 11:48:19 +11:00