]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: support lookup of functions from export data
authorMichael Pratt <mpratt@google.com>
Mon, 6 Nov 2023 21:28:25 +0000 (16:28 -0500)
committerMichael Pratt <mpratt@google.com>
Mon, 13 Nov 2023 18:17:57 +0000 (18:17 +0000)
commit42bd21be1cf54876ce24c489852721049ef293e2
tree448a827e75e06d9fc2bbfdf31de73176d6e42af5
parentfb6ff1e4caaece9be61c45518ffb51081e892a73
cmd/compile: support lookup of functions from export data

As of CL 539699, PGO-based devirtualization supports devirtualization of
function values in addition to interface method calls. As with CL
497175, we need to explicitly look up functions from export data that
may not be imported already.

Symbol naming is ambiguous (`foo.Bar.func1` could be a closure or a
method), so we simply attempt to do both types of lookup. That said,
closures are defined in export data only as OCLOSURE nodes in the
enclosing function, which this CL does not yet attempt to expand.

For #61577.

Change-Id: Ic7205b046218a4dfb8c4162ece3620ed1c3cb40a
Reviewed-on: https://go-review.googlesource.com/c/go/+/540258
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/noder/unified.go
src/cmd/compile/internal/pgo/irgraph.go
src/cmd/compile/internal/test/pgo_devirtualize_test.go
src/cmd/compile/internal/test/testdata/pgo/devirtualize/devirt.go
src/cmd/compile/internal/test/testdata/pgo/devirtualize/devirt.pprof
src/cmd/compile/internal/test/testdata/pgo/devirtualize/mult.pkg/mult.go