summaryrefslogtreecommitdiff
path: root/libgo/go/reflect/all_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-05-01 21:34:16 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-01 21:34:16 +0000
commit5e87c2806ff4e9057c4c46fa1d9c8ac91ce3dae9 (patch)
treee3583babaa67131fcef04311cf265c9415582ca9 /libgo/go/reflect/all_test.go
parent1da37f43b21e0c35e57b627edfa99ec80d2976ee (diff)
downloadgcc-5e87c2806ff4e9057c4c46fa1d9c8ac91ce3dae9.tar.gz
compiler,runtime: do more direct interfaces
A direct interface is an interface whose data word contains the actual data value, instead of a pointer to it. The gc toolchain creates a direct interface if the value is pointer shaped, that includes pointers (including unsafe.Pointer), functions, channels, maps, and structs and arrays containing a single pointer-shaped field. In gccgo, we only do this for pointers. This CL unifies direct interface types with gc. This reduces allocations when converting such types to interfaces. Our method functions used to always take pointer receivers, to make interface calls easy. Now for direct interface types, their value methods will take value receivers. For a pointer to those types, when converted to interface, the interface data contains the pointer. For that interface to call a value method, it will need a wrapper method that dereference the pointer and invokes the value method. The wrapper method, instead of the actual one, is put into the itable of the pointer type. In the runtime, adjust funcPC for the new layout of interfaces of functions. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/168409 From-SVN: r270779
Diffstat (limited to 'libgo/go/reflect/all_test.go')
-rw-r--r--libgo/go/reflect/all_test.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/libgo/go/reflect/all_test.go b/libgo/go/reflect/all_test.go
index 599ab272e79..9452255f9a6 100644
--- a/libgo/go/reflect/all_test.go
+++ b/libgo/go/reflect/all_test.go
@@ -4136,7 +4136,6 @@ func TestArrayOfGenericAlg(t *testing.T) {
}
func TestArrayOfDirectIface(t *testing.T) {
- t.Skip("skipping test because gccgo uses a different directiface value")
{
type T [1]*byte
i1 := Zero(TypeOf(T{})).Interface()
@@ -4775,9 +4774,6 @@ func TestStructOfGenericAlg(t *testing.T) {
}
}
-/*
-gccgo does not use the same directiface settings as gc.
-
func TestStructOfDirectIface(t *testing.T) {
{
type T struct{ X [1]*byte }
@@ -4826,7 +4822,6 @@ func TestStructOfDirectIface(t *testing.T) {
}
}
}
-*/
type StructI int