runtime: copy internal locking code from Go 1.7 runtime
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 30 Sep 2016 13:45:08 +0000 (13:45 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 30 Sep 2016 13:45:08 +0000 (13:45 +0000)
commitc0401cf78c555ef38d2d2fba94ebffeaef7c6bc9
treed1646c0c4bb59624dfdc04420f835270129cc18e
parent9e28a77462f81a9a2ab9064d768bd7c9484047e1
runtime: copy internal locking code from Go 1.7 runtime

    Remove the old locking code written in C.

    Add a shell script mkrsysinfo.sh to generate the runtime_sysinfo.go
    file, so that we can get Go copies of the system time structures and
    other types.

    Tweak the compiler so that when compiling the runtime package the
    address operator does not cause local variables to escape.  When the gc
    compiler compiles the runtime, an escaping local variable is treated as
    an error.  We should implement that, instead of this change, when escape
    analysis is turned on.

    Tweak the compiler so that the generated C header does not include names
    that start with an underscore followed by a non-upper-case letter,
    except for the special cases of _defer and _panic.  Otherwise we
    translate C types to Go in runtime_sysinfo.go and then generate those Go
    types back as C types in runtime.inc, which is useless and painful for
    the C code.

    Change entersyscall and friends to take a dummy argument, as the gc
    versions do, to simplify calls from the shared code.

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

From-SVN: r240657
31 files changed:
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/gogo.cc
libgo/Makefile.am
libgo/Makefile.in
libgo/config.h.in
libgo/configure
libgo/configure.ac
libgo/go/runtime/export_test.go
libgo/go/runtime/lock_futex.go [new file with mode: 0644]
libgo/go/runtime/lock_sema.go [new file with mode: 0644]
libgo/go/runtime/os_darwin.go [new file with mode: 0644]
libgo/go/runtime/os_dragonfly.go [new file with mode: 0644]
libgo/go/runtime/os_freebsd.go [new file with mode: 0644]
libgo/go/runtime/os_linux.go
libgo/go/runtime/os_netbsd.go [new file with mode: 0644]
libgo/go/runtime/os_openbsd.go [new file with mode: 0644]
libgo/go/runtime/os_solaris.go [new file with mode: 0644]
libgo/go/runtime/runtime2.go
libgo/go/runtime/stubs.go
libgo/mkrsysinfo.sh [new file with mode: 0755]
libgo/runtime/go-cgo.c
libgo/runtime/lock_futex.c [deleted file]
libgo/runtime/lock_sema.c [deleted file]
libgo/runtime/malloc.goc
libgo/runtime/proc.c
libgo/runtime/runtime.c
libgo/runtime/runtime.h
libgo/runtime/thread-linux.c
libgo/runtime/thread-sema.c
libgo/sysinfo.c