summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/transform.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2021-10-21 18:09:07 -0700
committerKeith Randall <khr@golang.org>2021-10-25 20:40:00 +0000
commit72b6a89ca5cd3c3bfd13b9b17be976e8feb91ecc (patch)
tree33ae337d469279e66244406c6e2c506aefdaa41b /src/cmd/compile/internal/noder/transform.go
parent0ae0d5c62eae1a4043d1d9cb41acc563a5e75daa (diff)
downloadgo-git-72b6a89ca5cd3c3bfd13b9b17be976e8feb91ecc.tar.gz
cmd/compile: revert most of CL 349169
The method of using references to dictionaries to hold methods live during linker deadcode elimination wasn't working very well. I implemented a new scheme in the CL below this, so this CL strips out the old method. The new method has the added benefit of having 0 runtime overhead (unlike the stuff we're ripping out here, which does have a small overhead). Update #48047 Change-Id: I68ac57119792d53c58f1480f407de6ab2bb53211 Reviewed-on: https://go-review.googlesource.com/c/go/+/357836 Trust: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/noder/transform.go')
-rw-r--r--src/cmd/compile/internal/noder/transform.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/cmd/compile/internal/noder/transform.go b/src/cmd/compile/internal/noder/transform.go
index 29ee601d82..47e6397206 100644
--- a/src/cmd/compile/internal/noder/transform.go
+++ b/src/cmd/compile/internal/noder/transform.go
@@ -132,9 +132,7 @@ func transformConvCall(n *ir.CallExpr) ir.Node {
// transformCall transforms a normal function/method call. Corresponds to last half
// (non-conversion, non-builtin part) of typecheck.tcCall. This code should work even
// in the case of OCALL/OFUNCINST.
-// The dict parameter is used for OCALLINTER nodes to ensure that the called method
-// is retained by the linker.
-func transformCall(n *ir.CallExpr, dict *ir.Name) {
+func transformCall(n *ir.CallExpr) {
// n.Type() can be nil for calls with no return value
assert(n.Typecheck() == 1)
transformArgs(n)
@@ -144,17 +142,6 @@ func transformCall(n *ir.CallExpr, dict *ir.Name) {
switch l.Op() {
case ir.ODOTINTER:
n.SetOp(ir.OCALLINTER)
- if n.X.(*ir.SelectorExpr).X.Type().HasShape() {
- if dict == nil {
- base.Fatalf("calls on shape interfaces need a dictionary reference")
- }
- dict.SetAddrtaken(true)
- // KeepAlive isn't exactly the right thing here, as we only
- // need to keep the dictionary live in the linker-deadcode
- // sense, not the at-runtime sense. But the at-runtime sense
- // is stronger, so it works. See issue 48047.
- n.KeepAlive = append(n.KeepAlive, dict)
- }
case ir.ODOTMETH:
l := l.(*ir.SelectorExpr)