From f0e347b1a8161c41be9dbcfe5db5e4e4dae57cfd Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Fri, 21 Oct 2016 19:43:33 +0000 Subject: [PATCH] Revert "cmd/compile: cleanup toolstash hacks from previous CL" This partially reverts commit 01bf5cc21912ff8642171d8255a7fff87f1da00b. For unknown reasons, this CL was causing an internal test to allocate 1.2GB when it used to allocate less than 300MB. Change-Id: I41d767781e0ae9e43bf670e2a186ee074821eca4 Reviewed-on: https://go-review.googlesource.com/31674 Reviewed-by: Matthew Dempsky Run-TryBot: Joe Tsai TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/inl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index 9a8dede50d..20d0d6ace1 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -248,6 +248,10 @@ func ishairy(n *Node, budget *int32, reason *string) bool { } (*budget)-- + // TODO(mdempsky): Hack to appease toolstash; remove. + if n.Op == OSTRUCTKEY { + (*budget)-- + } return *budget < 0 || ishairy(n.Left, budget, reason) || ishairy(n.Right, budget, reason) || ishairylist(n.List, budget, reason) || ishairylist(n.Rlist, budget, reason) || -- 2.48.1