]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: use ABI0 for cgo_unsafe_args functions
authorCherry Zhang <cherryyz@google.com>
Thu, 1 Apr 2021 15:11:04 +0000 (11:11 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 2 Apr 2021 16:31:47 +0000 (16:31 +0000)
commit6996bae5d1d34ea9e2ab6399f70adb402697ed94
treecdeba8e084f91feb0fd11527f45ea9a9e09d15e8
parent759116b3ace07f431103d65a7ce6cf4f314203bf
cmd/compile: use ABI0 for cgo_unsafe_args functions

cgo_unsafe_args paragma indicates that the function (or its
callee) uses address and offsets to dispatch arguments, which
currently using ABI0 frame layout. Pin them to ABI0.

With this, "GOEXPERIMENT=regabi,regabiargs go run hello.go" works
on Darwin/AMD64.

Change-Id: I3eadd5a3646a9de8fa681fa0a7f46e7cdc217d24
Reviewed-on: https://go-review.googlesource.com/c/go/+/306609
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssagen/abi.go