diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-10-08 14:21:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-10-08 14:21:30 +0000 |
commit | 3cbb7cbb096134746588d08a469778b11ae6ac73 (patch) | |
tree | eff67e0dc5d748e398ea1a7ffa36f6a3bbda072b /libgo/go/reflect | |
parent | a3368b8ea1bda5edd41900096b10514bcf7c6de7 (diff) | |
download | gcc-3cbb7cbb096134746588d08a469778b11ae6ac73.zip gcc-3cbb7cbb096134746588d08a469778b11ae6ac73.tar.gz gcc-3cbb7cbb096134746588d08a469778b11ae6ac73.tar.bz2 |
libgo: update to Go 1.11.1 release
Reviewed-on: https://go-review.googlesource.com/c/140277
From-SVN: r264932
Diffstat (limited to 'libgo/go/reflect')
-rw-r--r-- | libgo/go/reflect/all_test.go | 4 | ||||
-rw-r--r-- | libgo/go/reflect/makefunc_ffi.go | 4 | ||||
-rw-r--r-- | libgo/go/reflect/value.go | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/libgo/go/reflect/all_test.go b/libgo/go/reflect/all_test.go index eb893e9..472988f 100644 --- a/libgo/go/reflect/all_test.go +++ b/libgo/go/reflect/all_test.go @@ -5864,7 +5864,7 @@ func clobber() { type funcLayoutTest struct { rcvr, t Type size, argsize, retOffset uintptr - stack []byte // pointer bitmap: 1 is pointer, 0 is scalar (or uninitialized) + stack []byte // pointer bitmap: 1 is pointer, 0 is scalar gc []byte } @@ -5886,7 +5886,7 @@ func init() { 6 * PtrSize, 4 * PtrSize, 4 * PtrSize, - []byte{1, 0, 1}, + []byte{1, 0, 1, 0, 1}, []byte{1, 0, 1, 0, 1}, }) diff --git a/libgo/go/reflect/makefunc_ffi.go b/libgo/go/reflect/makefunc_ffi.go index 2acf7bb..9d9cbde 100644 --- a/libgo/go/reflect/makefunc_ffi.go +++ b/libgo/go/reflect/makefunc_ffi.go @@ -33,7 +33,7 @@ func FFICallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFunc ap := params for _, rt := range ftyp.in { p := unsafe_New(rt) - memmove(p, *(*unsafe.Pointer)(ap), rt.size) + typedmemmove(rt, p, *(*unsafe.Pointer)(ap)) v := Value{rt, p, flag(rt.Kind()) | flagIndir} in = append(in, v) ap = (unsafe.Pointer)(uintptr(ap) + ptrSize) @@ -59,7 +59,7 @@ func FFICallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFunc if v.flag&flagIndir == 0 && (v.kind() == Ptr || v.kind() == UnsafePointer) { *(*unsafe.Pointer)(addr) = v.ptr } else { - memmove(addr, v.ptr, typ.size) + typedmemmove(typ, addr, v.ptr) } off += typ.size } diff --git a/libgo/go/reflect/value.go b/libgo/go/reflect/value.go index 5ddd30d..9f05744 100644 --- a/libgo/go/reflect/value.go +++ b/libgo/go/reflect/value.go @@ -323,7 +323,7 @@ var callGC bool // for testing; see TestCallMethodJump func (v Value) call(op string, in []Value) []Value { // Get function pointer, type. - t := v.typ + t := (*funcType)(unsafe.Pointer(v.typ)) var ( fn unsafe.Pointer rcvr Value @@ -472,7 +472,7 @@ func (v Value) call(op string, in []Value) []Value { // The return value rcvrtype gives the method's actual receiver type. // The return value t gives the method type signature (without the receiver). // The return value fn is a pointer to the method code. -func methodReceiver(op string, v Value, methodIndex int) (rcvrtype, t *rtype, fn unsafe.Pointer) { +func methodReceiver(op string, v Value, methodIndex int) (rcvrtype *rtype, t *funcType, fn unsafe.Pointer) { i := methodIndex if v.typ.Kind() == Interface { tt := (*interfaceType)(unsafe.Pointer(v.typ)) @@ -489,7 +489,7 @@ func methodReceiver(op string, v Value, methodIndex int) (rcvrtype, t *rtype, fn } rcvrtype = iface.itab.typ fn = unsafe.Pointer(&iface.itab.fun[i]) - t = m.typ + t = (*funcType)(unsafe.Pointer(m.typ)) } else { rcvrtype = v.typ ms := v.typ.exportedMethods() @@ -501,7 +501,7 @@ func methodReceiver(op string, v Value, methodIndex int) (rcvrtype, t *rtype, fn panic("reflect: " + op + " of unexported method") } fn = unsafe.Pointer(&m.tfn) - t = m.mtyp + t = (*funcType)(unsafe.Pointer(m.mtyp)) } return } @@ -2399,10 +2399,14 @@ func mapiternext(it unsafe.Pointer) //go:noescape func maplen(m unsafe.Pointer) int -func call(typ *rtype, fnaddr unsafe.Pointer, isInterface bool, isMethod bool, params *unsafe.Pointer, results *unsafe.Pointer) +func call(typ *funcType, fnaddr unsafe.Pointer, isInterface bool, isMethod bool, params *unsafe.Pointer, results *unsafe.Pointer) func ifaceE2I(t *rtype, src interface{}, dst unsafe.Pointer) +// memmove copies size bytes to dst from src. No write barriers are used. +//go:noescape +func memmove(dst, src unsafe.Pointer, size uintptr) + // typedmemmove copies a value of type t to dst from src. //go:noescape func typedmemmove(t *rtype, dst, src unsafe.Pointer) @@ -2412,10 +2416,6 @@ func typedmemmove(t *rtype, dst, src unsafe.Pointer) //go:noescape func typedslicecopy(elemType *rtype, dst, src sliceHeader) int -//go:noescape -//extern memmove -func memmove(adst, asrc unsafe.Pointer, n uintptr) - // Dummy annotation marking that the value x escapes, // for use in cases where the reflect code is so clever that // the compiler cannot follow. |