runtime: fix deadlock in parallel for test
The deadlock occurs when another goroutine requests GC
during the test. When wait=true the test expects physical parallelism,
that is, that P goroutines are all active at the same time.
If GC is requested, then part of the goroutines are not scheduled,
so other goroutines deadlock.
With wait=false, goroutines finish parallel for w/o waiting for all
other goroutines.
Fixes issue 3954.

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6820098
cmd/go: use correct paths with race detector
Currently the build fails with -race if a package in GOPATH
imports another package in GOPATH.

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/6811083
runtime: mark race instrumentation callbacks as nosplitstack
It speedups the race detector somewhat, but also prevents
getcallerpc() from obtaining lessstack().

R=golang-dev, iant
CC=golang-dev
http://codereview.appspot.com/6812091
cmd/gc: check for array bounds overflow in slice expression

The test for this is test/index.go, which is not run by
default.  That test does not currently pass even after this is
applied, due to issue 4348.

Fixes issue 4344.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
http://codereview.appspot.com/6815085
cmd/gc: don't require that slice index constants be small ints

The test for this is test/index.go, which is not run by
default.

R=remyoudompheng, rsc
CC=golang-dev
http://codereview.appspot.com/6812089
test: fix index.go to pass with recent index checks

The compiler now gives an error for out of bounds constant
indexes for arrays, and for negative constant indexes for both
arrays and slices.

With this change the index.go test passes if CLs 6815085,
6815088, and 6812089 are committed.

R=golang-dev, remyoudompheng, rsc
CC=golang-dev
http://codereview.appspot.com/6810085
cmd/gc, runtime: avoid unnecessary copy on type assertion.

When the first result of a type assertion is blank, the compiler would still copy out a potentially large non-interface type.

Fixes issue 1021.

R=golang-dev, bradfitz, rsc
CC=golang-dev
http://codereview.appspot.com/6812079
cmd/godoc: initialize filesystem and metadata for -url

Unlike when using -http, godoc -url didn't initialize the "filesystem"
and metadata that are used when generating responses. This CL adds this
initialization, so that -url provides the same results as an HTTP
request when using -http.

Fixes issue 4335.

R=golang-dev, minux.ma
CC=golang-dev
http://codereview.appspot.com/6817075

Committer: Shenghou Ma <minux.ma@gmail.com>
net/rpc: give hint to pass a pointer to Register
Fixes issue 4325.

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/6819081
sort: fix comment for various Search routines
Fixes issue 4205 (again).

R=r, 0xjnml
CC=golang-dev
http://codereview.appspot.com/6819082
cmd/go: invoke gcc -print-libgcc-file-name only once

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6741051
cmd/6g: fix use of large integers as indexes or array sizes.

A check for smallintconst was missing before generating the
comparisons.

Fixes issue 4348.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6815088
CONTRIBUTORS: Add Carl Mastrangelo (Google CLA).

R=golang-dev, nigeltao
CC=golang-dev
http://codereview.appspot.com/6812095
crypto/sha1: Make sha-1 do block mixup in place

Benchmarks:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          762          674  -11.55%
BenchmarkHash1K             8791         7375  -16.11%
BenchmarkHash8K            65094        54881  -15.69%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        10.50        11.86    1.13x
BenchmarkHash1K           116.48       138.84    1.19x
BenchmarkHash8K           125.85       149.27    1.19x

R=dave, rsc, iant
CC=golang-dev
http://codereview.appspot.com/6820096

Committer: Dave Cheney <dave@cheney.net>
net: implement IPv6 support for windows

Thank you zhoumichaely for original CL 5175042.

Fixes issue 1740.
Fixes issue 2315.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev, zhoumichaely
http://codereview.appspot.com/6822045
cmd/gc: refactor racewalk
It is refactoring towards generic walk
+ it handles mode nodes.
Partially fixes 4228 issue.

R=golang-dev, lvd, rsc
CC=golang-dev
http://codereview.appspot.com/6775098
cmd/gc: racewalk: do not double function calls
Current racewalk transformation looks like:
x := <-makeChan().c
\/\/\/\/\/\/\/\/\/
runtime.raceread(&makeChan().c)
x := <-makeChan().c
and so makeChan() is called twice.
With this CL the transformation looks like:
x := <-makeChan().c
\/\/\/\/\/\/\/\/\/
chan *tmp = &(makeChan().c)
raceread(&*tmp)
x := <-(*tmp)
Fixes issue 4245.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6822075
cmd/gc: racewalk: instrument returnsfromheap params
Fixes issue 4307.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6822073
runtime/race: lazily allocate shadow memory
Currently race detector runtime maps shadow memory eagerly at process startup.
It works poorly on Windows, because Windows requires reservation in swap file
(especially problematic if several Go program runs at the same, each consuming GBs
of memory).
With this change race detector maps shadow memory lazily, so Go runtime must notify
about all new heap memory.
It will help with Windows port, but also eliminates scary 16TB virtual mememory
consumption in top output (which sometimes confuses some monitoring scripts).

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6811085