From: Cherry Mui Date: Sat, 5 Jun 2021 00:07:50 +0000 (-0400) Subject: [dev.typeparams] runtime: allow deferproc split stack X-Git-Tag: go1.18beta1~1818^2^2~379 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b80a4c56f015ed51a94da6bd7bcf5bf4b0b08a27;p=gostls13.git [dev.typeparams] runtime: allow deferproc split stack deferproc was not allowed to split stack because it had a special stack layout, where the go'd function's arguments were passed on stack but not included in the signature (therefore the stack map). Now it no longer has argument, so it does not need to be nosplit. Change-Id: I6d4b5302bd6fea6642bb4202984d86e3ebbc9054 Reviewed-on: https://go-review.googlesource.com/c/go/+/325920 Trust: Cherry Mui Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Michael Knyszek --- diff --git a/src/runtime/panic.go b/src/runtime/panic.go index dc3f6956eb..5f35abc43b 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -226,7 +226,6 @@ func panicmemAddr(addr uintptr) { // Create a new deferred function fn, which has no arguments and results. // The compiler turns a defer statement into a call to this. -//go:nosplit func deferproc(fn func()) { gp := getg() if gp.m.curg != gp { @@ -234,11 +233,6 @@ func deferproc(fn func()) { throw("defer on system stack") } - // the arguments of fn are in a perilous state. The stack map - // for deferproc does not describe them. So we can't let garbage - // collection or stack copying trigger until we've copied them out - // to somewhere safe. The memmove below does that. - // Until the copy completes, we can only call nosplit routines. sp := getcallersp() callerpc := getcallerpc()