summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-04 00:01:55 -0400
committerRuss Cox <rsc@golang.org>2014-09-04 00:01:55 -0400
commit82105b28f41fe63cbe2eaecf687659be44266d04 (patch)
tree1d942471032ae6fb056ea2d5cb324bcd269fd484 /misc
parentd28eaeb139d3c1cc90b86e55d0f3343c0ffa16fb (diff)
downloadgo-82105b28f41fe63cbe2eaecf687659be44266d04.tar.gz
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 issue 8635 Fixes arm build (except GOARM=5). TBR=iant CC=golang-codereviews https://codereview.appspot.com/134390043
Diffstat (limited to 'misc')
-rw-r--r--misc/cgo/test/callback.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/misc/cgo/test/callback.go b/misc/cgo/test/callback.go
index 67d271404..98f653ef7 100644
--- a/misc/cgo/test/callback.go
+++ b/misc/cgo/test/callback.go
@@ -156,6 +156,7 @@ func testCallbackCallers(t *testing.T) {
"runtime.cgocallbackg1",
"runtime.cgocallbackg",
"runtime.cgocallback_gofunc",
+ "asmcgocall",
"runtime.asmcgocall_errno",
"runtime.cgocall_errno",
"test._Cfunc_callback",
@@ -182,8 +183,12 @@ func testCallbackCallers(t *testing.T) {
if strings.HasPrefix(fname, "_") {
fname = path.Base(f.Name()[1:])
}
- if fname != name[i] {
- t.Errorf("expected function name %s, got %s", name[i], fname)
+ namei := ""
+ if i < len(name) {
+ namei = name[i]
+ }
+ if fname != namei {
+ t.Errorf("stk[%d] = %q, want %q", i, fname, namei)
}
}
}