From 8ffcd3da93c9f408afaebd06ae8a21f8f770a037 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 8 Feb 2023 16:06:50 +0700 Subject: [PATCH] cmd/compile: remove reflectdata.AfterGlobalEscapeAnalysis This global variable was used by the old frontend to decide whether to perform escape analysis during method wrapper generation. The old frontend is gone now, the variable is not used anywhere else. Change-Id: I448f2761ea608a9a2ec39a9920fcf7aa12d98799 Reviewed-on: https://go-review.googlesource.com/c/go/+/466278 Reviewed-by: Matthew Dempsky Run-TryBot: Cuong Manh Le Reviewed-by: Keith Randall Auto-Submit: Cuong Manh Le TryBot-Result: Gopher Robot --- src/cmd/compile/internal/gc/main.go | 5 ----- src/cmd/compile/internal/reflectdata/reflect.go | 6 ------ 2 files changed, 11 deletions(-) diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index b2a37b9b024..3c2b9c48ec6 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -293,11 +293,6 @@ func Main(archInit func(*ssagen.ArchInfo)) { base.Timer.Start("fe", "escapes") escape.Funcs(typecheck.Target.Decls) - // TODO(mdempsky): This is a hack. We need a proper, global work - // queue for scheduling function compilation so components don't - // need to adjust their behavior depending on when they're called. - reflectdata.AfterGlobalEscapeAnalysis = true - // Collect information for go:nowritebarrierrec // checking. This must happen before transforming closures during Walk // We'll do the final check after write barriers are diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index afc3ee4fc9e..cde8c688762 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -1869,12 +1869,6 @@ func methodWrapper(rcvr *types.Type, method *types.Field, forItab bool) *obj.LSy return lsym } -// AfterGlobalEscapeAnalysis tracks whether package gc has already -// performed the main, global escape analysis pass. If so, -// methodWrapper takes responsibility for escape analyzing any -// generated wrappers. -var AfterGlobalEscapeAnalysis bool - var ZeroSize int64 // MarkTypeUsedInInterface marks that type t is converted to an interface.