mirror of https://github.com/golang/go.git
cmd/compile: update bottomUpVisitor.visit comments
Change-Id: I83a62b15c5946cfe61afc53c2c528aa3a62f815e Reviewed-on: https://go-review.googlesource.com/c/go/+/429975 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
65deb9c3ce
commit
7ed6073da0
|
|
@ -103,16 +103,13 @@ func (v *bottomUpVisitor) visit(n *Func) uint32 {
|
||||||
if (min == id || min == id+1) && !n.IsHiddenClosure() {
|
if (min == id || min == id+1) && !n.IsHiddenClosure() {
|
||||||
// This node is the root of a strongly connected component.
|
// This node is the root of a strongly connected component.
|
||||||
|
|
||||||
// The original min passed to visitcodelist was v.nodeID[n]+1.
|
// The original min was id+1. If the bottomUpVisitor found its way
|
||||||
// If visitcodelist found its way back to v.nodeID[n], then this
|
// back to id, then this block is a set of mutually recursive functions.
|
||||||
// block is a set of mutually recursive functions.
|
// Otherwise, it's just a lone function that does not recurse.
|
||||||
// Otherwise it's just a lone function that does not recurse.
|
|
||||||
recursive := min == id
|
recursive := min == id
|
||||||
|
|
||||||
// Remove connected component from stack.
|
// Remove connected component from stack and mark v.nodeID so that future
|
||||||
// Mark walkgen so that future visits return a large number
|
// visits return a large number, which will not affect the caller's min.
|
||||||
// so as not to affect the caller's min.
|
|
||||||
|
|
||||||
var i int
|
var i int
|
||||||
for i = len(v.stack) - 1; i >= 0; i-- {
|
for i = len(v.stack) - 1; i >= 0; i-- {
|
||||||
x := v.stack[i]
|
x := v.stack[i]
|
||||||
|
|
@ -122,7 +119,7 @@ func (v *bottomUpVisitor) visit(n *Func) uint32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
block := v.stack[i:]
|
block := v.stack[i:]
|
||||||
// Run escape analysis on this set of functions.
|
// Call analyze on this set of functions.
|
||||||
v.stack = v.stack[:i]
|
v.stack = v.stack[:i]
|
||||||
v.analyze(block, recursive)
|
v.analyze(block, recursive)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue