]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: bind closure vars during SSA constructions
authorMatthew Dempsky <mdempsky@google.com>
Mon, 4 Jan 2021 05:34:03 +0000 (21:34 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Sun, 10 Jan 2021 08:02:06 +0000 (08:02 +0000)
commit950cf4d46c5bc343644e7ef08828b9e5114d4676
tree2eea4d51d8b938db59897470969a307d065fb160
parent8b2efa990b08e6c32422fbfdab746f4f6948ae42
[dev.regabi] cmd/compile: bind closure vars during SSA constructions

For function literals that aren't inlined or directly called, we need
to pass their arguments via a closure struct. This also means we need
to rewrite uses of closure variables to access from this closure
struct.

Currently we do this rewrite in a pass before walking begins. This CL
moves the code to SSA construction instead, alongside binding other
input parameters.

Change-Id: I13538ef3394e2d6f75d5b7b2d0adbb00db812dc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/281352
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/walk/closure.go