From 9eb1d5317b2b87c379797edf0dea48e59c9ebc7d Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 27 Jul 2023 16:20:36 -0700 Subject: 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 Run-TryBot: Matthew Dempsky Reviewed-by: Keith Randall TryBot-Result: Gopher Robot --- src/runtime/stack.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/runtime/stack.go') 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)) } } -- cgit v1.3