aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2021-06-04 20:04:57 -0400
committerCherry Mui <cherryyz@google.com>2021-06-11 18:32:42 +0000
commit4468e1cfb94ed07fea5514dce740180fd3a6d20f (patch)
treec1b5afc400e0008033ee5e29c43778dbadd55bb7
parentef6c5be16025a1868fc27267b7abfb1c28329fe2 (diff)
downloadgo-4468e1cfb94ed07fea5514dce740180fd3a6d20f.tar.gz
go-4468e1cfb94ed07fea5514dce740180fd3a6d20f.zip
[dev.typeparams] runtime: allow newproc split stack
newproc 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: I6f39730fb1595c4b0438c74118fef418fe1c082b Reviewed-on: https://go-review.googlesource.com/c/go/+/325919 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
-rw-r--r--src/runtime/proc.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 5d2511b83c..d6f3af690b 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -4220,18 +4220,6 @@ func malg(stacksize int32) *g {
// Create a new g running fn.
// Put it on the queue of g's waiting to run.
// The compiler turns a go statement into a call to this.
-//
-// The stack layout of this call is unusual: it assumes that the
-// arguments to pass to fn are on the stack sequentially immediately
-// after &fn. Hence, they are logically part of newproc's argument
-// frame, even though they don't appear in its signature (and can't
-// because their types differ between call sites).
-//
-// This must be nosplit because this stack layout means there are
-// untyped arguments in newproc's argument frame. Stack copies won't
-// be able to adjust them and stack splits won't be able to copy them.
-//
-//go:nosplit
func newproc(fn *funcval) {
gp := getg()
pc := getcallerpc()
@@ -4250,17 +4238,7 @@ func newproc(fn *funcval) {
// Create a new g in state _Grunnable, starting at fn. callerpc is the
// address of the go statement that created this. The caller is responsible
// for adding the new g to the scheduler.
-//
-// This must run on the system stack because it's the continuation of
-// newproc, which cannot split the stack.
-//
-//go:systemstack
func newproc1(fn *funcval, callergp *g, callerpc uintptr) *g {
- // TODO: When we commit to GOEXPERIMENT=regabidefer,
- // rewrite the comments for newproc and newproc1.
- // newproc will no longer have a funny stack layout or
- // need to be nosplit.
-
_g_ := getg()
if fn == nil {