aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/plugin.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2017-01-03 16:15:38 -0800
committerKeith Randall <khr@golang.org>2017-02-13 18:16:31 +0000
commit5a75d6a08ebb727c0e2bf5c8fbcbc104d260d302 (patch)
tree7fa0fe7218a250e9636b7bcbb487a8cd8e765907 /src/runtime/plugin.go
parentee2f5fafd88b5ce1404fa40e3645a409e9630897 (diff)
downloadgo-5a75d6a08ebb727c0e2bf5c8fbcbc104d260d302.tar.gz
go-5a75d6a08ebb727c0e2bf5c8fbcbc104d260d302.zip
cmd/compile: optimize non-empty-interface type conversions
When doing i.(T) for non-empty-interface i and concrete type T, there's no need to read the type out of the itab. Just compare the itab to the itab we expect for that interface/type pair. Also optimize type switches by putting the type hash of the concrete type in the itab. That way we don't need to load the type pointer out of the itab. Update #18492 Change-Id: I49e280a21e5687e771db5b8a56b685291ac168ce Reviewed-on: https://go-review.googlesource.com/34810 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/plugin.go')
-rw-r--r--src/runtime/plugin.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/plugin.go b/src/runtime/plugin.go
index 8edb29c9fe..ea246509cc 100644
--- a/src/runtime/plugin.go
+++ b/src/runtime/plugin.go
@@ -56,7 +56,7 @@ func plugin_lastmoduleinit() (path string, syms map[string]interface{}, mismatch
lock(&ifaceLock)
for _, i := range md.itablinks {
- if i.inhash == 0 {
+ if !i.inhash {
additab(i, true, false)
}
}