[go] cmd/compile: update bottomUpVisitor.visit comments

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Sep 23, 2022, 11:09:52 AM9/23/22
to Cuong Manh Le, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Cherry Mui, Matthew Dempsky, David Chase, golang-co...@googlegroups.com

Gopher Robot submitted this change.

View Change


Approvals: Matthew Dempsky: Looks good to me, approved Cherry Mui: Looks good to me, approved Cuong Manh Le: Run TryBots; Automatically submit change Gopher Robot: TryBots succeeded
cmd/compile: update bottomUpVisitor.visit comments

Change-Id: I83a62b15c5946cfe61afc53c2c528aa3a62f815e
Reviewed-on: https://go-review.googlesource.com/c/go/+/429975
Reviewed-by: Matthew Dempsky <mdem...@google.com>
Reviewed-by: Cherry Mui <cher...@google.com>
TryBot-Result: Gopher Robot <go...@golang.org>
Auto-Submit: Cuong Manh Le <cuong.m...@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.m...@gmail.com>
---
M src/cmd/compile/internal/ir/scc.go
1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/cmd/compile/internal/ir/scc.go b/src/cmd/compile/internal/ir/scc.go
index a42951c..b222939 100644
--- a/src/cmd/compile/internal/ir/scc.go
+++ b/src/cmd/compile/internal/ir/scc.go
@@ -103,16 +103,13 @@
if (min == id || min == id+1) && !n.IsHiddenClosure() {
// This node is the root of a strongly connected component.

- // The original min passed to visitcodelist was v.nodeID[n]+1.
- // If visitcodelist found its way back to v.nodeID[n], then this
- // block is a set of mutually recursive functions.
- // Otherwise it's just a lone function that does not recurse.
+ // The original min was id+1. If the bottomUpVisitor found its way
+ // back to id, then this block is a set of mutually recursive functions.
+ // Otherwise, it's just a lone function that does not recurse.
recursive := min == id

- // Remove connected component from stack.
- // Mark walkgen so that future visits return a large number
- // so as not to affect the caller's min.
-
+ // Remove connected component from stack and mark v.nodeID so that future
+ // visits return a large number, which will not affect the caller's min.
var i int
for i = len(v.stack) - 1; i >= 0; i-- {
x := v.stack[i]
@@ -122,7 +119,7 @@
}
}
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.analyze(block, recursive)
}

To view, visit change 429975. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I83a62b15c5946cfe61afc53c2c528aa3a62f815e
Gerrit-Change-Number: 429975
Gerrit-PatchSet: 3
Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages