reflect: add tests for reflect.Value.Call for the new ABI

This change adds tests for reflect.Value.Call for calling functions
using the new register-based ABI.

For #40724.

Change-Id: Ia9afd43e26dd80c7e36dd135a5b71acce8074801
Reviewed-on: https://go-review.googlesource.com/c/go/+/299269
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Michael Anthony Knyszek 2021-03-05 19:47:34 +00:00 committed by Michael Knyszek
parent 79d03ad739
commit bdbba22404
2 changed files with 461 additions and 1 deletions

View file

@ -4,7 +4,10 @@
package reflect
import "unsafe"
import (
"sync"
"unsafe"
)
// MakeRO returns a copy of v with the read-only flag set.
func MakeRO(v Value) Value {
@ -17,6 +20,12 @@ func IsRO(v Value) bool {
return v.flag&flagStickyRO != 0
}
var (
IntArgRegs = &intArgRegs
FloatArgRegs = &floatArgRegs
FloatRegSize = &floatRegSize
)
var CallGC = &callGC
const PtrSize = ptrSize
@ -122,3 +131,7 @@ func ResolveReflectName(s string) {
type Buffer struct {
buf []byte
}
func ClearLayoutCache() {
layoutCache = sync.Map{}
}