runtime: fix arm build

TBR=dvyukov
CC=golang-codereviews
https://codereview.appspot.com/131150043
doc/go1.4.txt: go generate

CC=golang-codereviews
https://codereview.appspot.com/132890043
cmd/go: add go generate
First cut.

Works well enough to support yacc via
        http://codereview.appspot.com/125620044.

LGTM=alex.brainman, rsc
R=rsc, alex.brainman
CC=golang-codereviews
https://codereview.appspot.com/125580044
cmd/yacc: remove Makefile and build expr using go generate
It now serves as an example for go generate as well as for yacc.

NOTE: Depends on go generate, which is not yet checked in.
This is a proof of concept of the approach.
That is http://codereview.appspot.com/125580044.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/125620044

--HG--
rename : src/cmd/yacc/expr.y => src/cmd/yacc/expr/expr.y
runtime: remove some overuse of uintptr/unsafe.Pointer

Now 'go vet runtime' only shows:

        malloc.go:200: possible misuse of unsafe.Pointer
        malloc.go:214: possible misuse of unsafe.Pointer
        malloc.go:250: possible misuse of unsafe.Pointer
        stubs.go:167: possible misuse of unsafe.Pointer

Those are all unavoidable.

LGTM=josharian
R=golang-codereviews, dvyukov, josharian
CC=dave, golang-codereviews
https://codereview.appspot.com/135730043
cmd/link: fix testdata generation

Fixes issue 8494.

LGTM=rsc
R=golang-codereviews, gobot, rsc, evankroske
CC=golang-codereviews
https://codereview.appspot.com/123040043

Committer: Russ Cox <rsc@golang.org>
cmd/gc: re-enable IfacePointerOnly

CL 130240043 did this but broke ARM, because
it made newErrorCString start allocating, so we rolled
it back in CL 133810043.

CL 133820043 removed that allocation.

Try again.

Fixes issue 8405.

LGTM=bradfitz, dave
R=golang-codereviews, bradfitz
CC=dave, golang-codereviews, r
https://codereview.appspot.com/133830043
cmd/5g, cmd/8g: registerize small structs and arrays

cmd/6g has been doing this for a long time.

Arrays are still problematic on 5g because the addressing
for t[0] where local var t has type [3]uintptr takes the address of t.
That's issue 8125.

Fixes issue 8123.

LGTM=josharian
R=josharian, dave
CC=golang-codereviews
https://codereview.appspot.com/102890046
cmd/gc: fix build

TBR=dfc
CC=golang-codereviews
https://codereview.appspot.com/126210047
cmd/5g, cmd/6g, cmd/8g: clear Addr node when registerizing

Update issue 8525

Some temporary variables that were fully registerized nevertheless had stack space allocated for them because the Addrs were still marked as having associated nodes.

Distribution of stack space reserved for temporary variables while running make.bash (6g):

BEFORE

40.89%  7026 allocauto: 0 to 0
 7.83%  1346 allocauto: 0 to 24
 7.22%  1241 allocauto: 0 to 8
 6.30%  1082 allocauto: 0 to 16
 4.96%   853 allocauto: 0 to 56
 4.59%   789 allocauto: 0 to 32
 2.97%   510 allocauto: 0 to 40
 2.32%   399 allocauto: 0 to 48
 2.10%   360 allocauto: 0 to 64
 1.91%   328 allocauto: 0 to 72

AFTER

48.49%  8332 allocauto: 0 to 0
 9.52%  1635 allocauto: 0 to 16
 5.28%   908 allocauto: 0 to 48
 4.80%   824 allocauto: 0 to 32
 4.73%   812 allocauto: 0 to 8
 3.38%   581 allocauto: 0 to 24
 2.35%   404 allocauto: 0 to 40
 2.32%   399 allocauto: 0 to 64
 1.65%   284 allocauto: 0 to 56
 1.34%   230 allocauto: 0 to 72

LGTM=rsc
R=rsc
CC=dave, dvyukov, golang-codereviews, minux
https://codereview.appspot.com/126160043
runtime,runtime/debug: Converted some functions from goc to Go.

LGTM=khr
R=golang-codereviews, khr
CC=dvyukov, golang-codereviews
https://codereview.appspot.com/131010044

Committer: Keith Randall <khr@golang.org>
runtime: convert NewCallback and NewCallbackCDecl to Go

LGTM=khr
R=khr, remyoudompheng
CC=golang-codereviews
https://codereview.appspot.com/132820043

--HG--
rename : src/pkg/syscall/asm_windows_386.s => src/pkg/syscall/asm_windows.s
runtime: Loosen conditions in TestMemstat in an attempt to fix the nacl/arm build.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews, khr
https://codereview.appspot.com/128680043

Committer: Dmitriy Vyukov <dvyukov@google.com>
runtime: add fast paths to non-blocking channel operations
benchmark                      old ns/op     new ns/op     delta
BenchmarkChanNonblocking       27.8          7.80          -71.94%
BenchmarkChanNonblocking-2     79.1          3.94          -95.02%
BenchmarkChanNonblocking-4     71.2          2.04          -97.13%

LGTM=rsc
R=golang-codereviews, rsc, dave
CC=golang-codereviews
https://codereview.appspot.com/110580043
runtime: fix block profile for sync semaphores
And add a test.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, khr, rsc
https://codereview.appspot.com/128670043
runtime: fix block profile for sync semaphores
Part of cl/128670043 that got lost during submit.

TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://codereview.appspot.com/129570043
runtime: refactor CPU profiling
Reduce duration of critical section,
make pcbuf local to function.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, rsc
https://codereview.appspot.com/102600043
cmd/gc: fix order of channel evaluation of receive channels

Normally, an expression of the form x.f or *y can be reordered
with function calls and communications.

Select is stricter than normal: each channel expression is evaluated
in source order. If you have case <-x.f and case <-foo(), then if the
evaluation of x.f causes a panic, foo must not have been called.
(This is in contrast to an expression like x.f + foo().)

Enforce this stricter ordering.

Fixes issue 8336.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews, r
https://codereview.appspot.com/126570043
runtime: fix chan alignment on 32 bits

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews, khr, rsc
https://codereview.appspot.com/128700043
runtime: fix plan9 HeapSys accounting

LGTM=0intro
R=0intro
CC=golang-codereviews
https://codereview.appspot.com/131190043