aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/iface.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@golang.org>2016-04-07 16:29:16 -0400
committerDavid Crawshaw <crawshaw@golang.org>2016-04-22 10:08:05 +0000
commit1492e7db059ea7903110b0725d5ced3134558e73 (patch)
tree55b92fbd4305828b28b431a2d05f0291ca932af1 /src/runtime/iface.go
parentbb52ceafea60dc4688b6c6b71f241752ce597db8 (diff)
downloadgo-1492e7db059ea7903110b0725d5ced3134558e73.tar.gz
go-1492e7db059ea7903110b0725d5ced3134558e73.zip
cmd/compile, etc: use nameOff for rtype string
linux/amd64: cmd/go: -8KB (basically nothing) linux/amd64 PIE: cmd/go: -191KB (1.6%) jujud: -1.5MB (1.9%) Updates #6853 Fixes #15064 Change-Id: I0adbb95685e28be92e8548741df0e11daa0a9b5f Reviewed-on: https://go-review.googlesource.com/21777 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/iface.go')
-rw-r--r--src/runtime/iface.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/runtime/iface.go b/src/runtime/iface.go
index 352ff77465..007c1ed174 100644
--- a/src/runtime/iface.go
+++ b/src/runtime/iface.go
@@ -38,7 +38,7 @@ func getitab(inter *interfacetype, typ *_type, canfail bool) *itab {
return nil
}
name := inter.typ.nameOff(inter.mhdr[0].name)
- panic(&TypeAssertionError{"", typ._string, inter.typ._string, name.name()})
+ panic(&TypeAssertionError{"", typ.string(), inter.typ.string(), name.name()})
}
h := itabhash(inter, typ)
@@ -128,7 +128,7 @@ func additab(m *itab, locked, canfail bool) {
if locked {
unlock(&ifaceLock)
}
- panic(&TypeAssertionError{"", typ._string, inter.typ._string, iname})
+ panic(&TypeAssertionError{"", typ.string(), inter.typ.string(), iname})
}
m.bad = 1
break
@@ -196,18 +196,18 @@ func convT2I(tab *itab, elem unsafe.Pointer, x unsafe.Pointer) (i iface) {
func panicdottype(have, want, iface *_type) {
haveString := ""
if have != nil {
- haveString = have._string
+ haveString = have.string()
}
- panic(&TypeAssertionError{iface._string, haveString, want._string, ""})
+ panic(&TypeAssertionError{iface.string(), haveString, want.string(), ""})
}
func assertI2T(t *_type, i iface, r unsafe.Pointer) {
tab := i.tab
if tab == nil {
- panic(&TypeAssertionError{"", "", t._string, ""})
+ panic(&TypeAssertionError{"", "", t.string(), ""})
}
if tab._type != t {
- panic(&TypeAssertionError{tab.inter.typ._string, tab._type._string, t._string, ""})
+ panic(&TypeAssertionError{tab.inter.typ.string(), tab._type.string(), t.string(), ""})
}
if r != nil {
if isDirectIface(t) {
@@ -238,10 +238,10 @@ func assertI2T2(t *_type, i iface, r unsafe.Pointer) bool {
func assertE2T(t *_type, e eface, r unsafe.Pointer) {
if e._type == nil {
- panic(&TypeAssertionError{"", "", t._string, ""})
+ panic(&TypeAssertionError{"", "", t.string(), ""})
}
if e._type != t {
- panic(&TypeAssertionError{"", e._type._string, t._string, ""})
+ panic(&TypeAssertionError{"", e._type.string(), t.string(), ""})
}
if r != nil {
if isDirectIface(t) {
@@ -285,7 +285,7 @@ func assertI2E(inter *interfacetype, i iface, r *eface) {
tab := i.tab
if tab == nil {
// explicit conversions require non-nil interface value.
- panic(&TypeAssertionError{"", "", inter.typ._string, ""})
+ panic(&TypeAssertionError{"", "", inter.typ.string(), ""})
}
r._type = tab._type
r.data = i.data
@@ -322,7 +322,7 @@ func assertI2I(inter *interfacetype, i iface, r *iface) {
tab := i.tab
if tab == nil {
// explicit conversions require non-nil interface value.
- panic(&TypeAssertionError{"", "", inter.typ._string, ""})
+ panic(&TypeAssertionError{"", "", inter.typ.string(), ""})
}
if tab.inter == inter {
r.tab = tab
@@ -361,7 +361,7 @@ func assertE2I(inter *interfacetype, e eface, r *iface) {
t := e._type
if t == nil {
// explicit conversions require non-nil interface value.
- panic(&TypeAssertionError{"", "", inter.typ._string, ""})
+ panic(&TypeAssertionError{"", "", inter.typ.string(), ""})
}
r.tab = getitab(inter, t, false)
r.data = e.data
@@ -402,7 +402,7 @@ func reflect_ifaceE2I(inter *interfacetype, e eface, dst *iface) {
func assertE2E(inter *interfacetype, e eface, r *eface) {
if e._type == nil {
// explicit conversions require non-nil interface value.
- panic(&TypeAssertionError{"", "", inter.typ._string, ""})
+ panic(&TypeAssertionError{"", "", inter.typ.string(), ""})
}
*r = e
}