Commit 991b0fd4 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: remove -newescape flag

Drops support for old escape analysis pass. Subsequent, separate CL
will remove dead code.

While here, fix a minor error in fmt.go: it was still looking for
esc.go's NodeEscState in n.Opt() rather than escape.go's EscLocation.
But this only affected debug diagnostics printed during escape
analysis itself.

Change-Id: I62512e1b31c75ba0577550a5fd7824abc3159ed5
Reviewed-on: https://go-review.googlesource.com/c/go/+/187597Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 501b786e
...@@ -41,19 +41,8 @@ import ( ...@@ -41,19 +41,8 @@ import (
// not escape, then new(T) can be rewritten into a stack allocation. // not escape, then new(T) can be rewritten into a stack allocation.
// The same is true of slice literals. // The same is true of slice literals.
// If newescape is true, then escape.go drives escape analysis instead
// of esc.go.
var newescape bool
func escapes(all []*Node) { func escapes(all []*Node) {
visitBottomUp(all, escapeImpl()) visitBottomUp(all, escapeFuncs)
}
func escapeImpl() func([]*Node, bool) {
if newescape {
return escapeFuncs
}
return escAnalyze
} }
const ( const (
......
...@@ -457,8 +457,8 @@ func (n *Node) jconv(s fmt.State, flag FmtFlag) { ...@@ -457,8 +457,8 @@ func (n *Node) jconv(s fmt.State, flag FmtFlag) {
fmt.Fprintf(s, " esc(%d)", n.Esc) fmt.Fprintf(s, " esc(%d)", n.Esc)
} }
if e, ok := n.Opt().(*NodeEscState); ok && e.Loopdepth != 0 { if e, ok := n.Opt().(*EscLocation); ok && e.loopDepth != 0 {
fmt.Fprintf(s, " ld(%d)", e.Loopdepth) fmt.Fprintf(s, " ld(%d)", e.loopDepth)
} }
if c == 0 && n.Typecheck() != 0 { if c == 0 && n.Typecheck() != 0 {
......
...@@ -263,7 +263,6 @@ func Main(archInit func(*Arch)) { ...@@ -263,7 +263,6 @@ func Main(archInit func(*Arch)) {
flag.StringVar(&blockprofile, "blockprofile", "", "write block profile to `file`") flag.StringVar(&blockprofile, "blockprofile", "", "write block profile to `file`")
flag.StringVar(&mutexprofile, "mutexprofile", "", "write mutex profile to `file`") flag.StringVar(&mutexprofile, "mutexprofile", "", "write mutex profile to `file`")
flag.StringVar(&benchfile, "bench", "", "append benchmark times to `file`") flag.StringVar(&benchfile, "bench", "", "append benchmark times to `file`")
flag.BoolVar(&newescape, "newescape", true, "enable new escape analysis")
flag.BoolVar(&smallFrames, "smallframes", false, "reduce the size limit for stack allocated objects") flag.BoolVar(&smallFrames, "smallframes", false, "reduce the size limit for stack allocated objects")
flag.BoolVar(&Ctxt.UseBASEntries, "dwarfbasentries", Ctxt.UseBASEntries, "use base address selection entries in DWARF") flag.BoolVar(&Ctxt.UseBASEntries, "dwarfbasentries", Ctxt.UseBASEntries, "use base address selection entries in DWARF")
objabi.Flagparse(usage) objabi.Flagparse(usage)
...@@ -271,7 +270,7 @@ func Main(archInit func(*Arch)) { ...@@ -271,7 +270,7 @@ func Main(archInit func(*Arch)) {
// Record flags that affect the build result. (And don't // Record flags that affect the build result. (And don't
// record flags that don't, since that would cause spurious // record flags that don't, since that would cause spurious
// changes in the binary.) // changes in the binary.)
recordFlags("B", "N", "l", "msan", "race", "shared", "dynlink", "dwarflocationlists", "newescape", "dwarfbasentries", "smallframes") recordFlags("B", "N", "l", "msan", "race", "shared", "dynlink", "dwarflocationlists", "dwarfbasentries", "smallframes")
if smallFrames { if smallFrames {
maxStackVarSize = 128 * 1024 maxStackVarSize = 128 * 1024
......
...@@ -1579,7 +1579,7 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) { ...@@ -1579,7 +1579,7 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) {
if rcvr.IsPtr() && rcvr.Elem() == method.Type.Recv().Type && rcvr.Elem().Sym != nil { if rcvr.IsPtr() && rcvr.Elem() == method.Type.Recv().Type && rcvr.Elem().Sym != nil {
inlcalls(fn) inlcalls(fn)
} }
escapeImpl()([]*Node{fn}, false) escapeFuncs([]*Node{fn}, false)
Curfn = nil Curfn = nil
funccompile(fn) funccompile(fn)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment