aboutsummaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-12-13 12:46:39 -0800
committerKeith Randall <khr@golang.org>2024-02-16 20:24:57 +0000
commitf2db96cd6ca96adf7717761194811dd07019b78e (patch)
tree6707bcbb5598afbba49b74afc86cf89094408bc1 /src/reflect
parente4ebd13f7a6f216f7ddbaa1f2a3c97fd10bc3d23 (diff)
downloadgo-f2db96cd6ca96adf7717761194811dd07019b78e.tar.gz
go-f2db96cd6ca96adf7717761194811dd07019b78e.zip
reflect: use internal/abi itab type
Change-Id: I4a40d9cda41d3601169ef0daf0f25fb1509bdcb7 Reviewed-on: https://go-review.googlesource.com/c/go/+/549458 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/value.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/reflect/value.go b/src/reflect/value.go
index 60ba79a6e6..87e595155b 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -208,14 +208,7 @@ type emptyInterface struct {
// nonEmptyInterface is the header for an interface value with methods.
type nonEmptyInterface struct {
- // see ../runtime/iface.go:/Itab
- itab *struct {
- ityp *abi.Type // static interface type
- typ *abi.Type // dynamic concrete type
- hash uint32 // copy of typ.hash
- _ [4]byte
- fun [100000]unsafe.Pointer // method table
- }
+ itab *abi.ITab
word unsafe.Pointer
}
@@ -897,8 +890,8 @@ func methodReceiver(op string, v Value, methodIndex int) (rcvrtype *abi.Type, t
if iface.itab == nil {
panic("reflect: " + op + " of method on nil interface value")
}
- rcvrtype = iface.itab.typ
- fn = unsafe.Pointer(&iface.itab.fun[i])
+ rcvrtype = iface.itab.Type
+ fn = unsafe.Pointer(&unsafe.Slice(&iface.itab.Fun[0], i+1)[i])
t = (*funcType)(unsafe.Pointer(tt.typeOff(m.Typ)))
} else {
rcvrtype = v.typ()