summaryrefslogtreecommitdiff
path: root/src/reflect/export_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflect/export_test.go')
-rw-r--r--src/reflect/export_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/reflect/export_test.go b/src/reflect/export_test.go
index 0778ad37f..caaf51a50 100644
--- a/src/reflect/export_test.go
+++ b/src/reflect/export_test.go
@@ -17,3 +17,22 @@ func IsRO(v Value) bool {
var ArrayOf = arrayOf
var CallGC = &callGC
+
+const PtrSize = ptrSize
+const BitsPointer = bitsPointer
+const BitsScalar = bitsScalar
+
+func FuncLayout(t Type, rcvr Type) (frametype Type, argSize, retOffset uintptr, stack []byte) {
+ var ft *rtype
+ var s *bitVector
+ if rcvr != nil {
+ ft, argSize, retOffset, s = funcLayout(t.(*rtype), rcvr.(*rtype))
+ } else {
+ ft, argSize, retOffset, s = funcLayout(t.(*rtype), nil)
+ }
+ frametype = ft
+ for i := uint32(0); i < s.n; i += 2 {
+ stack = append(stack, s.data[i/8]>>(i%8)&3)
+ }
+ return
+}