]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: only inline method wrapper if method don't contain closures
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 29 Aug 2022 03:48:28 +0000 (10:48 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 30 Aug 2022 18:02:22 +0000 (18:02 +0000)
commitf21514c7f8c972ce2291d41cf5b6263f0eb350c7
tree543821935ef63fdf19395137ef40e4b2d6531ff4
parentddc93a536faf4576d182cd3197b116d61d05c484
cmd/compile: only inline method wrapper if method don't contain closures

CL 327871 changes methodWrapper to always perform inlining after global
escape analysis. However, inlining the method may reveal closures, which
require walking all function bodies to decide whether to capture free
variables by value or by ref.

To fix it, just not doing inline if the method contains any closures.

Fixes #53702

Change-Id: I4b0255b86257cc6fe7e5fafbc545cc5cff9113e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/426334
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/cmd/compile/internal/reflectdata/reflect.go
test/run.go