]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: simplify SSA devirtualization
authorMatthew Dempsky <mdempsky@google.com>
Mon, 14 Jun 2021 23:26:26 +0000 (16:26 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 16 Jun 2021 20:57:38 +0000 (20:57 +0000)
commitdd95a4e3dbe1e060b59840efd7311e8d5e82c08c
treee0f6e1be69b34bee04d9c415c0cd8ff50c95bb69
parent132ea56d292eac0226eef4bc32d784b0300c3bce
[dev.typeparams] cmd/compile: simplify SSA devirtualization

This CL implements a few improvements to SSA devirtualization to make
it simpler and more general:

1. Change reflectdata.ITabAddr to now immediately generate the wrapper
functions and write out the itab symbol data. Previously, these were
each handled by separate phases later on.

2. Removes the hack in typecheck where we marked itabs that we
expected to need later. Instead, the calls to ITabAddr in walk now
handle generating the wrappers.

3. Changes the SSA interface call devirtualization algorithm to just
use the itab symbol data (namely, its relocations) to figure out what
pointer is available in memory at the given offset. This decouples it
somewhat from reflectdata.

Change-Id: I8fe06922af8f8a1e7c93f5aff2b60ff59b8e7114
Reviewed-on: https://go-review.googlesource.com/c/go/+/327871
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/escape/escape.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/typecheck/subr.go
src/cmd/compile/internal/typecheck/typecheck.go