net: make use of testing.B.Skip and reflect.DeepEqual in test

This CL addresses the comments on CL 7368046 that I've overlooked.

Update issue 4866.

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/7369052
net/rpc: avoid racy use of closing flag.

It's accessed without mutex protection
in a different goroutine from the one that
sets it.

Also make sure that Client.Call after Client.Close
will reliably return ErrShutdown, and that clients
see ErrShutdown rather than io.EOF when appropriate.

Suggestions welcome for a way to reliably test
the mutex issue.

R=r, iant
CC=golang-dev
https://codereview.appspot.com/7338045
go/parser: more precise comment

See also CL 7383051 for details.

R=adonovan, bradfitz
CC=golang-dev
https://codereview.appspot.com/7378063
cmd/gc: emit explicit type information for local variables

The type information is (and for years has been) included
as an extra field in the address chunk of an instruction.
Unfortunately, suppose there is a string at a+24(FP) and
we have an instruction reading its length. It will say:

        MOVQ x+32(FP), AX

and the type of *that* argument is int (not slice), because
it is the length being read. This confuses the picture seen
by debuggers and now, worse, by the garbage collector.

Instead of attaching the type information to all uses,
emit an explicit list of TYPE instructions with the information.
The TYPE instructions are no-ops whose only role is to
provide an address to attach type information to.

For example, this function:

        func f(x, y, z int) (a, b string) {
                return
        }

now compiles into:

        --- prog list "f" ---
        0000 (/Users/rsc/x.go:3) TEXT    f+0(SB),$0-56
        0001 (/Users/rsc/x.go:3) LOCALS  ,
        0002 (/Users/rsc/x.go:3) TYPE    x+0(FP){int},$8
        0003 (/Users/rsc/x.go:3) TYPE    y+8(FP){int},$8
        0004 (/Users/rsc/x.go:3) TYPE    z+16(FP){int},$8
        0005 (/Users/rsc/x.go:3) TYPE    a+24(FP){string},$16
        0006 (/Users/rsc/x.go:3) TYPE    b+40(FP){string},$16
        0007 (/Users/rsc/x.go:3) MOVQ    $0,b+40(FP)
        0008 (/Users/rsc/x.go:3) MOVQ    $0,b+48(FP)
        0009 (/Users/rsc/x.go:3) MOVQ    $0,a+24(FP)
        0010 (/Users/rsc/x.go:3) MOVQ    $0,a+32(FP)
        0011 (/Users/rsc/x.go:4) RET     ,

The { } show the formerly hidden type information.
The { } syntax is used when printing from within the gc compiler.
It is not accepted by the assemblers.

The same type information is now included on global variables:

0055 (/Users/rsc/x.go:15) GLOBL   slice+0(SB){[]string},$24(AL*0)

This more accurate type information fixes a bug in the
garbage collector's precise heap collection.

The linker only cares about globals right now, but having the
local information should make things a little nicer for Carl
in the future.

Fixes issue 4907.

R=ken2
CC=golang-dev
https://codereview.appspot.com/7395056
cmd/5g: fix arm build

R=ken2
CC=golang-dev
https://codereview.appspot.com/7365057
cmd/go: fix vet

Now that vet does typechecking, it should use only pkg.gofiles, instead
of pkg.allgofiles. Ignored files should not be checked by vet, because
they wouldn't typecheck.

Fixes issue 4906.

R=rsc, r
CC=golang-dev
https://codereview.appspot.com/7401051

Committer: Rob Pike <r@golang.org>
cmd/gc: fix mkbuiltin (gc -A always write all symbols to export section)
Regenerate cmd/gc/builtin.c.
Fixes issue 4908.

R=rsc
CC=golang-dev
https://codereview.appspot.com/7383053
all: fix some vet-found printf errors

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/7393059
runtime: precise garbage collection of channels

This changeset adds a mostly-precise garbage collection of channels.
The garbage collection support code in the linker isn't recognizing
channel types yet.

Fixes issue http://stackoverflow.com/questions/14712586/memory-consumption-skyrocket

R=dvyukov, rsc, bradfitz
CC=dave, golang-dev, minux.ma, remyoudompheng
https://codereview.appspot.com/7307086

Committer: Russ Cox <rsc@golang.org>
cmd/gc: can stop tracking gotype in regopt

Now that the type information is in TYPE instructions
that are not rewritten by the optimization passes,
we don't have to try to preserve the type information
(no longer) attached to MOV instructions.

R=ken2
CC=golang-dev
https://codereview.appspot.com/7402054
net/http/cgi: make tests compile on plan9

Don't reference the non-portable syscall.Signal(0).

Maybe they'll pass too. Untested. plan9 bit from
Akshat Kumar.

R=golang-dev, akumar
CC=golang-dev
https://codereview.appspot.com/7370049
doc: fix wiki codelab description of template parsing

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/7372048
runtime/cgo: fix deadlock involving signals on darwin
sigprocmask() is process-wide on darwin, so two concurrent
libcgo_sys_thread_start() can result in all signals permanently
blocked, which in particular blocks handling of nil derefs.
Fixes issue 4833.

R=golang-dev, dave, rsc
CC=golang-dev
https://codereview.appspot.com/7324058

Committer: Russ Cox <rsc@golang.org>
syscall: Plan9, amd64: fix syscall error handling in assembly

Syscalls return `-1' on error and the representation is always
32-bits. The `$-1' literal in 64-bit assembly is always the
64-bit representation. So this change makes sure that we
always do a 32-bit comparison when checking for error.
Also makes sure that in the error case, we return a 64-bit
`-1' from runtime.seek.

Fixes the arithmetic for handling the error-string in
runtime.Syscall6.

R=golang-dev, rminnich, rsc, ality, minux.ma
CC=golang-dev
https://codereview.appspot.com/7399052

Committer: Ron Minnich <rminnich@gmail.com>
libmach, cmd/5a, cmd/5c, cmd/5g, cmd/5l: enable DWARF type info for Linux/ARM
Fixes issue 3747.

Update issue 4912
This CL adds gotype into .5 object file.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7376054
doc: document that weekly.html is only a historical reference

Fixes issue 4810.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/7401050
time: handle very large sleep durations

Fixes issue 4903.

R=golang-dev, daniel.morsing, dave, r
CC=golang-dev
https://codereview.appspot.com/7388056
strconv, fmt: clarify behavior of CanBackquote and "%#q".
Fixes issue 4858.

R=golang-dev, bradfitz, r, rsc
CC=golang-dev
https://codereview.appspot.com/7387044
cmd/gc: apply escape analysis results to closures.

This avoids an allocation when closures are used
as "macros", in Walk idioms, or as argument to defer.

benchmark                old ns/op    new ns/op    delta
BenchmarkSearchWrappers       1171          354  -69.77%
BenchmarkCallClosure             3            3  -12.54%
BenchmarkCallClosure1          119            7  -93.95%
BenchmarkCallClosure2          183           74  -59.18%
BenchmarkCallClosure3          187           75  -59.57%
BenchmarkCallClosure4          187           76  -58.98%

Compared to Go 1:
benchmark                  old ns/op    new ns/op    delta
BenchmarkSearchWrappers         3208          354  -88.97%

Fixes issue 3520.

R=daniel.morsing, bradfitz, minux.ma, dave, rsc
CC=golang-dev
https://codereview.appspot.com/7397056
cmd/gc: fix corruption in export of &T{} literals.

Composite literals using the &T{} form were incorrectly
exported, leading to weird errors at import time.

Fixes issue 4879.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7395054