summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/all_test.go5
-rw-r--r--src/reflect/asm_power64x.s29
-rw-r--r--src/reflect/value.go2
3 files changed, 35 insertions, 1 deletions
diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go
index 9a2a9f266..a6bacf32c 100644
--- a/src/reflect/all_test.go
+++ b/src/reflect/all_test.go
@@ -1052,6 +1052,11 @@ func TestChan(t *testing.T) {
ok = cv.TrySend(ValueOf(6))
if !ok {
t.Errorf("TrySend on empty chan failed")
+ select {
+ case x := <-c:
+ t.Errorf("TrySend failed but it did send %d", x)
+ default:
+ }
} else {
if i = <-c; i != 6 {
t.Errorf("TrySend 6, recv %d", i)
diff --git a/src/reflect/asm_power64x.s b/src/reflect/asm_power64x.s
new file mode 100644
index 000000000..e430cdf04
--- /dev/null
+++ b/src/reflect/asm_power64x.s
@@ -0,0 +1,29 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build power64 power64le
+
+#include "textflag.h"
+
+// makeFuncStub is the code half of the function returned by MakeFunc.
+// See the comment on the declaration of makeFuncStub in makefunc.go
+// for more details.
+// No argsize here, gc generates argsize info at call site.
+TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$16
+ MOVD R11, 8(R1)
+ MOVD $argframe+0(FP), R3
+ MOVD R3, 16(R1)
+ BL ·callReflect(SB)
+ RETURN
+
+// methodValueCall is the code half of the function returned by makeMethodValue.
+// See the comment on the declaration of methodValueCall in makefunc.go
+// for more details.
+// No argsize here, gc generates argsize info at call site.
+TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$16
+ MOVD R11, 8(R1)
+ MOVD $argframe+0(FP), R3
+ MOVD R3, 16(R1)
+ BL ·callMethod(SB)
+ RETURN
diff --git a/src/reflect/value.go b/src/reflect/value.go
index 368116a50..b7cc755c9 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -11,7 +11,7 @@ import (
"unsafe"
)
-const bigEndian = false // can be smarter if we find a big-endian machine
+const bigEndian = runtime.GOARCH == "power64" // can be smarter if we find more big-endian machines
const ptrSize = unsafe.Sizeof((*byte)(nil))
const cannotSet = "cannot set value obtained from unexported struct field"