]> Cypherpunks repositories - gostls13.git/commit
runtime: tidy cgocallback
authorAustin Clements <austin@google.com>
Thu, 8 Oct 2020 02:53:52 +0000 (22:53 -0400)
committerAustin Clements <austin@google.com>
Mon, 26 Oct 2020 14:50:34 +0000 (14:50 +0000)
commitc91dffbc9aeaacd087eb0c0c3f718739bc5f8c4a
tree464e8454d2c2a5b6f625785406682e2da6b73dfb
parent30c18878730434027dbefd343aad74963a1fdc48
runtime: tidy cgocallback

On amd64 and 386, we have a very roundabout way of remembering that we
need to dropm on return that currently involves saving a zero to
needm's argument slot and later bringing it back. Just store the zero.

This also makes amd64 and 386 more consistent with cgocallback on all
other platforms: rather than saving the old M to the G stack, they now
save it to a named slot on the G0 stack.

The needm function no longer needs a dummy argument to get the SP, so
we drop that.

Change-Id: I7e84bb4a5ff9552de70dcf41d8accf02310535e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/263268
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/proc.go
src/runtime/signal_unix.go