From 82105b28f41fe63cbe2eaecf687659be44266d04 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 4 Sep 2014 00:01:55 -0400 Subject: 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 --- misc/cgo/test/callback.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'misc') 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) } } } -- cgit v1.2.1