]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: move call logic from order.go to escape
authorMatthew Dempsky <mdempsky@google.com>
Tue, 22 Jun 2021 05:35:01 +0000 (22:35 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 23 Jun 2021 16:48:12 +0000 (16:48 +0000)
commit0a0e3a3dea72d8d64d4250c9f7649da3b942eae5
tree51f1ffadaf7deffbee7093cfa49a9e20d330f807
parent574ec1c6457c7779cd20db873fef2e2ed7e31ff1
[dev.typeparams] cmd/compile: move call logic from order.go to escape

This CL moves two bits of related code from order.go to escape
analysis:

1. The recognition of "unsafe uintptr" arguments passed to
syscall-like functions.

2. The wrapping of go/defer function calls in parameter-free function
literals.

As with previous CLs, it would be nice to push this logic even further
forward, but for now escape analysis seems most pragmatic.

A couple side benefits:

1. It allows getting rid of the uintptrEscapesHack kludge.

2. When inserting wrappers, we can move some expressions into the
wrapper and escape analyze them better. For example, the test
expectation changes are all due to slice literals in go/defer calls
where the slice is now constructed at the call site, and can now be
stack allocated.

Change-Id: I73679bcad7fa8d61d2fc52d4cea0dc5ff0de8c0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/330330
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/escape/call.go
src/cmd/compile/internal/escape/escape.go
src/cmd/compile/internal/escape/expr.go
src/cmd/compile/internal/escape/graph.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/walk/order.go
src/cmd/compile/internal/walk/stmt.go
test/escape2.go
test/escape2n.go
test/fixedbugs/issue31573.go