-
- Downloads
[dev.unified] cmd/compile: implement simple inline body pruning heuristic
An important optimization in the existing export data format is the pruning of unreachable inline bodies. That is, when re-exporting transitively imported types, omitting the inline bodies for methods that can't actually be needed due to importing that package. The existing logic (implemented in typecheck/crawler.go) is fairly sophisticated, but also relies on actually expanding inline bodies in the process, which is undesirable. However, including all inline bodies is also prohibitive for testing GOEXPERIMENT=unified against very large Go code bases that impose size limits on build action inputs. As a short-term solution, this CL implements a simple heuristic for GOEXPERIMENT=unified: include the inline bodies for all locally-declared functions/methods, and for any imported functions/methods that were inlined into this package. Change-Id: I686964a0cd9262b77d3d5587f89cfbcfe8b2e521 Reviewed-on: https://go-review.googlesource.com/c/go/+/419675 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by:David Chase <drchase@google.com>
Showing
- src/cmd/compile/internal/noder/import.go 1 addition, 1 deletionsrc/cmd/compile/internal/noder/import.go
- src/cmd/compile/internal/noder/linker.go 63 additions, 20 deletionssrc/cmd/compile/internal/noder/linker.go
- src/cmd/compile/internal/noder/reader.go 25 additions, 10 deletionssrc/cmd/compile/internal/noder/reader.go
- src/cmd/compile/internal/noder/unified.go 72 additions, 20 deletionssrc/cmd/compile/internal/noder/unified.go
Please register or sign in to comment