]> Cypherpunks repositories - gostls13.git/commit
runtime: refactor defer processing
authorMatthew Dempsky <mdempsky@google.com>
Thu, 27 Jul 2023 23:20:36 +0000 (16:20 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 31 Jul 2023 16:52:06 +0000 (16:52 +0000)
commit9eb1d5317b2b87c379797edf0dea48e59c9ebc7d
tree6755df958451b71b9d75ff549b6b76a0eb34bcd7
parent6eaad824e56aec91266854bf7890a94c3f08b614
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>
src/cmd/internal/objabi/funcid.go
src/runtime/panic.go
src/runtime/runtime-seh_windows_test.go
src/runtime/runtime2.go
src/runtime/stack.go