]> Cypherpunks.ru repositories - gostls13.git/commit
all: remove 'extern register M *m' from runtime
authorRuss Cox <rsc@golang.org>
Thu, 26 Jun 2014 15:54:39 +0000 (11:54 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 26 Jun 2014 15:54:39 +0000 (11:54 -0400)
commit89f185fe8a036b0fabce30b20c480cf1c832bdd7
treecd8c84fca5164747bebd852da7edfed132ce4e70
parent2565b5c06086488b2b23d48929803c8c3cec4400
all: remove 'extern register M *m' from runtime

The runtime has historically held two dedicated values g (current goroutine)
and m (current thread) in 'extern register' slots (TLS on x86, real registers
backed by TLS on ARM).

This CL removes the extern register m; code now uses g->m.

On ARM, this frees up the register that formerly held m (R9).
This is important for NaCl, because NaCl ARM code cannot use R9 at all.

The Go 1 macrobenchmarks (those with per-op times >= 10 µs) are unaffected:

BenchmarkBinaryTree17              5491374955     5471024381     -0.37%
BenchmarkFannkuch11                4357101311     4275174828     -1.88%
BenchmarkGobDecode                 11029957       11364184       +3.03%
BenchmarkGobEncode                 6852205        6784822        -0.98%
BenchmarkGzip                      650795967      650152275      -0.10%
BenchmarkGunzip                    140962363      141041670      +0.06%
BenchmarkHTTPClientServer          71581          73081          +2.10%
BenchmarkJSONEncode                31928079       31913356       -0.05%
BenchmarkJSONDecode                117470065      113689916      -3.22%
BenchmarkMandelbrot200             6008923        5998712        -0.17%
BenchmarkGoParse                   6310917        6327487        +0.26%
BenchmarkRegexpMatchMedium_1K      114568         114763         +0.17%
BenchmarkRegexpMatchHard_1K        168977         169244         +0.16%
BenchmarkRevcomp                   935294971      914060918      -2.27%
BenchmarkTemplate                  145917123      148186096      +1.55%

Minux previous reported larger variations, but these were caused by
run-to-run noise, not repeatable slowdowns.

Actual code changes by Minux.
I only did the docs and the benchmarking.

LGTM=dvyukov, iant, minux
R=minux, josharian, iant, dave, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/109050043
98 files changed:
doc/asm.html
include/link.h
src/cmd/5a/lex.c
src/cmd/dist/buildruntime.c
src/cmd/ld/data.c
src/cmd/ld/lib.c
src/cmd/ld/symtab.c
src/liblink/asm5.c
src/liblink/obj5.c
src/liblink/obj6.c
src/pkg/runtime/asm_386.s
src/pkg/runtime/asm_amd64.s
src/pkg/runtime/asm_amd64p32.s
src/pkg/runtime/asm_arm.s
src/pkg/runtime/cgo/asm_arm.s
src/pkg/runtime/cgo/callbacks.c
src/pkg/runtime/cgo/gcc_arm.S
src/pkg/runtime/cgo/gcc_darwin_386.c
src/pkg/runtime/cgo/gcc_darwin_amd64.c
src/pkg/runtime/cgo/gcc_dragonfly_386.c
src/pkg/runtime/cgo/gcc_dragonfly_amd64.c
src/pkg/runtime/cgo/gcc_freebsd_386.c
src/pkg/runtime/cgo/gcc_freebsd_amd64.c
src/pkg/runtime/cgo/gcc_freebsd_arm.c
src/pkg/runtime/cgo/gcc_linux_386.c
src/pkg/runtime/cgo/gcc_linux_amd64.c
src/pkg/runtime/cgo/gcc_linux_arm.c
src/pkg/runtime/cgo/gcc_netbsd_386.c
src/pkg/runtime/cgo/gcc_netbsd_amd64.c
src/pkg/runtime/cgo/gcc_netbsd_arm.c
src/pkg/runtime/cgo/gcc_openbsd_386.c
src/pkg/runtime/cgo/gcc_openbsd_amd64.c
src/pkg/runtime/cgo/gcc_windows_386.c
src/pkg/runtime/cgo/gcc_windows_amd64.c
src/pkg/runtime/cgo/libcgo.h
src/pkg/runtime/cgocall.c
src/pkg/runtime/heapdump.c
src/pkg/runtime/lock_futex.c
src/pkg/runtime/lock_sema.c
src/pkg/runtime/malloc.goc
src/pkg/runtime/mcache.c
src/pkg/runtime/mgc0.c
src/pkg/runtime/mheap.c
src/pkg/runtime/mprof.goc
src/pkg/runtime/netpoll_solaris.c
src/pkg/runtime/netpoll_windows.c
src/pkg/runtime/os_darwin.c
src/pkg/runtime/os_dragonfly.c
src/pkg/runtime/os_freebsd.c
src/pkg/runtime/os_linux.c
src/pkg/runtime/os_nacl.c
src/pkg/runtime/os_netbsd.c
src/pkg/runtime/os_openbsd.c
src/pkg/runtime/os_plan9.c
src/pkg/runtime/os_plan9_386.c
src/pkg/runtime/os_plan9_amd64.c
src/pkg/runtime/os_solaris.c
src/pkg/runtime/os_windows.c
src/pkg/runtime/os_windows_386.c
src/pkg/runtime/os_windows_amd64.c
src/pkg/runtime/panic.c
src/pkg/runtime/proc.c
src/pkg/runtime/race_amd64.s
src/pkg/runtime/runtime.c
src/pkg/runtime/runtime.h
src/pkg/runtime/runtime1.goc
src/pkg/runtime/signal_386.c
src/pkg/runtime/signal_amd64x.c
src/pkg/runtime/signal_arm.c
src/pkg/runtime/signal_unix.c
src/pkg/runtime/softfloat_arm.c
src/pkg/runtime/stack.c
src/pkg/runtime/symtab.goc
src/pkg/runtime/sys_darwin_386.s
src/pkg/runtime/sys_darwin_amd64.s
src/pkg/runtime/sys_dragonfly_386.s
src/pkg/runtime/sys_dragonfly_amd64.s
src/pkg/runtime/sys_freebsd_386.s
src/pkg/runtime/sys_freebsd_amd64.s
src/pkg/runtime/sys_freebsd_arm.s
src/pkg/runtime/sys_linux_386.s
src/pkg/runtime/sys_linux_amd64.s
src/pkg/runtime/sys_linux_arm.s
src/pkg/runtime/sys_nacl_386.s
src/pkg/runtime/sys_nacl_amd64p32.s
src/pkg/runtime/sys_netbsd_386.s
src/pkg/runtime/sys_netbsd_amd64.s
src/pkg/runtime/sys_netbsd_arm.s
src/pkg/runtime/sys_openbsd_386.s
src/pkg/runtime/sys_openbsd_amd64.s
src/pkg/runtime/sys_plan9_386.s
src/pkg/runtime/sys_plan9_amd64.s
src/pkg/runtime/sys_solaris_amd64.s
src/pkg/runtime/sys_windows_386.s
src/pkg/runtime/sys_windows_amd64.s
src/pkg/runtime/traceback_arm.c
src/pkg/runtime/traceback_x86.c
src/pkg/runtime/vlop_arm.s