]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: untangle Wrapper and ABIWrapper flags
authorCherry Zhang <cherryyz@google.com>
Sun, 4 Apr 2021 16:46:21 +0000 (12:46 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 5 Apr 2021 17:27:18 +0000 (17:27 +0000)
commit5cc5576a9cff098e6e47397ee32cb250de43d814
treea77aee03cf376effa735a623bf924b0d98046875
parent45e87cd3ecfe5e579a06493ef8cd43ce9947262c
cmd/compile: untangle Wrapper and ABIWrapper flags

Currently, there are Wrapper and ABIWrapper attributes. Wrapper
is set when compiler generates an wrapper function (e.g. method
wrapper). ABIWrapper is set when compiler generates an ABI
wrapper. It also sets Wrapper flag for ABI wrappers.

Currently, they have the following meanings:
- Wrapper flag hides the frame from (normal) traceback.
- Wrapper flag enables special panic+recover adjustment, so it
  can correctly recover when a wrapper function is deferred.
- ABIWrapper flag disables the panic+recover adjustment, because
  we never defer an ABI wrapper that can recover.

This CL changes them to:
- Both Wrapper and ABIWrapper flags hide the frame from (normal)
  traceback. (Setting one is enough.)
- Wrapper flag enables special panic+recover adjustment.
  ABIWrapper flag no longer has effect on this.

This makes it clearer if we do want an ABI wrapper that also does
the panic+recover adjustment. In the old mechanism we'd have to
unset ABIWrapper flag, even if the function is actually an ABI
wrapper. In the new mechanism we just need to set both ABIWrapper
and Wrapper flags.

Updates #40724.

Change-Id: I7fbc83f85d23676dc94db51dfda63dcacdf1fc19
Reviewed-on: https://go-review.googlesource.com/c/go/+/307235
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/compile/internal/ssagen/abi.go
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/x86/obj6.go