aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2019-06-05 18:42:31 +0000
committerKeith Randall <khr@golang.org>2019-06-05 19:50:09 +0000
commit49200e3f3e61f505acb152e150d054ef1db03b3e (patch)
treea0449ffcfb21af960ab9053eac39e6e42318b34e /src/runtime/stack.go
parente9a136d185af8dcdb270096af520087c92c8b4af (diff)
downloadgo-49200e3f3e61f505acb152e150d054ef1db03b3e.tar.xz
Revert "cmd/compile,runtime: allocate defer records on the stack"
This reverts commit fff4f599fe1c21e411a99de5c9b3777d06ce0ce6. Reason for revert: Seems to still have issues around GC. Fixes #32452 Change-Id: Ibe7af629f9ad6a3d5312acd7b066123f484da7f0 Reviewed-on: https://go-review.googlesource.com/c/go/+/180761 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/runtime/stack.go')
-rw-r--r--src/runtime/stack.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index c32d9e8042..d5d09ba7d7 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -719,21 +719,16 @@ func adjustctxt(gp *g, adjinfo *adjustinfo) {
}
func adjustdefers(gp *g, adjinfo *adjustinfo) {
+ // Adjust defer argument blocks the same way we adjust active stack frames.
+ tracebackdefers(gp, adjustframe, noescape(unsafe.Pointer(adjinfo)))
+
// Adjust pointers in the Defer structs.
- // We need to do this first because we need to adjust the
- // defer.link fields so we always work on the new stack.
- adjustpointer(adjinfo, unsafe.Pointer(&gp._defer))
+ // Defer structs themselves are never on the stack.
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))
}
-
- // Adjust defer argument blocks the same way we adjust active stack frames.
- // Note: this code is after the loop above, so that if a defer record is
- // stack allocated, we work on the copy in the new stack.
- tracebackdefers(gp, adjustframe, noescape(unsafe.Pointer(adjinfo)))
}
func adjustpanics(gp *g, adjinfo *adjustinfo) {