runtime: properly set G status after syscall

R=golang-dev, r, dave
CC=golang-dev
https://codereview.appspot.com/9307045
runtime: change PollDesc.fd from int32 to uintptr

This is in preparation for netpoll windows version.

R=golang-dev, bradfitz
CC=dvyukov, golang-dev, mikioh.mikioh
https://codereview.appspot.com/9569043
net/http: fewer allocations in the server path

Don't allocate for the Date or Content-Length headers.
A custom Date header formatter replaces use of time.Format.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkClientServer                           67791        64424   -4.97%
BenchmarkClientServerParallel4                  62956        58533   -7.03%
BenchmarkClientServerParallel64                 62043        54789  -11.69%
BenchmarkServer                                254609       229060  -10.03%
BenchmarkServerFakeConnNoKeepAlive              17038        16316   -4.24%
BenchmarkServerFakeConnWithKeepAlive            14184        13226   -6.75%
BenchmarkServerFakeConnWithKeepAliveLite         8591         7532  -12.33%
BenchmarkServerHandlerTypeLen                   10750         9961   -7.34%
BenchmarkServerHandlerNoLen                      9535         8935   -6.29%
BenchmarkServerHandlerNoType                     9858         9362   -5.03%
BenchmarkServerHandlerNoHeader                   7754         6856  -11.58%

benchmark                                  old allocs   new allocs    delta
BenchmarkClientServer                              68           66   -2.94%
BenchmarkClientServerParallel4                     68           66   -2.94%
BenchmarkClientServerParallel64                    68           66   -2.94%
BenchmarkServer                                    21           19   -9.52%
BenchmarkServerFakeConnNoKeepAlive                 32           30   -6.25%
BenchmarkServerFakeConnWithKeepAlive               27           25   -7.41%
BenchmarkServerFakeConnWithKeepAliveLite           12           10  -16.67%
BenchmarkServerHandlerTypeLen                      19           18   -5.26%
BenchmarkServerHandlerNoLen                        17           15  -11.76%
BenchmarkServerHandlerNoType                       17           16   -5.88%
BenchmarkServerHandlerNoHeader                     12           10  -16.67%

Update Issue 5195

R=nigeltao
CC=golang-dev
https://codereview.appspot.com/9432046
runtime: zeroize g->fnstart to not prevent GC of the closure
Fixes issue 5493.

R=golang-dev, minux.ma, iant
CC=golang-dev
https://codereview.appspot.com/9557043
net: move system common global variables into fd_unix.go

R=golang-dev, bradfitz
CC=dvyukov, golang-dev, mikioh.mikioh
https://codereview.appspot.com/9495044
runtime: integrated network poller for freebsd/amd64,386, openbsd/amd64,386

Update issue 5199

R=golang-dev, dvyukov
CC=golang-dev
https://codereview.appspot.com/8825043
syscall: prefer PATH environment variable in bootstrap scripts

R=golang-dev, dave, iant
CC=golang-dev
https://codereview.appspot.com/9575043
net/http: simplify transfer body; reduces allocations too

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnNoKeepAlive              14431        14247   -1.28%
BenchmarkServerFakeConnWithKeepAlive            11618        11357   -2.25%
BenchmarkServerFakeConnWithKeepAliveLite         6735         6427   -4.57%
BenchmarkServerHandlerTypeLen                    8842         8740   -1.15%
BenchmarkServerHandlerNoLen                      8001         7828   -2.16%
BenchmarkServerHandlerNoType                     8270         8227   -0.52%
BenchmarkServerHandlerNoHeader                   6148         5920   -3.71%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnNoKeepAlive                 30           29   -3.33%
BenchmarkServerFakeConnWithKeepAlive               25           24   -4.00%
BenchmarkServerFakeConnWithKeepAliveLite           10            9  -10.00%
BenchmarkServerHandlerTypeLen                      18           17   -5.56%
BenchmarkServerHandlerNoLen                        15           14   -6.67%
BenchmarkServerHandlerNoType                       16           15   -6.25%
BenchmarkServerHandlerNoHeader                     10            9  -10.00%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnNoKeepAlive               2557         2492   -2.54%
BenchmarkServerFakeConnWithKeepAlive             2260         2194   -2.92%
BenchmarkServerFakeConnWithKeepAliveLite         1092         1026   -6.04%
BenchmarkServerHandlerTypeLen                    1941         1875   -3.40%
BenchmarkServerHandlerNoLen                      1898         1832   -3.48%
BenchmarkServerHandlerNoType                     1906         1840   -3.46%
BenchmarkServerHandlerNoHeader                   1092         1026   -6.04%

Update Issue 5195

R=golang-dev, daniel.morsing
CC=golang-dev
https://codereview.appspot.com/9492044
test: do not run the test that relies on precise GC on 32-bits
Currently most of the 32-bit builder are broken.
Fixes issue 5516.

R=golang-dev, dave, iant
CC=golang-dev
https://codereview.appspot.com/9573043
crypto/x509: provide better error messages for X.509 verify failures.

Failures caused by errors like invalid signatures or missing hash
functions cause rather generic, unhelpful error messages because no
trust chain can be constructed: "x509: certificate signed by unknown
authority."

With this change, authority errors may contain the reason why an
arbitary candidate step in the chain was rejected. For example, in the
event of a missing hash function the error looks like:

x509: certificate signed by unknown authority (possibly because of
"crypto/x509: cannot verify signature: algorithm unimplemented" while
trying to verify candidate authority certificate 'Thawte SGC CA')

Fixes 5058.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/9104051
misc/dashboard/builder: handle Plan 9 in defaultSuffix()

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/9495045
spec: fix language about "range" clause

Fixes issue 5434.

R=golang-dev, dsymonds
CC=golang-dev
https://codereview.appspot.com/9595044
spec: removed old or invalid TODOs

Several old TODOs are either resolved now (e.g. when is a return
needed), or are from a time the language wasn't frozen (^ for uints
only). Consolidated the others.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/9599044
cmd/gc: eliminate a useless bounds check in inlined append().

R=golang-dev, daniel.morsing, r
CC=golang-dev
https://codereview.appspot.com/9358043
cmd/gc: clear n->list of OFOR range loop after walk.

It contains the LHS of the range clause and gets
instrumented by racewalk, but it doesn't have any meaning.

Fixes issue 5446.

R=golang-dev, dvyukov, daniel.morsing, r
CC=golang-dev
https://codereview.appspot.com/9560044
net/http: use WriteString directly when possible

Several places used io.WriteString unnecessarily when the
static type already implemented WriteString. No need to
check for it at runtime.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/9608043
cmd/api: add more platforms
as OpenBSD lacks 4 errno constants, api/go1.txt is updated so that
api check won't fail.

R=golang-dev, iant, bradfitz, r
CC=golang-dev
https://codereview.appspot.com/9149045
crypto/tls: don't send NPN extension if NextProtos is not set.

This isn't clearly a bug on Go's part, but it triggers a bug in Firefox
which means that crypto/tls and net/http cannot be wired up together
unless NextProtos includes "http/1.1". When net/http sets up the
tls.Config, it does this and so works fine. But anyone setting up the
tls.Config themselves will hit the Firefox bug.

Fixes issue 5445.

R=golang-dev, bradfitz, r
CC=golang-dev
https://codereview.appspot.com/9539045
codereview: add khr as a person

R=golang-dev, gri
CC=golang-dev
https://codereview.appspot.com/9459046
api: update next.txt

R=minux.ma
CC=golang-dev
https://codereview.appspot.com/9459047