aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2023-07-27 16:20:36 -0700
committerMatthew Dempsky <mdempsky@google.com>2023-07-31 16:52:06 +0000
commit9eb1d5317b2b87c379797edf0dea48e59c9ebc7d (patch)
tree6755df958451b71b9d75ff549b6b76a0eb34bcd7 /src/runtime/stack.go
parent6eaad824e56aec91266854bf7890a94c3f08b614 (diff)
downloadgo-9eb1d5317b2b87c379797edf0dea48e59c9ebc7d.tar.xz
runtime: refactor defer processing
This CL refactors gopanic, Goexit, and deferreturn to share a common state machine for processing pending defers. The new state machine removes a lot of redundant code and does overall less work. It should also make it easier to implement further optimizations (e.g., TODOs added in this CL). Change-Id: I71d3cc8878a6f951d8633505424a191536c8e6b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/513837 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/stack.go')
-rw-r--r--src/runtime/stack.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index 45d66da91f..903b096f08 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -763,10 +763,7 @@ func adjustdefers(gp *g, adjinfo *adjustinfo) {
for d := gp._defer; d != nil; d = d.link {
adjustpointer(adjinfo, unsafe.Pointer(&d.fn))
adjustpointer(adjinfo, unsafe.Pointer(&d.sp))
- adjustpointer(adjinfo, unsafe.Pointer(&d._panic))
adjustpointer(adjinfo, unsafe.Pointer(&d.link))
- adjustpointer(adjinfo, unsafe.Pointer(&d.varp))
- adjustpointer(adjinfo, unsafe.Pointer(&d.fd))
}
}