compiler, runtime: Use function descriptors.
authorIan Lance Taylor <iant@google.com>
Tue, 18 Jun 2013 23:49:49 +0000 (23:49 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 18 Jun 2013 23:49:49 +0000 (23:49 +0000)
commitfdbc38a6e8d7c920eea6c6231c7fe2c987fa8aa2
tree1a7d38cd8be5484451189338ed6f4b76d8521f31
parent25e00ab67444a01dce446e95308521d1a73f8232
compiler, runtime: Use function descriptors.

This changes the representation of a Go value of function type
from being a pointer to function code (like a C function
pointer) to being a pointer to a struct.  The first field of
the struct points to the function code.  The remaining fields,
if any, are the addresses of variables referenced in enclosing
functions.  For each call to a function, the address of the
function descriptor is passed as the last argument.

This lets us avoid generating trampolines, and removes the use
of writable/executable sections of the heap.

From-SVN: r200181
29 files changed:
gcc/go/ChangeLog
gcc/go/go-gcc.cc
gcc/go/gofrontend/backend.h
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/gogo-tree.cc
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/parse.cc
gcc/go/gofrontend/runtime.def
gcc/go/gofrontend/statements.cc
gcc/go/gofrontend/types.cc
gcc/go/gofrontend/types.h
libgo/Makefile.am
libgo/Makefile.in
libgo/configure
libgo/configure.ac
libgo/go/reflect/all_test.go
libgo/go/reflect/type.go
libgo/go/reflect/value.go
libgo/go/runtime/extern.go
libgo/go/runtime/parfor_test.go
libgo/runtime/go-reflect-call.c
libgo/runtime/malloc.h
libgo/runtime/mfinal.c
libgo/runtime/mgc0.c
libgo/runtime/parfor.c
libgo/runtime/runtime.h
libgo/runtime/time.goc