]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: enable panic+recover adjustment for some ABI wrappers
authorCherry Zhang <cherryyz@google.com>
Sun, 4 Apr 2021 16:59:49 +0000 (12:59 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 5 Apr 2021 22:38:48 +0000 (22:38 +0000)
commit0723f062ff906902c44086476f95016e50164c53
tree66dae5097383e7c38716f73893995247d3373e29
parent79b2e14b1a08d5c5a6a6153c5fa85b6cab0fcbf4
cmd/compile: enable panic+recover adjustment for some ABI wrappers

For most ABI wrappers we don't need it because we're never going
to defer an ABI wrapper for a function that then recovers, so
that's would just be unnecessary code in the ABI wrapper.

However, for functions that could be on the path of invoking a
deferred function that can recover (runtime.reflectcall,
reflect.callReflect, and reflect.callMethod), we do want the
panic+recover adjustment. Set the Wrapper flag for them.

Currently, those functions are defined as ABIInternal to avoid
the ABI wrappers. But the assembly code still follows ABI0
calling convention, which would not work with the register-based
calling convention. In particlar, it is not possible to make
runtime.reflectcall ABIInternal, because it tail calls
runtime.callNN functions, which are splittable. Later CLs will
make them ABI0 and use the wrappers.

Updates #40724.

Change-Id: Ic7a45bbc6f726d29b5cb4932951a9d71578dcaf6
Reviewed-on: https://go-review.googlesource.com/c/go/+/307236
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/compile/internal/ssagen/abi.go