]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: simplify interface conversions
authorKeith Randall <khr@golang.org>
Thu, 5 Aug 2021 05:18:23 +0000 (22:18 -0700)
committerKeith Randall <khr@golang.org>
Mon, 9 Aug 2021 16:10:20 +0000 (16:10 +0000)
commit57668b84ff43b15746a25e9653c278d174ea483f
tree1c1c3ddfbb6618f5a5f9ed57d1874e78b2bf374b
parentd10a90471275bf2d91c4c853d7d1f75f23a70a32
[dev.typeparams] cmd/compile: simplify interface conversions

Simplify the implementation of interface conversions in the compiler.
Don't pass fields that aren't needed (the data word, usually) to the runtime.

For generics, we need to put a dynamic type in an interface. The new
dataWord function is exactly what we need (the type word will come
from a dictionary).

Change-Id: Iade5de5c174854b65ad248f35c7893c603f7be3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/340029
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/typecheck/builtin.go
src/cmd/compile/internal/typecheck/builtin/runtime.go
src/cmd/compile/internal/walk/convert.go
src/cmd/compile/internal/walk/expr.go
src/cmd/compile/internal/walk/order.go
src/runtime/iface.go
test/devirt.go
test/fixedbugs/issue20250.go
test/live.go
test/live_regabi.go