runtime: rewrite interface code into Go

Programming / Compilers / GCC - ian [138bc75d-0d04-0410-961f-82ee72b054a4] - 20 October 2016 13:51 UTC

I started to copy the Go 1.7 interface code, but the gc and gccgo representations of interfaces are too different. So instead I rewrote the gccgo interface code from C to Go. The code is largely the same as it was, but the names are more like those used in the gc runtime.

I also copied over the string comparison functions, and tweaked the compiler to use eqstring when comparing strings for equality.

Reviewed-on: https://go-review.googlesource.com/31591

6098d6c runtime: rewrite interface code into Go
gcc/go/gofrontend/MERGE | 2 +-
gcc/go/gofrontend/escape.cc | 4 +-
gcc/go/gofrontend/expressions.cc | 49 ++--
gcc/go/gofrontend/runtime.def | 51 +++--
gcc/go/gofrontend/statements.cc | 2 +-
gcc/go/gofrontend/types.cc | 8 +-
libgo/Makefile.am | 18 --
libgo/Makefile.in | 144 +-----------
libgo/go/runtime/alg.go | 204 +++++++++++++++++
libgo/go/runtime/iface.go | 334 ++++++++++++++++++++++++++++
libgo/go/runtime/runtime2.go | 4 +
libgo/go/runtime/stubs.go | 10 +-
libgo/go/runtime/type.go | 16 ++
libgo/runtime/go-assert-interface.c | 45 ----
libgo/runtime/go-can-convert-interface.c | 78 -------
libgo/runtime/go-cgo.c | 9 +-
libgo/runtime/go-check-interface.c | 46 ----
libgo/runtime/go-convert-interface.c | 132 -----------
libgo/runtime/go-deferred-recover.c | 8 +-
libgo/runtime/go-eface-compare.c | 37 ---
libgo/runtime/go-eface-val-compare.c | 35 ---
libgo/runtime/go-iface.goc | 130 -----------
libgo/runtime/go-interface-compare.c | 37 ---
libgo/runtime/go-interface-eface-compare.c | 36 ---
libgo/runtime/go-interface-val-compare.c | 35 ---
libgo/runtime/go-panic.c | 3 +-
libgo/runtime/go-panic.h | 14 +-
libgo/runtime/go-recover.c | 11 +-
libgo/runtime/go-strcmp.c | 25 ---
libgo/runtime/go-strslice.c | 2 +-
libgo/runtime/go-type-eface.c | 66 ------
libgo/runtime/go-type-interface.c | 66 ------
libgo/runtime/go-unsafe-new.c | 1 -
libgo/runtime/go-unsafe-newarray.c | 1 -
libgo/runtime/go-unwind.c | 4 +-
libgo/runtime/heapdump.c | 4 +-
libgo/runtime/interface.h | 57 -----
libgo/runtime/malloc.goc | 37 ++-
libgo/runtime/mgc0.c | 50 ++---
libgo/runtime/reflect.goc | 25 ---
libgo/runtime/runtime.h | 10 +-
libgo/runtime/runtime1.goc | 2 +-
42 files changed, 717 insertions(+), 1135 deletions(-)

Upstream: gcc.gnu.org


  • Share