runtime: clear up lr comments

R=cshapiro
CC=golang-dev
https://codereview.appspot.com/7230052
encoding/json: add test for Unmarshal of malformed data

Roll back CL making primitive type unmarshal faster,
because it broke the Unmarshal of malformed data.

Add benchmarks for unmarshal of primitive types.

Update issue 3949.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7228061
go/build: clean up after rollback

R=rsc
CC=golang-dev
https://codereview.appspot.com/7237049
go/misc/dist: Keep file modes when copying.

R=adg
CC=golang-dev
https://codereview.appspot.com/7221055
A+C: Rodrigo Rafael Monti Kochenburger (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://codereview.appspot.com/7247043
runtime: implement range access functions in race detector.

Range access functions are already available in TSan library
but were not yet used.

Time for go test -race -short:

Before:
compress/flate 24.244s
exp/norm       >200s
go/printer     78.268s

After:
compress/flate 17.760s
exp/norm        5.537s
go/printer      5.738s

Fixes issue 4250.

R=dvyukov, golang-dev, fullung
CC=golang-dev
https://codereview.appspot.com/7229044
C: add Hossein Sheikh Attar (Google CLA)

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/7241048
runtime: add support for panic/recover in Plan 9 note handler

This change also resolves some issues with note handling: we now make
sure that there is enough room at the bottom of every goroutine to
execute the note handler, and the `exitstatus' is no longer a global
entity, which resolves some race conditions.

R=rminnich, npe, rsc, ality
CC=golang-dev
https://codereview.appspot.com/6569068

Committer: Anthony Martin <ality@pbrane.org>
include: Plan 9: hide any previous definition of Runemax

Runemax is already defined in libc on 64-bit version of
Plan 9, but is not defined on other versions.
To accommodate, we make sure to rename any previous
instance of Runemax and re-define it subsequently.

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

Committer: Russ Cox <rsc@golang.org>
cmd/vet: detect misuse of atomic.Add*

Re-assigning the return value of an atomic operation to the same variable being operated is a common mistake:

x = atomic.AddUint64(&x, 1)

Add this check to go vet.

Fixes issue 4065.

R=dvyukov, golang-dev, remyoudompheng, rsc
CC=golang-dev
https://codereview.appspot.com/7097048

Committer: Russ Cox <rsc@golang.org>
encoding/xml: add (*Encoder).Indent

Exposing this on the Encoder allows streaming generation of indented XML.

R=golang-dev, rogpeppe
CC=golang-dev
https://codereview.appspot.com/7221075
crypto/rc4: add simple amd64 asm implementation.

(Although it's still half the speed of OpenSSL.)

benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         1409          398  -71.75%
BenchmarkRC4_1K         10920         2898  -73.46%
BenchmarkRC4_8K        131323        23083  -82.42%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        90.83       321.43    3.54x
BenchmarkRC4_1K         93.77       353.28    3.77x
BenchmarkRC4_8K         61.65       350.73    5.69x

R=rsc, remyoudompheng
CC=golang-dev, jgrahamc
https://codereview.appspot.com/7234055
cmd/cgo: allow for stdcall decorated dynimport names

To allow for stdcall decorated names on Windows, two changes were needed:
1. Change the symbol versioning delimiter '@' in cgo's dynimport output to a '#', and in cmd/ld when it parses dynimports.
2. Remove the "@N" decorator from the first argument of cgo's dynimport output (PE only).

Fixes issue 4607.

R=minux.ma, adg, rsc
CC=golang-dev
https://codereview.appspot.com/7047043

Committer: Russ Cox <rsc@golang.org>
A+C: Elias Naur (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://codereview.appspot.com/7230054
cmd/dist: fix code example in README

Fixes issue 4729.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/7232060
6l/5l: PIC and shared library support for the linkers.

Added the -shared flag to 5l/6l to output a PIC executable with the required
dynamic relocations and RIP-relative addressing in machine code.
Added dummy support to 8l to avoid compilation errors

See also:
https://codereview.appspot.com/6822078
https://codereview.appspot.com/7064048

and

https://groups.google.com/d/topic/golang-nuts/P05BDjLcQ5k/discussion

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

Committer: Russ Cox <rsc@golang.org>
runtime: local allocation in mprof.goc

Binary data in mprof.goc may prevent the garbage collector from freeing
memory blocks. This patch replaces all calls to runtime·mallocgc() with
calls to an allocator private to mprof.goc, thus making the private
memory invisible to the garbage collector. The addrhash variable is
moved outside of the .bss section.

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

Committer: Russ Cox <rsc@golang.org>
cmd/5l: reestablish uniform union field naming

R=golang-dev, minux.ma
CC=golang-dev
https://codereview.appspot.com/7226063
encoding/json: properly unmarshal empty arrays.

The JSON unmarshaller failed to allocate an array when there
are no values for the input causing the `[]` unmarshalled
to []interface{} to generate []interface{}(nil) rather than
[]interface{}{}. This wasn't caught in the tests because Decode()
works correctly and because jsonBig never generated zero-sized
arrays. The modification to scanner_test.go quickly triggers
the error:

without the change to decoder.go, but with the change to scanner_test.go:

$ go test
--- FAIL: TestUnmarshalMarshal (0.10 seconds)
decode_test.go:446:		Marshal jsonBig
scanner_test.go:206:	diverge at 70: «03c1OL6$":null},{"[=» vs «03c1OL6$":[]},{"[=^\»
FAIL
exit status 1
FAIL	encoding/json	0.266s

Also added a simple regression to decode_test.go.

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

Committer: Russ Cox <rsc@golang.org>
doc/go1.1.html: document division by zero change from CL 6710045

I am still not convinced this is a change we should make, but at least
documenting it will keep us from forgetting it as we get closer to Go 1.1.

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