[dev.typeparams] cmd/compile, runtime: remove the siz argument of newproc/deferproc

newproc/deferproc takes a siz argument for the go'd/deferred
function's argument size. Now it is always zero. Remove the
argument.

Change-Id: If1bb8d427e34015ccec0ba10dbccaae96757fa8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/325917
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Cherry Mui 2021-06-04 18:11:59 -04:00
parent 00d01b5786
commit 8e5304f729
14 changed files with 39 additions and 66 deletions

View file

@ -224,21 +224,16 @@ func panicmemAddr(addr uintptr) {
panic(errorAddressString{msg: "invalid memory address or nil pointer dereference", addr: addr})
}
// Create a new deferred function fn with siz bytes of arguments.
// 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(siz int32, fn *funcval) { // arguments of fn follow fn
func deferproc(fn *funcval) { // TODO: Make deferproc just take a func().
gp := getg()
if gp.m.curg != gp {
// go code on the system stack can't defer
throw("defer on system stack")
}
if siz != 0 {
// TODO: Make deferproc just take a func().
throw("defer with non-empty frame")
}
// 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