]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: early devirtualization of interface method calls
authorMatthew Dempsky <mdempsky@google.com>
Thu, 29 Oct 2020 01:49:10 +0000 (18:49 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 29 Oct 2020 19:06:32 +0000 (19:06 +0000)
commit5cc43c51c9929ce089ce2fc17a0f5631d21cd27d
treed6da90485c9da69adba6546839390c871e865144
parentf2c0c2b90200b470c39a2db821b7c707604fe083
cmd/compile: early devirtualization of interface method calls

After inlining, add a pass that looks for interface calls where we can
statically determine the interface value's concrete type. If such a
case is found, insert an explicit type assertion to the concrete type
so that escape analysis can see it.

Fixes #33160.

Change-Id: I36932c691693f0069e34384086d63133e249b06b
Reviewed-on: https://go-review.googlesource.com/c/go/+/264837
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/main.go
test/escape_iface.go