]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: record InlCost in export data
authorMatthew Dempsky <mdempsky@google.com>
Wed, 11 Oct 2017 22:25:13 +0000 (15:25 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 11 Oct 2017 23:20:44 +0000 (23:20 +0000)
commita509cae90d93aec3f1c33c9de445721c0bc7c509
tree7e18fb83abe57eab1bcb9df0581a45f4ef379ba9
parent1fbeccb15a56957919e087639e255b4df64062f1
cmd/compile: record InlCost in export data

Previously, we were treating cross-package function calls as free for
inlining budgeting.

In theory, we should be able to recompute InlCost from the
exported/reimported function bodies. However, that process mutates the
structure of the Node AST enough that it doesn't preserve InlCost. To
avoid unexpected issues, just record and restore InlCost in the export
data.

Fixes #19261.

Change-Id: Iac2bc0d32d4f948b64524aca657051f9fc96d92d
Reviewed-on: https://go-review.googlesource.com/70151
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go
test/fixedbugs/issue19261.dir/p.go [new file with mode: 0644]
test/fixedbugs/issue19261.dir/q.go [new file with mode: 0644]
test/fixedbugs/issue19261.go [new file with mode: 0644]