]> Cypherpunks repositories - gostls13.git/commit
runtime: refactor/fix asmcgocall/asmcgocall_errno
authorRuss Cox <rsc@golang.org>
Thu, 4 Sep 2014 04:01:55 +0000 (00:01 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 4 Sep 2014 04:01:55 +0000 (00:01 -0400)
commitcb767247caeaedd0ed438adba8e27c3334be783e
treefa768c6b6e677497904b4c1b7ea9a87ea2104878
parentf40341643cc254aa4e00baf455aa85684957cd92
runtime: refactor/fix asmcgocall/asmcgocall_errno

Instead of making asmcgocall call asmcgocall_errno,
make both load args into registers and call a shared
assembly function.

On amd64, this costs 1 word in the asmcgocall_errno path
but saves 3 words in the asmcgocall path, and the latter
is what happens on critical nosplit paths on Windows.

On arm, this fixes build failures: asmcgocall was writing
the arguments for asmcgocall_errno into the wrong
place on the stack. Passing them in registers avoids the
decision entirely.

On 386, this isn't really needed, since the nosplit paths
have twice as many words to work with, but do it for consistency.

Update #8635
Fixes arm build (except GOARM=5).

TBR=iant
CC=golang-codereviews
https://golang.org/cl/134390043
misc/cgo/test/callback.go
src/pkg/runtime/asm_386.s
src/pkg/runtime/asm_amd64.s
src/pkg/runtime/asm_arm.s