]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
9 years agodoc: direct people to the mailing list
Brad Fitzpatrick [Sun, 18 Jan 2015 18:56:00 +0000 (10:56 -0800)]
doc: direct people to the mailing list

Since the move to Github, we've started to receive lots of
introductory questions to the bug tracker. I posit this is because
most projects on Github don't have mailing lists, so the culture on
Github is to use the Issue Tracker as a discussion forum.

The Go project doesn't use the Issue Tracker as our first point of
communication. This CL updates CONTRIBUTING.md (which is linked when
you file a bug or send a pull request), to mention that we have a
mailing list.

It certainly won't stop all the errant bug reports, but it should
help.

Change-Id: Id8fbfd35b73f5117617dff53b1e72d5b5276388b
Reviewed-on: https://go-review.googlesource.com/3002
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet/http/cgi: correctly handle pathnames for cygwin perl on windows
Martin Möhrmann [Sat, 17 Jan 2015 12:37:04 +0000 (13:37 +0100)]
net/http/cgi: correctly handle pathnames for cygwin perl on windows

Cygwin perl uses unix pathnames in windows. Include cygwin perl in the
list of special cases for unix pathname handling in test.cgi.

Change-Id: I30445a9cc79d62d022ecc232c35aa5015b7418dc
Reviewed-on: https://go-review.googlesource.com/2973
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
9 years agotest: generate tests for arithmetic on narrow types
Keith Randall [Fri, 16 Jan 2015 05:02:51 +0000 (21:02 -0800)]
test: generate tests for arithmetic on narrow types

Fixes #9607
Related to #9604
Inadvertently found #9609

Change-Id: I8a8ddf84ac72d3e18986fd8e9288734459f3f174
Reviewed-on: https://go-review.googlesource.com/2962
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoall: merge dev.cc (929f321) into master
Russ Cox [Fri, 16 Jan 2015 23:52:30 +0000 (18:52 -0500)]
all: merge dev.cc (929f321) into master

This brings in cmd/dist written in Go, which is working on the primary builders.

If this breaks your build, you need to get Go 1.4 and put it in $HOME/go1.4
(or, if you want to use some other directory, set $GOROOT_BOOTSTRAP
to that directory).

To build Go 1.4 from source:

git clone -b release-branch.go1.4 $GOROOT $HOME/go1.4
cd $HOME/go1.4/src
./make.bash

Or use a binary release: https://golang.org/dl/.

See https://golang.org/s/go15bootstrap for more information.

Change-Id: Ie4ae834c76ea35e39cc54e9878819a9e51b284d9

9 years agomisc/android: choose the right subdirectory for bin under GOPATH.
Hyang-Ah Hana Kim [Thu, 15 Jan 2015 21:47:41 +0000 (16:47 -0500)]
misc/android: choose the right subdirectory for bin under GOPATH.

This change includes the cleanup of temporary files created during
the binary execution as well.

Change-Id: Ic01a0a537d1daafcaa3acda1ec344aff5dcddfc2
Reviewed-on: https://go-review.googlesource.com/2903
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agomisc/cgo: skip testso on ppc64
Austin Clements [Fri, 16 Jan 2015 15:34:07 +0000 (10:34 -0500)]
misc/cgo: skip testso on ppc64

This test requires external linking, but we don't yet implement
external linking on ppc64 (tracked in issue #8912).  Disable the test
on ppc64 until external linking is implemented.

This makes all.bash pass on ppc64le.

Change-Id: I741498d4d9321607e7a65792a33faf8187bd18e4
Reviewed-on: https://go-review.googlesource.com/2908
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agomath/big: bug in AndNot(x,y) for x>0,y<0.
Keith Randall [Fri, 16 Jan 2015 04:45:07 +0000 (20:45 -0800)]
math/big: bug in AndNot(x,y) for x>0,y<0.

The comment says to use (y-1), but then we did add(y.abs, natOne).  We meant sub.

Fixes #9609

Change-Id: I4fe4783326ca082c05588310a0af7895a48fc779
Reviewed-on: https://go-review.googlesource.com/2961
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agosyscall: use name+(NN)FP on linux/arm
David Crawshaw [Wed, 14 Jan 2015 19:36:17 +0000 (14:36 -0500)]
syscall: use name+(NN)FP on linux/arm

Generated with a modified version of go vet and tested on android.

Change-Id: I1ff20135c5ab9de5a6dbf76ea2991167271ee70d
Reviewed-on: https://go-review.googlesource.com/2815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomisc/makerelease: a couple of small fixes
Andrew Gerrand [Fri, 16 Jan 2015 02:49:06 +0000 (13:49 +1100)]
misc/makerelease: a couple of small fixes

Change-Id: Iec19d6152b95ba67daac366b32d42f69e1dba9a4
Reviewed-on: https://go-review.googlesource.com/2951
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/5g: make sure we normalize after unary ops on small types
Keith Randall [Thu, 15 Jan 2015 22:39:58 +0000 (14:39 -0800)]
cmd/5g: make sure we normalize after unary ops on small types

We were failing ^uint16(0xffff) == 0, as we computed 0xffff0000 instead.

I could only trigger a failure for the above case, the other two tests
^uint16(0xfffe) == 1 and -uint16(0xffff) == 1 didn't seem to fail
previously.  Somehow they get MOVHUs inserted for other reasons (used
by CMP instead of TST?).  I fixed OMINUS anyway, better safe than
sorry.

Fixes #9604

Change-Id: I4c2d5bdc667742873ac029fdbe3db0cf12893c27
Reviewed-on: https://go-review.googlesource.com/2940
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agonet: fix some typos in comments
Ian Lance Taylor [Thu, 15 Jan 2015 05:25:26 +0000 (21:25 -0800)]
net: fix some typos in comments

Change-Id: I1bf1ab930a5c258f5fcc85ca3037692c71bf3cb2
Reviewed-on: https://go-review.googlesource.com/2870
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agomisc/makerelease: use built in "del" to remove files
Andrew Gerrand [Thu, 15 Jan 2015 22:11:17 +0000 (09:11 +1100)]
misc/makerelease: use built in "del" to remove files

Git marks some of its files read only, so os.RemoveAll isn't sufficient
to remove them from the ".git" directory.

Change-Id: I3150596931d1c77e7cf9fb8da1a999d2c6730121
Reviewed-on: https://go-review.googlesource.com/2930
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agostrings: add Compare(x, y string) int, for symmetry with bytes.Compare
Alan Donovan [Wed, 14 Jan 2015 23:09:36 +0000 (18:09 -0500)]
strings: add Compare(x, y string) int, for symmetry with bytes.Compare

The implementation is the same assembly (or Go) routine.

Change-Id: Ib937c461c24ad2d5be9b692b4eed40d9eb031412
Reviewed-on: https://go-review.googlesource.com/2828
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoall: update old comments referencing *.goc files
Brad Fitzpatrick [Thu, 15 Jan 2015 16:26:01 +0000 (08:26 -0800)]
all: update old comments referencing *.goc files

Change-Id: Ibf05e55ffe3bb454809cd3450b790e44061511c7
Reviewed-on: https://go-review.googlesource.com/2890
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agobuild: androidtest.bash has to use copy for files to adb-sync.
Hyang-Ah Hana Kim [Wed, 14 Jan 2015 17:13:17 +0000 (12:13 -0500)]
build: androidtest.bash has to use copy for files to adb-sync.

androidtest.bash copies some go source to the android device
where the tests are going to run. It's necessary because some
tests require files and resources to be present. The copy is
done through adb sync. The script hoped faking the directory
using symlinks to work, but it doesn't. (adb sync doesn't follow
the symlinks) We need proper copy.

Change-Id: If55abca4958f159859e58512b0045f23654167e3
Reviewed-on: https://go-review.googlesource.com/2827
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoencoding/xml: remove unnecessary memory allocation in Unmarshal
Dmitry Vyukov [Wed, 14 Jan 2015 18:32:05 +0000 (21:32 +0300)]
encoding/xml: remove unnecessary memory allocation in Unmarshal

benchmark              old ns/op     new ns/op     delta
BenchmarkUnmarshal     75256         72626         -3.49%

benchmark              old allocs     new allocs     delta
BenchmarkUnmarshal     259            219            -15.44%

Change-Id: I7fd30739b045e35b95e6ef6a8ef2f15b0dd6839c
Reviewed-on: https://go-review.googlesource.com/2758
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: fix runtime-gdb script loading
Paul Nasrat [Wed, 14 Jan 2015 19:32:01 +0000 (14:32 -0500)]
runtime: fix runtime-gdb script loading

runtime.rtype was a copy of reflect.rtype - update script to use that directly.
Introduces a basic test which will skip on systems without appropriate GDB.

Fixes #9326

Change-Id: I6ec74e947bd2e1295492ca34b3a8c1b49315a8cb
Reviewed-on: https://go-review.googlesource.com/2821
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodoc: document Go 1.4.1
Andrew Gerrand [Thu, 15 Jan 2015 04:28:12 +0000 (15:28 +1100)]
doc: document Go 1.4.1

Change-Id: I4e9737497f4995657c46e52e0722d921499f8d17
Reviewed-on: https://go-review.googlesource.com/2854
Reviewed-by: Rob Pike <r@golang.org>
9 years agobuild: fix typo in androidtest.bash
Burcu Dogan [Thu, 15 Jan 2015 02:49:03 +0000 (18:49 -0800)]
build: fix typo in androidtest.bash

Change-Id: Idd72e095ad64e1a398058982422c2c5497a23ce5
Reviewed-on: https://go-review.googlesource.com/2739
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocrypto/x509: write exact BitLength in ASN.1 encoding for certificate KeyUsage
Adam Langley [Mon, 12 Jan 2015 21:58:30 +0000 (13:58 -0800)]
crypto/x509: write exact BitLength in ASN.1 encoding for certificate KeyUsage

The encoded value of the certificate KeyUsage did contain additonal padding
that was not present with other certificate generators. According to ITU-T
X.690 the BitLength value should have no padding in a DER encoding.

See discussion:
https://groups.google.com/forum/#!topic/golang-nuts/dzaJ3hMpDcs

This CL has been discussed at: http://golang.org/cl/168990043

Change-Id: I1eff3f441b0566966a2d279631901ad9287c917d
Reviewed-on: https://go-review.googlesource.com/2255
Reviewed-by: Adam Langley <agl@golang.org>
9 years ago[dev.cc] all: merge master (d1210ac) into dev.cc
Russ Cox [Thu, 15 Jan 2015 00:39:34 +0000 (19:39 -0500)]
[dev.cc] all: merge master (d1210ac) into dev.cc

Change-Id: I068d617175776c2f5df00b17ff0d404a584ab570

9 years agotime: correctly parse large input durations and avoid precision loss
Martin Möhrmann [Wed, 7 Jan 2015 18:56:06 +0000 (19:56 +0100)]
time: correctly parse large input durations and avoid precision loss

Do not lose precision for durations specified without fractions
that can be represented by an int64 such as 1<<53+1 nanoseconds.
Previously there was some precision lost in floating point conversion.

Handle overflow for durations above 1<<63-1 nanoseconds but not earlier.

Add tests to cover the above cases.

Change-Id: I4bcda93cee1673e501ecb6a9eef3914ee29aecd2
Reviewed-on: https://go-review.googlesource.com/2461
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agotest: comment the behavior and use of cmplxdivide*
Rob Pike [Wed, 14 Jan 2015 23:43:04 +0000 (10:43 +1100)]
test: comment the behavior and use of cmplxdivide*

The various files are confusingly named and their operation
not easy to see. Add a comment to cmplxdivide.c, one of the few
C files that will endure in the repository, to explain how to build
and run the test.

Change-Id: I1fd5c564a14217e1b9815b09bc24cc43c54c096f
Reviewed-on: https://go-review.googlesource.com/2850
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: fix *bsd/amd64 build
Matthew Dempsky [Wed, 14 Jan 2015 21:30:34 +0000 (13:30 -0800)]
runtime: fix *bsd/amd64 build

6g does not implement dead code elimination for const switches like it
does for const if statements, so the undefined raiseproc() function
was resulting in a link-time failure.

Change-Id: Ie4fcb3716cb4fe6e618033071df9de545ab3e0af
Reviewed-on: https://go-review.googlesource.com/2830
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agomisc/makerelease: check out core from git repo, use new oauth2 package
Andrew Gerrand [Wed, 14 Jan 2015 10:39:18 +0000 (21:39 +1100)]
misc/makerelease: check out core from git repo, use new oauth2 package

Change-Id: I072cf2b9149a05901cc19e7aeb0e9d0936a8dbe3
Reviewed-on: https://go-review.googlesource.com/2793
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: delete dead code called from C.
Russ Cox [Wed, 14 Jan 2015 21:41:39 +0000 (16:41 -0500)]
runtime: delete dead code called from C.

printf, vprintf, snprintf, gc_m_ptr, gc_g_ptr, gc_itab_ptr, gc_unixnanotime.

These were called from C.
There is no more C.

Now that vprintf is gone, delete roundup, which is unsafe (see CL 2814).

Change-Id: If8a7b727d497ffa13165c0d3a1ed62abc18f008c
Reviewed-on: https://go-review.googlesource.com/2824
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: avoid race checking for preemption
Russ Cox [Wed, 14 Jan 2015 21:36:41 +0000 (16:36 -0500)]
runtime: avoid race checking for preemption

Moving the "don't really preempt" check up earlier in the function
introduced a race where gp.stackguard0 might change between
the early check and the later one. Since the later one is missing the
"don't really preempt" logic, it could decide to preempt incorrectly.
Pull the result of the check into a local variable and use an atomic
to access stackguard0, to eliminate the race.

I believe this will fix the broken OS X and Solaris builders.

Change-Id: I238350dd76560282b0c15a3306549cbcf390dbff
Reviewed-on: https://go-review.googlesource.com/2823
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: define netpollinited on Plan 9
David du Colombier [Wed, 14 Jan 2015 21:20:03 +0000 (22:20 +0100)]
runtime: define netpollinited on Plan 9

Since CL 2750, the build is broken on Plan 9,
because a new function netpollinited was added
and called from findrunnable in proc1.go.
However, netpoll is not implemented on Plan 9.
Thus, we define netpollinited in netpoll_stub.go.

Fixes #9590

Change-Id: I0895607b86cbc7e94c1bfb2def2b1a368a8efbe6
Reviewed-on: https://go-review.googlesource.com/2759
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: fix bugs in previous commit
Russ Cox [Wed, 14 Jan 2015 20:48:32 +0000 (15:48 -0500)]
runtime: fix bugs in previous commit

These were fixed in my local commit,
but I forgot that the web Submit button can't see that.

Change-Id: Iec3a70ce3ccd9db2a5394ae2da0b293e45ac2fb5
Reviewed-on: https://go-review.googlesource.com/2822
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: change tinyalloc, persistentalloc not to point past allocated data
Russ Cox [Wed, 14 Jan 2015 19:13:55 +0000 (14:13 -0500)]
runtime: change tinyalloc, persistentalloc not to point past allocated data

During all.bash I got a crash in the GOMAXPROCS=2 runtime test reporting
that the write barrier in the assignment 'c.tiny = add(x, size)' had been
given a pointer pointing into an unexpected span. The problem is that
the tiny allocation was at the end of a span and c.tiny was now pointing
to the end of the allocation and therefore to the end of the span aka
the beginning of the next span.

Rewrite tinyalloc not to do that.

More generally, it's not okay to call add(p, size) unless you know that p
points at > (not just >=) size bytes. Similarly, pretty much any call to
roundup doesn't know how much space p points at, so those are all
broken.

Rewrite persistentalloc not to use add(p, totalsize) and not to use roundup.

There is only one use of roundup left, in vprintf, which is dead code.
I will remove that code and roundup itself in a followup CL.

Change-Id: I211e307d1a656d29087b8fd40b2b71010722fb4a
Reviewed-on: https://go-review.googlesource.com/2814
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime: fix accounting race in printlock
Russ Cox [Wed, 14 Jan 2015 19:57:10 +0000 (14:57 -0500)]
runtime: fix accounting race in printlock

It could happen that mp.printlock++ happens, then on entry to lock,
the goroutine is preempted and then rescheduled onto another m
for the actual call to lock. Now the lock and the printlock++ have
happened on different m's. This can lead to printlock not being
unlocked, which either gives a printing deadlock or a crash when
the goroutine reschedules, because m.locks > 0.

Change-Id: Ib0c08740e1b53de3a93f7ebf9b05f3dceff48b9f
Reviewed-on: https://go-review.googlesource.com/2819
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years ago[dev.cc] build: do not pass GOHOSTOS and GOHOSTARCH to Go 1.4 build
Russ Cox [Wed, 14 Jan 2015 20:14:54 +0000 (15:14 -0500)]
[dev.cc] build: do not pass GOHOSTOS and GOHOSTARCH to Go 1.4 build

Go 1.4 should build what it knows how to build.
GOHOSTOS and GOHOSTARCH are for the Go 1.5 build only.

Change-Id: Id0f367f03485100a896e61cfdace4ac44a22e16d
Reviewed-on: https://go-review.googlesource.com/2818
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoliblink: adjustments for c2go conversion
Russ Cox [Mon, 12 Jan 2015 20:17:10 +0000 (15:17 -0500)]
liblink: adjustments for c2go conversion

Mostly this is using uint32 instead of int32 for unsigned values
like instruction encodings or float32 bit representations,
removal of ternary operations, and removal of #defines.

Delete sched9.c, because it is not compiled (it is still in the history
if we ever need it).

Change-Id: I68579cfea679438a27a80416727a9af932b088ae
Reviewed-on: https://go-review.googlesource.com/2658
Reviewed-by: Austin Clements <austin@google.com>
9 years ago[dev.cc] build: fix cross-compilation
Russ Cox [Wed, 14 Jan 2015 16:50:21 +0000 (11:50 -0500)]
[dev.cc] build: fix cross-compilation

Fixes #9574.

Change-Id: Ifd7ecccb25e934f9aba284b2d72b6b22f18cb0b6
Reviewed-on: https://go-review.googlesource.com/2812
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: log all thread stack traces during GODEBUG=crash on Linux and OS X
Russ Cox [Wed, 14 Jan 2015 16:18:24 +0000 (11:18 -0500)]
runtime: log all thread stack traces during GODEBUG=crash on Linux and OS X

Normally, a panic/throw only shows the thread stack for the current thread
and all paused goroutines. Goroutines running on other threads, or other threads
running on their system stacks, are opaque. Change that when GODEBUG=crash,
by passing a SIGQUIT around to all the threads when GODEBUG=crash.
If this works out reasonably well, we might make the SIGQUIT relay part of
the standard panic/throw death, perhaps eliding idle m's.

Change-Id: If7dd354f7f3a6e326d17c254afcf4f7681af2f8b
Reviewed-on: https://go-review.googlesource.com/2811
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agosyscall: match seek argument size to signature
David Crawshaw [Wed, 14 Jan 2015 15:20:58 +0000 (10:20 -0500)]
syscall: match seek argument size to signature

Caught by go vet:
asm_linux_arm.s:110: [arm] seek: wrong argument size 32; expected $...-28

Change-Id: I62ec5327a25bff9ef501c42cc1e28ea7ec78510f
Reviewed-on: https://go-review.googlesource.com/2810
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: fix spurious deadlock in netpoll
Dmitry Vyukov [Tue, 13 Jan 2015 17:12:50 +0000 (20:12 +0300)]
runtime: fix spurious deadlock in netpoll

There is a small possibility that runtime deadlocks when netpoll is just activated.
Consider the following scenario:
GOMAXPROCS=1
epfd=-1 (netpoll is not activated yet)
A thread is in findrunnable, sets sched.lastpoll=0, calls netpoll(true),
which returns nil. Now the thread is descheduled for some time.
Then sysmon retakes a P from syscall and calls handoffp.
The "If this is the last running P and nobody is polling network" check in handoffp fails,
since the first thread set sched.lastpoll=0. So handoffp decides that there is already
a thread that polls network and so it calls pidleput.
Now the first thread is scheduled again, finds no work and calls stopm.
There is no thread that polls network and so checkdead reports deadlock.

To fix this, don't set sched.lastpoll=0 when netpoll is not activated.

The deadlock can happen if cgo is disabled (-tag=netgo) and only on program startup
(when netpoll is just activated).

The test is from issue 5216 that lead to addition of the
"If this is the last running P and nobody is polling network" check in handoffp.

Update issue 9576.

Change-Id: I9405f627a4d37bd6b99d5670d4328744aeebfc7a
Reviewed-on: https://go-review.googlesource.com/2750
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: rename var checkmark to checkmarkphase
Austin Clements [Mon, 12 Jan 2015 18:45:40 +0000 (13:45 -0500)]
runtime: rename var checkmark to checkmarkphase

The old name was too ambiguous (is it a verb?  is it a predicate?  is
it a constant?) and too close to debug.gccheckmark.  Hopefully the new
name conveys that this variable indicates that we are currently doing
mark checking.

Change-Id: I031cd48b0906cdc7774f5395281d3aeeb8ef3ec9
Reviewed-on: https://go-review.googlesource.com/2656
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agoruntime: fix a few GC-related bugs
Russ Cox [Tue, 13 Jan 2015 20:55:16 +0000 (15:55 -0500)]
runtime: fix a few GC-related bugs

1) Move non-preemption check even earlier in newstack.
This avoids a few priority inversion problems.

2) Always use atomic operations to update bitmap for 1-word objects.
This avoids lost mark bits during concurrent GC.

3) Stop using work.nproc == 1 as a signal for being single-threaded.
The concurrent GC runs with work.nproc == 1 but other procs are
running mutator code.

The use of work.nproc == 1 in getfull *is* safe, but remove it anyway,
since it is saving only a single atomic operation per GC round.

Fixes #9225.

Change-Id: I24134f100ad592ea8cb59efb6a54f5a1311093dc
Reviewed-on: https://go-review.googlesource.com/2745
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agocmd/go: adjust error for custom import checkout mismatch
Russ Cox [Wed, 14 Jan 2015 06:23:26 +0000 (01:23 -0500)]
cmd/go: adjust error for custom import checkout mismatch

Before:

...
imports golang.org/x/net/context: /Users/rsc/g/src/golang.org/x/net is from https://code.google.com/p/go.net, should be from https://go.googlesource.com/net

After:

...
imports golang.org/x/net/context: golang.org/x/net is a custom import path for https://go.googlesource.com/net, but /Users/rsc/g/src/golang.org/x/net is checked out from https://code.google.com/p/go.net

Change-Id: I93c35b85f955c7de684f71fbd4baecc717405318
Reviewed-on: https://go-review.googlesource.com/2808
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agosyscall: use name+(NN)FP for darwin
David Crawshaw [Tue, 13 Jan 2015 19:18:13 +0000 (14:18 -0500)]
syscall: use name+(NN)FP for darwin

Generated from a script using go vet then read by a human.

Change-Id: Ie5f7ab3a1075a9c8defbf5f827a8658e3eb55cab
Reviewed-on: https://go-review.googlesource.com/2746
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoimage/draw: fold TestClipWithNilMP into TestClip.
Nigel Tao [Mon, 5 Jan 2015 05:08:40 +0000 (16:08 +1100)]
image/draw: fold TestClipWithNilMP into TestClip.

https://go-review.googlesource.com/#/c/1876/ introduced a new
TestClipWithNilMP test, along with a code change that fixed a panic,
but the existing TestClip test already contained almost enough machinery
to cover that bug.

There is a small code change in this CL, but it is a no-op: (*x).y is
equivalent to x.y for a pointer-typed x, but the latter is cleaner.

Change-Id: I79cf6952a4999bc4b91f0a8ec500acb108106e56
Reviewed-on: https://go-review.googlesource.com/2304
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agoruntime: use runtime.sysargs to parse auxv on linux/arm
Dave Cheney [Sun, 11 Jan 2015 03:40:08 +0000 (03:40 +0000)]
runtime: use runtime.sysargs to parse auxv on linux/arm

Make auxv parsing in linux/arm less of a special case.

* rename setup_auxv to sysargs
* exclude linux/arm from vdso_none.go
* move runtime.checkarm after runtime.sysargs so arm specific
  values are properly initialised

Change-Id: I1ca7f5844ad5a162337ff061a83933fc9a2b5ff6
Reviewed-on: https://go-review.googlesource.com/2681
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocrypto/x509: add cert SmartOS cert path
Dave Cheney [Mon, 12 Jan 2015 23:43:43 +0000 (10:43 +1100)]
crypto/x509: add cert SmartOS cert path

Fix SmartOS build that was broken in 682922908f7.

SmartOS pretends to be Ubuntu/Debian with respect to its SSL
certificate location.

Change-Id: I5405c6472c8a1e812e472e7301bf6084c17549d6
Reviewed-on: https://go-review.googlesource.com/2704
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: make windows goenvs look more like Go
Alex Brainman [Tue, 13 Jan 2015 05:43:34 +0000 (16:43 +1100)]
runtime: make windows goenvs look more like Go

Change-Id: I4f84a89553f77382a8064f49db0f5eb575b64313
Reviewed-on: https://go-review.googlesource.com/2714
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocrypto/tls: remove return parameter stutter
Brad Fitzpatrick [Tue, 13 Jan 2015 19:34:46 +0000 (11:34 -0800)]
crypto/tls: remove return parameter stutter

Per https://golang.org/s/style#named-result-parameters

Change-Id: If69d3e6d3dbef385a0f41e743fa49c25475ca40c
Reviewed-on: https://go-review.googlesource.com/2761
Reviewed-by: Adam Langley <agl@golang.org>
9 years agosort: reduce number of comparisons needed by medianOfThree
Martin Möhrmann [Fri, 9 Jan 2015 22:25:42 +0000 (23:25 +0100)]
sort: reduce number of comparisons needed by medianOfThree

For some cases we can ensure the correct order of elements in two
instead of three comparisons. It is unnecessary to compare m0 and
m1 again if m2 and m1 are not swapped.

benchmark                   old ns/op      new ns/op      delta
BenchmarkSortString1K       302721         299590         -1.03%
BenchmarkSortInt1K          124055         123215         -0.68%
BenchmarkSortInt64K         12291522       12203402       -0.72%
BenchmarkSort1e2            58027          57111          -1.58%
BenchmarkSort1e4            12426805       12341761       -0.68%
BenchmarkSort1e6            1966250030     1960557883     -0.29%

Change-Id: I2b17ff8dee310ec9ab92a6f569a95932538768a9
Reviewed-on: https://go-review.googlesource.com/2614
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agoreflect: remove extra word in comment
Ian Lance Taylor [Tue, 13 Jan 2015 18:40:15 +0000 (10:40 -0800)]
reflect: remove extra word in comment

Change-Id: I06881fc447a5fae0067557c317f69a0427bed337
Reviewed-on: https://go-review.googlesource.com/2760
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: move SetErrorMode constants into function so they are not exported
Alex Brainman [Tue, 13 Jan 2015 06:17:53 +0000 (17:17 +1100)]
runtime: move SetErrorMode constants into function so they are not exported

Change-Id: Ib1a2adbcdbd7d96f9b4177abc3c9cf0ab09c1df4
Reviewed-on: https://go-review.googlesource.com/2716
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agobuild: bootstrap on Plan 9
David du Colombier [Tue, 13 Jan 2015 07:01:18 +0000 (08:01 +0100)]
build: bootstrap on Plan 9

This change implements the requirement of
old Go to build new Go on Plan 9. Also fix
the build of the new cmd/dist written in Go.

This is similar to the make.bash change in
CL 2470, but applied to make.rc for Plan 9.

Change-Id: Ifd9a3bd8658e2cee6f92b4c7f29ce86ee2a93c53
Reviewed-on: https://go-review.googlesource.com/2662
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: allow fake time writes to both stdout and stderr
Andrew Gerrand [Tue, 13 Jan 2015 05:33:55 +0000 (16:33 +1100)]
runtime: allow fake time writes to both stdout and stderr

In the previous sandbox implementation we read all sandboxed output
from standard output, and so all fake time writes were made to
standard output. Now we have a more sophisticated sandbox server
(see golang.org/x/playground/sandbox) that is capable of recording
both standard output and standard error, so allow fake time writes to
go to either file descriptor.

Change-Id: I79737deb06fd8e0f28910f21f41bd3dc1726781e
Reviewed-on: https://go-review.googlesource.com/2713
Reviewed-by: Minux Ma <minux@golang.org>
9 years agonet/http: deflake TestResponseWriterWriteStringAllocs, test interface instead
Brad Fitzpatrick [Tue, 13 Jan 2015 01:23:18 +0000 (17:23 -0800)]
net/http: deflake TestResponseWriterWriteStringAllocs, test interface instead

Skip the allocation testing (which was only used as a signal for
whether the interface was implemented by ResponseWriter), and just
test for it directly.

Fixes #9575

Change-Id: Ie230f1d21b104537d5647e9c900a81509d692469
Reviewed-on: https://go-review.googlesource.com/2720
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
9 years agogo1.5.txt: better checking of struct tags
Rob Pike [Mon, 12 Jan 2015 23:16:30 +0000 (10:16 +1100)]
go1.5.txt: better checking of struct tags

Change-Id: I0e726a2c0fa1231011b183c3e917414d876555d8
Reviewed-on: https://go-review.googlesource.com/2700
Reviewed-by: Rob Pike <r@golang.org>
9 years agogo1.5.txt: log: add global Output function
Rob Pike [Mon, 12 Jan 2015 23:07:54 +0000 (10:07 +1100)]
go1.5.txt: log: add global Output function

Change-Id: I5a54a041cfe9ff2d9514f2d6596b53ec7fc91845
Reviewed-on: https://go-review.googlesource.com/2689
Reviewed-by: Rob Pike <r@golang.org>
9 years agobuild: update Windows make.bat for Go-based dist
Brad Fitzpatrick [Mon, 12 Jan 2015 22:03:59 +0000 (14:03 -0800)]
build: update Windows make.bat for Go-based dist

These are corresponding Windows changes for the GOROOT_BOOTSTRAP and
dist changes in https://golang.org/cl/2470

Change-Id: I21da2d63a60d8ae278ade9bb71ae0c314a2cf9b5
Reviewed-on: https://go-review.googlesource.com/2674
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
9 years agocrypto/x509: Correction of incrorrect default version number in TBSCertificateList...
Paul van Brouwershaven [Mon, 5 Jan 2015 11:27:40 +0000 (11:27 +0000)]
crypto/x509: Correction of incrorrect default version number in TBSCertificateList and Certificate.CreateCRL

RFC5280 states:

"This optional field describes the version of the encoded CRL.  When
 extensions are used, as required by this profile, this field MUST be
 present and MUST specify version 2 (the integer value is 1)."

This CL has been discussed at: http://golang.org/cl/172560043

Change-Id: I8a72d7593d5ca6714abe9abd6a37437c3b69ab0f
Reviewed-on: https://go-review.googlesource.com/2259
Reviewed-by: Adam Langley <agl@golang.org>
9 years agocrypto/elliptic: add Name field to CurveParams struct
David Leon Gil [Sat, 27 Dec 2014 02:24:39 +0000 (18:24 -0800)]
crypto/elliptic: add Name field to CurveParams struct

And add names for the curve implemented in crypto/elliptic.

This permits a safer alternative to switching on BitSize
for code that implements curve-dependent cryptosystems.
(E.g., ECDSA on P-xxx curves with the matched SHA-2
instances.)

Change-Id: I653c8f47506648028a99a96ebdff8389b2a95fc1
Reviewed-on: https://go-review.googlesource.com/2133
Reviewed-by: Adam Langley <agl@golang.org>
9 years agocrypto/x509: NULL parameter MUST be present in the Signature Algorithm (RSA)
Paul van Brouwershaven [Mon, 5 Jan 2015 11:10:05 +0000 (11:10 +0000)]
crypto/x509: NULL parameter MUST be present in the Signature Algorithm (RSA)

According to RFC4055 a NULL parameter MUST be present in the signature
algorithm. This patch adds the NULL value to the Signature Algorithm
parameters in the signingParamsForPrivateKey function for RSA based keys.

Section 2.1 states:

"There are two possible encodings for the AlgorithmIdentifier
parameters field associated with these object identifiers.  The two
alternatives arise from the loss of the OPTIONAL associated with the
algorithm identifier parameters when the 1988 syntax for
AlgorithmIdentifier was translated into the 1997 syntax.  Later the
OPTIONAL was recovered via a defect report, but by then many people
thought that algorithm parameters were mandatory.  Because of this
history some implementations encode parameters as a NULL element
while others omit them entirely.  The correct encoding is to omit the
parameters field; however, when RSASSA-PSS and RSAES-OAEP were
defined, it was done using the NULL parameters rather than absent
parameters.

All implementations MUST accept both NULL and absent parameters as
legal and equivalent encodings.

To be clear, the following algorithm identifiers are used when a NULL
parameter MUST be present:

   sha1Identifier AlgorithmIdentifier ::= { id-sha1, NULL }
   sha224Identifier AlgorithmIdentifier ::= { id-sha224, NULL }
   sha256Identifier AlgorithmIdentifier ::= { id-sha256, NULL }
   sha384Identifier AlgorithmIdentifier ::= { id-sha384, NULL }
   sha512Identifier AlgorithmIdentifier ::= { id-sha512, NULL }"

This CL has been discussed at: http://golang.org/cl/177610043

Change-Id: Ic782161938b287f34f64ef5eb1826f0d936f2f71
Reviewed-on: https://go-review.googlesource.com/2256
Reviewed-by: Adam Langley <agl@golang.org>
9 years agocmd/cgo: also rewrite C.var in selector expressions
Shenghou Ma [Mon, 12 Jan 2015 05:12:59 +0000 (00:12 -0500)]
cmd/cgo: also rewrite C.var in selector expressions

While we're here, rename TestIssue7234 to Test7234 for consistency
with other tests.

Fixes #9557.

Change-Id: I22b0a212b31e7b4f199f6a70deb73374beb80f84
Reviewed-on: https://go-review.googlesource.com/2654
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agosyscall: fix nacl builds
Shenghou Ma [Fri, 9 Jan 2015 02:49:28 +0000 (21:49 -0500)]
syscall: fix nacl builds

Please see golang.org/cl/2588 for reasons behind the name change.
We also need NO_LOCAL_POINTERS for assembly function with non-zero
local frame size.

Change-Id: Iac60aa7e76f4c2ece3726e28878fd539bfebf7a4
Reviewed-on: https://go-review.googlesource.com/2589
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/dist: fix arm vfp detection
Dave Cheney [Sun, 11 Jan 2015 06:12:20 +0000 (06:12 +0000)]
cmd/dist: fix arm vfp detection

* Use WORD declaration so 5a can't rewrite the instruction or complain
  about forms it doesn't know about.
* Add the interpunct to function declaration.

Change-Id: I8494548db21b3ea52f0e1e0e547d9ead8b93dfd1
Reviewed-on: https://go-review.googlesource.com/2682
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: add GODEBUG=gccheckmark=0/1
Austin Clements [Fri, 9 Jan 2015 19:00:40 +0000 (14:00 -0500)]
runtime: add GODEBUG=gccheckmark=0/1

Previously, gccheckmark could only be enabled or disabled by calling
runtime.GCcheckmarkenable/GCcheckmarkdisable.  This was a necessary
hack because GODEBUG was broken.

Now that GODEBUG works again, move control over gccheckmark to a
GODEBUG variable and remove these runtime functions.  Currently,
gccheckmark is enabled by default (and will probably remain so for
much of the 1.5 development cycle).

Change-Id: I2bc6f30c21b795264edf7dbb6bd7354b050673ab
Reviewed-on: https://go-review.googlesource.com/2603
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agolog: add global Output function
Rob Pike [Mon, 12 Jan 2015 03:30:10 +0000 (14:30 +1100)]
log: add global Output function

It was just an oversight that this one method of Logger was not
made available for the standard (std) Logger.

Fixes #9183

Change-Id: I2f251becdb0bae459212d09ea0e5e88774d16dea
Reviewed-on: https://go-review.googlesource.com/2686
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/gc: don't recurse infinitely when a recursive type references itself more than...
Shenghou Ma [Tue, 23 Dec 2014 22:14:04 +0000 (17:14 -0500)]
cmd/gc: don't recurse infinitely when a recursive type references itself more than once

Fixes #9432

Change-Id: I08c92481afa7c7fac890aa780efc1cb2fabad528
Reviewed-on: https://go-review.googlesource.com/2115
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/gc: fix racewalk after writebarrierfat was renamed to typedmemmove
Daniel Morsing [Sat, 10 Jan 2015 17:53:13 +0000 (17:53 +0000)]
cmd/gc: fix racewalk after writebarrierfat was renamed to typedmemmove

Renaming the function broke the race detector since it looked for the
name, didn't find it anymore and didn't insert the necessary
instrumentation.

Change-Id: I11fed6e807cc35be5724d26af12ceff33ebf4f7b
Reviewed-on: https://go-review.googlesource.com/2661
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime: remove duplicate copyright notice
Dave Cheney [Sun, 11 Jan 2015 01:23:52 +0000 (12:23 +1100)]
runtime: remove duplicate copyright notice

Change-Id: Ibe3ba6426cc6e683ff3712faf6119922d0f88b5a
Reviewed-on: https://go-review.googlesource.com/2680
Reviewed-by: Minux Ma <minux@golang.org>
9 years agobuild: require old Go to build new Go (and convert cmd/dist to Go)
Russ Cox [Wed, 7 Jan 2015 16:38:00 +0000 (11:38 -0500)]
build: require old Go to build new Go (and convert cmd/dist to Go)

This CL introduces the bootstrap requirement that in order to
build the current release (or development version) of Go, you
need an older Go release (1.4 or newer) already installed.
This requirement is the whole point of this CL.

To enforce the requirement, convert cmd/dist from C to Go.

With this bootstrapping out of the way, we can move on to
replacing other, larger C programs like the Go compiler,
the assemblers, and the linker.

See golang.org/s/go15bootstrap for details.

Change-Id: I53fd08ddacf3df9fae94fe2c986dba427ee4a21d
Reviewed-on: https://go-review.googlesource.com/2470
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/dist: remove C sources, rename some to Go files
Russ Cox [Wed, 7 Jan 2015 16:37:04 +0000 (11:37 -0500)]
cmd/dist: remove C sources, rename some to Go files

This CL makes the next one have nice cross-file diffs.

Change-Id: I9ce897dc505dea9923be4e823bae31f4f7fa2ee2
Reviewed-on: https://go-review.googlesource.com/2471
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http/httputil: skip TestReverseProxyCancellation on Plan 9
David du Colombier [Sat, 10 Jan 2015 00:13:58 +0000 (01:13 +0100)]
net/http/httputil: skip TestReverseProxyCancellation on Plan 9

Update #9554

Change-Id: I7de2a7d585d56b84ab975565042ed997e6124e08
Reviewed-on: https://go-review.googlesource.com/2613
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/5a, cmd/6a, cmd/8a, cmd/9a: check nerrors before exit
Shenghou Ma [Fri, 9 Jan 2015 06:23:45 +0000 (01:23 -0500)]
cmd/5a, cmd/6a, cmd/8a, cmd/9a: check nerrors before exit

Also fix one unaligned stack size for nacl that is caught
by this change.

Fixes #9539.

Change-Id: Ib696a573d3f1f9bac7724f3a719aab65a11e04d3
Reviewed-on: https://go-review.googlesource.com/2600
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/gc: fix ARM build
Josh Bleecher Snyder [Fri, 9 Jan 2015 23:16:14 +0000 (15:16 -0800)]
cmd/gc: fix ARM build

CL 2520 omitted to set the type for an OCONVNOP node.
Typechecking obviously cannot do it for us.

5g inserts float64 <--> [u]int64 conversions at walk time.
The missing type caused it to crash.

Change-Id: Idce381f219bfef2e3a3be38d3ba3c258b71310ae
Reviewed-on: https://go-review.googlesource.com/2640
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/gc: optimize memclr of slices and arrays
Josh Bleecher Snyder [Thu, 8 Jan 2015 01:44:49 +0000 (17:44 -0800)]
cmd/gc: optimize memclr of slices and arrays

Recognize loops of the form

for i := range a {
a[i] = zero
}

in which the evaluation of a is free from side effects.
Replace these loops with calls to memclr.
This occurs in the stdlib in 18 places.

The motivating example is clearing a byte slice:

benchmark                old ns/op     new ns/op     delta
BenchmarkGoMemclr5       3.31          3.26          -1.51%
BenchmarkGoMemclr16      13.7          3.28          -76.06%
BenchmarkGoMemclr64      50.8          4.14          -91.85%
BenchmarkGoMemclr256     157           6.02          -96.17%

Update #5373.

Change-Id: I99d3e6f5f268e8c6499b7e661df46403e5eb83e4
Reviewed-on: https://go-review.googlesource.com/2520
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoruntime: add missing copyright notices
Ian Lance Taylor [Fri, 9 Jan 2015 19:31:23 +0000 (11:31 -0800)]
runtime: add missing copyright notices

Change-Id: Icecfe9223d8457de067391fffa9f0fcee4292be7
Reviewed-on: https://go-review.googlesource.com/2620
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agonet/http/httputil: ReverseProxy request cancellation
Peter Waller [Tue, 30 Dec 2014 12:19:43 +0000 (12:19 +0000)]
net/http/httputil: ReverseProxy request cancellation

If an inbound connection is closed, cancel the outbound http request.

This is particularly useful if the outbound request may consume resources
unnecessarily until it is cancelled.

Fixes #8406

Change-Id: I738c4489186ce342f7e21d0ea3f529722c5b443a
Signed-off-by: Peter Waller <p@pwaller.net>
Reviewed-on: https://go-review.googlesource.com/2320
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: source startupRandomData from auxv AT_RANDOM on linux/arm.
Shenghou Ma [Fri, 9 Jan 2015 00:09:56 +0000 (19:09 -0500)]
runtime: source startupRandomData from auxv AT_RANDOM on linux/arm.

Fixes #9541.

Change-Id: I5d659ad50d7c3d1c92ed9feb86cda4c1a6e62054
Reviewed-on: https://go-review.googlesource.com/2584
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agolog: optimize itoa
Martin Möhrmann [Thu, 1 Jan 2015 12:19:12 +0000 (13:19 +0100)]
log: optimize itoa

Reduce buffer to maximally needed size for conversion of 64bit integers.
Reduce number of used integer divisions.

benchmark            old ns/op     new ns/op     delta
BenchmarkItoa        144           119           -17.36%
BenchmarkPrintln     783           752           -3.96%

Change-Id: I6d57a7feebf90f303be5952767107302eccf4631
Reviewed-on: https://go-review.googlesource.com/2215
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: use urandom instead of random
Keith Randall [Thu, 8 Jan 2015 23:30:22 +0000 (15:30 -0800)]
runtime: use urandom instead of random

Random is bad, it can block and prevent binaries from starting.
Use urandom instead.  We'd rather have bad random bits than no
random bits.

Change-Id: I360e1cb90ace5518a1b51708822a1dae27071ebd
Reviewed-on: https://go-review.googlesource.com/2582
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/go: document import path checking
Shenghou Ma [Thu, 8 Jan 2015 10:13:28 +0000 (05:13 -0500)]
cmd/go: document import path checking

This is a replay of CL 189760043 that is in release-branch.go1.4,
but not in master branch somehow.

Change-Id: I11eb40a24273e7be397e092ef040e54efb8ffe86
Reviewed-on: https://go-review.googlesource.com/2541
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: fix 32-bit build
Keith Randall [Thu, 8 Jan 2015 21:34:05 +0000 (13:34 -0800)]
runtime: fix 32-bit build

In 32-bit worlds, 8-byte objects are only aligned to 4-byte boundaries.

Change-Id: I91469a9a67b1ee31dd508a4e105c39c815ecde58
Reviewed-on: https://go-review.googlesource.com/2581
Reviewed-by: Keith Randall <khr@golang.org>
9 years agodoc: document math/big performance improvements
Robert Griesemer [Thu, 8 Jan 2015 21:09:22 +0000 (13:09 -0800)]
doc: document math/big performance improvements

Change-Id: I2b40cd544dda550ac6ac6da19ba3867ec30b2774
Reviewed-on: https://go-review.googlesource.com/2563
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agocmd/gc: pad structs which end in zero-sized fields
Keith Randall [Wed, 7 Jan 2015 17:25:23 +0000 (09:25 -0800)]
cmd/gc: pad structs which end in zero-sized fields

For a non-zero-sized struct with a final zero-sized field,
add a byte to the size (before rounding to alignment).  This
change ensures that taking the address of the zero-sized field
will not incorrectly leak the following object in memory.

reflect.funcLayout also needs this treatment.

Fixes #9401

Change-Id: I1dc503dc5af4ca22c8f8c048fb7b4541cc957e0f
Reviewed-on: https://go-review.googlesource.com/2452
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agomath/big: faster assembly kernels for AddVx/SubVx for 386.
Robert Griesemer [Thu, 8 Jan 2015 19:14:06 +0000 (11:14 -0800)]
math/big: faster assembly kernels for AddVx/SubVx for 386.

(analog to Change-Id: Ia473e9ab9c63a955c252426684176bca566645ae)

Fixes #9243.

benchmark              old ns/op     new ns/op     delta
BenchmarkAddVV_1       5.76          5.60          -2.78%
BenchmarkAddVV_2       7.17          6.98          -2.65%
BenchmarkAddVV_3       8.69          8.57          -1.38%
BenchmarkAddVV_4       10.5          10.5          +0.00%
BenchmarkAddVV_5       13.3          11.6          -12.78%
BenchmarkAddVV_1e1     20.4          19.3          -5.39%
BenchmarkAddVV_1e2     166           140           -15.66%
BenchmarkAddVV_1e3     1588          1278          -19.52%
BenchmarkAddVV_1e4     16138         12657         -21.57%
BenchmarkAddVV_1e5     167608        127836        -23.73%
BenchmarkAddVW_1       4.87          4.76          -2.26%
BenchmarkAddVW_2       6.10          6.07          -0.49%
BenchmarkAddVW_3       7.75          7.65          -1.29%
BenchmarkAddVW_4       9.30          9.39          +0.97%
BenchmarkAddVW_5       10.8          10.9          +0.93%
BenchmarkAddVW_1e1     18.8          18.8          +0.00%
BenchmarkAddVW_1e2     143           134           -6.29%
BenchmarkAddVW_1e3     1390          1266          -8.92%
BenchmarkAddVW_1e4     13877         12545         -9.60%
BenchmarkAddVW_1e5     155330        125432        -19.25%

benchmark              old MB/s     new MB/s     speedup
BenchmarkAddVV_1       5556.09      5715.12      1.03x
BenchmarkAddVV_2       8926.55      9170.64      1.03x
BenchmarkAddVV_3       11042.15     11201.77     1.01x
BenchmarkAddVV_4       12168.21     12245.50     1.01x
BenchmarkAddVV_5       12041.39     13805.73     1.15x
BenchmarkAddVV_1e1     15659.65     16548.18     1.06x
BenchmarkAddVV_1e2     19268.57     22728.64     1.18x
BenchmarkAddVV_1e3     20141.45     25033.36     1.24x
BenchmarkAddVV_1e4     19827.86     25281.92     1.28x
BenchmarkAddVV_1e5     19092.06     25031.92     1.31x
BenchmarkAddVW_1       822.12       840.92       1.02x
BenchmarkAddVW_2       1310.89      1317.89      1.01x
BenchmarkAddVW_3       1549.31      1568.26      1.01x
BenchmarkAddVW_4       1720.45      1703.77      0.99x
BenchmarkAddVW_5       1857.12      1828.66      0.98x
BenchmarkAddVW_1e1     2126.39      2132.38      1.00x
BenchmarkAddVW_1e2     2784.49      2969.21      1.07x
BenchmarkAddVW_1e3     2876.89      3157.35      1.10x
BenchmarkAddVW_1e4     2882.32      3188.51      1.11x
BenchmarkAddVW_1e5     2575.16      3188.96      1.24x

(measured on OS X 10.9.5, 2.3 GHz Intel Core i7, 8GB 1333 MHz DDR3)

Change-Id: I46698729d5e0bc3e277aa0146a9d7a086c0c26f1
Reviewed-on: https://go-review.googlesource.com/2560
Reviewed-by: Keith Randall <khr@golang.org>
9 years agostrconv: speed up atoi for common cases
Martin Möhrmann [Tue, 6 Jan 2015 18:48:31 +0000 (19:48 +0100)]
strconv: speed up atoi for common cases

Add compile time constants for bases 10 and 16 instead of computing the cutoff
value on every invocation of ParseUint by a division.

Reduce usage of slice operations.

amd64:
benchmark              old ns/op     new ns/op     delta
BenchmarkAtoi          44.6          36.0          -19.28%
BenchmarkAtoiNeg       44.2          38.9          -11.99%
BenchmarkAtoi64        72.5          56.7          -21.79%
BenchmarkAtoi64Neg     66.1          58.6          -11.35%

386:
benchmark              old ns/op     new ns/op     delta
BenchmarkAtoi          86.6          73.0          -15.70%
BenchmarkAtoiNeg       86.6          72.3          -16.51%
BenchmarkAtoi64        126           108           -14.29%
BenchmarkAtoi64Neg     126           108           -14.29%

Change-Id: I0a271132120d776c97bb4ed1099793c73e159893
Reviewed-on: https://go-review.googlesource.com/2460
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agoruntime: increase GC concurrency.
Rick Hudson [Tue, 6 Jan 2015 19:58:49 +0000 (14:58 -0500)]
runtime: increase GC concurrency.

run GC in its own background goroutine making the
caller runnable if resources are available. This is
critical in single goroutine applications.
Allow goroutines that allocate a lot to help out
the GC and in doing so throttle their own allocation.
Adjust test so that it only detects that a GC is run
during init calls and not whether the GC is memory
efficient. Memory efficiency work will happen later
in 1.5.

Change-Id: I4306f5e377bb47c69bda1aedba66164f12b20c2b
Reviewed-on: https://go-review.googlesource.com/2349
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agoREADME: emphasize that we don't accept pull requests
Robert Griesemer [Thu, 8 Jan 2015 18:35:44 +0000 (10:35 -0800)]
README: emphasize that we don't accept pull requests

Change-Id: Ie31f957f6b60b0a9405147c7a0af789df01a4b02
Reviewed-on: https://go-review.googlesource.com/2550
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: improve GC times printing
Austin Clements [Wed, 7 Jan 2015 20:34:02 +0000 (15:34 -0500)]
runtime: improve GC times printing

This improves the printing of GC times to be both more human-friendly
and to provide enough information for the construction of MMU curves
and other statistics.  The new times look like:

GC: #8 72413852ns @143036695895725 pause=622900 maxpause=427037 goroutines=11 gomaxprocs=4
GC:     sweep term: 190584ns    max=190584 total=275001 procs=4
GC:     scan:       260397ns    max=260397 total=902666 procs=1
GC:     install wb: 5279ns    max=5279 total=18642 procs=4
GC:     mark:       71530555ns    max=71530555 total=186694660 procs=1
GC:     mark term:  427037ns    max=427037 total=1691184 procs=4

This prints gomaxprocs and the number of procs used in each phase for
the benefit of analyzing mutator utilization during concurrent phases.
This also means the analysis doesn't have to hard-code which phases
are STW.

This prints the absolute start time only for the GC cycle.  The other
start times can be derived from the phase durations.  This declutters
the view for humans readers and doesn't pose any additional complexity
for machine readers.

This removes the confusing "cycle" terminology.  Instead, this places
the phase duration after the phase name and adds a "ns" unit, which
both makes it implicitly clear that this is the duration of that phase
and indicates the units of the times.

This adds a "GC:" prefix to all lines for easier identification.

Finally, this generally cleans up the code as well as the placement of
spaces in the output and adds print locking so the statistics blocks
are never interrupted by other prints.

Change-Id: Ifd056db83ed1b888de7dfa9a8fc5732b01ccc631
Reviewed-on: https://go-review.googlesource.com/2542
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agomath/big: faster "pure Go" addition/subtraction for long vectors
Robert Griesemer [Wed, 7 Jan 2015 19:11:57 +0000 (11:11 -0800)]
math/big: faster "pure Go" addition/subtraction for long vectors
          (platforms w/o corresponding assembly kernels)

For short vector adds there's some erradic slow-down, but overall
these routines have become significantly faster. This only matters
for platforms w/o native (assembly) versions of these kernels, so
we are not concerned about the minor slow-down for short vectors.

This code was already reviewed under Mercurial (golang.org/cl/172810043)
but wasn't submitted before the switch to git.

Benchmarks run on 2.3GHz Intel Core i7, running OS X 10.9.5,
with the respective AddVV and AddVW assembly routines disabled.

benchmark              old ns/op     new ns/op     delta
BenchmarkAddVV_1       6.59          7.09          +7.59%
BenchmarkAddVV_2       10.3          10.1          -1.94%
BenchmarkAddVV_3       10.9          12.6          +15.60%
BenchmarkAddVV_4       13.9          15.6          +12.23%
BenchmarkAddVV_5       16.8          17.3          +2.98%
BenchmarkAddVV_1e1     29.5          29.9          +1.36%
BenchmarkAddVV_1e2     246           232           -5.69%
BenchmarkAddVV_1e3     2374          2185          -7.96%
BenchmarkAddVV_1e4     58942         22292         -62.18%
BenchmarkAddVV_1e5     668622        225279        -66.31%
BenchmarkAddVW_1       6.81          5.58          -18.06%
BenchmarkAddVW_2       7.69          6.86          -10.79%
BenchmarkAddVW_3       9.56          8.32          -12.97%
BenchmarkAddVW_4       12.1          9.53          -21.24%
BenchmarkAddVW_5       13.2          10.9          -17.42%
BenchmarkAddVW_1e1     23.4          18.0          -23.08%
BenchmarkAddVW_1e2     175           141           -19.43%
BenchmarkAddVW_1e3     1568          1266          -19.26%
BenchmarkAddVW_1e4     15425         12596         -18.34%
BenchmarkAddVW_1e5     156737        133539        -14.80%
BenchmarkFibo          381678466     132958666     -65.16%

benchmark              old MB/s     new MB/s     speedup
BenchmarkAddVV_1       9715.25      9028.30      0.93x
BenchmarkAddVV_2       12461.72     12622.60     1.01x
BenchmarkAddVV_3       17549.64     15243.82     0.87x
BenchmarkAddVV_4       18392.54     16398.29     0.89x
BenchmarkAddVV_5       18995.23     18496.57     0.97x
BenchmarkAddVV_1e1     21708.98     21438.28     0.99x
BenchmarkAddVV_1e2     25956.53     27506.88     1.06x
BenchmarkAddVV_1e3     26947.93     29286.66     1.09x
BenchmarkAddVV_1e4     10857.96     28709.46     2.64x
BenchmarkAddVV_1e5     9571.91      28409.21     2.97x
BenchmarkAddVW_1       1175.28      1433.98      1.22x
BenchmarkAddVW_2       2080.01      2332.54      1.12x
BenchmarkAddVW_3       2509.28      2883.97      1.15x
BenchmarkAddVW_4       2646.09      3356.83      1.27x
BenchmarkAddVW_5       3020.69      3671.07      1.22x
BenchmarkAddVW_1e1     3425.76      4441.40      1.30x
BenchmarkAddVW_1e2     4553.17      5642.96      1.24x
BenchmarkAddVW_1e3     5100.14      6318.72      1.24x
BenchmarkAddVW_1e4     5186.15      6350.96      1.22x
BenchmarkAddVW_1e5     5104.07      5990.74      1.17x

Change-Id: I7a62023b1105248a0e85e5b9819d3fd4266123d4
Reviewed-on: https://go-review.googlesource.com/2480
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agomath/big: faster assembly kernels for AddVx/SubVx for amd64.
Robert Griesemer [Thu, 8 Jan 2015 01:16:59 +0000 (17:16 -0800)]
math/big: faster assembly kernels for AddVx/SubVx for amd64.

Replaced use of rotate instructions (RCRQ, RCLQ) with ADDQ/SBBQ
for restoring/saving the carry flag per suggestion from Torbjörn
Granlund (author of GMP bignum libs for C).
The rotate instructions tend to be slower on todays machines.

benchmark              old ns/op     new ns/op     delta
BenchmarkAddVV_1       5.69          5.51          -3.16%
BenchmarkAddVV_2       7.15          6.87          -3.92%
BenchmarkAddVV_3       8.69          8.06          -7.25%
BenchmarkAddVV_4       8.10          8.13          +0.37%
BenchmarkAddVV_5       8.37          8.47          +1.19%
BenchmarkAddVV_1e1     13.1          12.0          -8.40%
BenchmarkAddVV_1e2     78.1          69.4          -11.14%
BenchmarkAddVV_1e3     815           656           -19.51%
BenchmarkAddVV_1e4     8137          7345          -9.73%
BenchmarkAddVV_1e5     100127        93909         -6.21%
BenchmarkAddVW_1       4.86          4.71          -3.09%
BenchmarkAddVW_2       5.67          5.50          -3.00%
BenchmarkAddVW_3       6.51          6.34          -2.61%
BenchmarkAddVW_4       6.69          6.66          -0.45%
BenchmarkAddVW_5       7.20          7.21          +0.14%
BenchmarkAddVW_1e1     10.0          9.34          -6.60%
BenchmarkAddVW_1e2     45.4          52.3          +15.20%
BenchmarkAddVW_1e3     417           491           +17.75%
BenchmarkAddVW_1e4     4760          4852          +1.93%
BenchmarkAddVW_1e5     69107         67717         -2.01%

benchmark              old MB/s      new MB/s      speedup
BenchmarkAddVV_1       11241.82      11610.28      1.03x
BenchmarkAddVV_2       17902.68      18631.82      1.04x
BenchmarkAddVV_3       22082.43      23835.64      1.08x
BenchmarkAddVV_4       31588.18      31492.06      1.00x
BenchmarkAddVV_5       38229.90      37783.17      0.99x
BenchmarkAddVV_1e1     48891.67      53340.91      1.09x
BenchmarkAddVV_1e2     81940.61      92191.86      1.13x
BenchmarkAddVV_1e3     78443.09      97480.44      1.24x
BenchmarkAddVV_1e4     78644.18      87129.50      1.11x
BenchmarkAddVV_1e5     63918.48      68150.84      1.07x
BenchmarkAddVW_1       13165.09      13581.00      1.03x
BenchmarkAddVW_2       22588.04      23275.41      1.03x
BenchmarkAddVW_3       29483.82      30303.96      1.03x
BenchmarkAddVW_4       38286.54      38453.21      1.00x
BenchmarkAddVW_5       44414.57      44370.59      1.00x
BenchmarkAddVW_1e1     63816.84      68494.08      1.07x
BenchmarkAddVW_1e2     140885.41     122427.16     0.87x
BenchmarkAddVW_1e3     153258.31     130325.28     0.85x
BenchmarkAddVW_1e4     134447.63     131904.02     0.98x
BenchmarkAddVW_1e5     92609.41      94509.88      1.02x

Change-Id: Ia473e9ab9c63a955c252426684176bca566645ae
Reviewed-on: https://go-review.googlesource.com/2503
Reviewed-by: Keith Randall <khr@golang.org>
9 years agostrconv: add atoi tests for uncommon bases and syntax errors
Martin Möhrmann [Thu, 8 Jan 2015 01:18:16 +0000 (02:18 +0100)]
strconv: add atoi tests for uncommon bases and syntax errors

Edge cases like base 2 and 36 conversions are now covered.
Many tests are mirrored from the itoa tests.

Added more test cases for syntax errors.

Change-Id: Iad8b2fb4854f898c2bfa18cdeb0cb4a758fcfc2e
Reviewed-on: https://go-review.googlesource.com/2463
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agosyscall: use go generate to build zsyscall_windows.go
Alex Brainman [Mon, 22 Dec 2014 05:54:07 +0000 (16:54 +1100)]
syscall: use go generate to build zsyscall_windows.go

I would like to create new syscalls in src/internal/syscall,
and I prefer not to add new shell scripts for that.

Replacement for CL 136000043.

Change-Id: I840116b5914a2324f516cdb8603c78973d28aeb4
Reviewed-on: https://go-review.googlesource.com/1940
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotest: shorten test runtime
Keith Randall [Thu, 8 Jan 2015 00:46:29 +0000 (16:46 -0800)]
test: shorten test runtime

This test was taking a long time, reduce its zealousness.

Change-Id: Ib824247b84b0039a9ec690f72336bef3738d4c44
Reviewed-on: https://go-review.googlesource.com/2502
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agobuild: add GOTESTONLY environment test for Plan 9's run.rc
Brad Fitzpatrick [Thu, 8 Jan 2015 04:10:32 +0000 (20:10 -0800)]
build: add GOTESTONLY environment test for Plan 9's run.rc

$GOTESTONLY controls which set of tests gets run. Only "std" is
supported. This should bring the time of plan9 builder down
from 90 minutes to a maybe 10-15 minutes when running on GCE.

(Plan 9 has performance problems when running on GCE, and/or with the
os/exec package)

This is a temporary workaround for one builder. The other Plan 9
builders will continue to do full builds. The plan9 buidler will be
renamed plan9-386-gcepartial or something to indicate it's not running
the 'test/*' directory, or API tests. Go on Plan 9 has bigger problems
for now. This lets us get trybots going sooner including Plan 9,
without waiting 90+ minutes.

Update #9491

Change-Id: Ic505e9169c6b304ed4029b7bdfb77bb5c8fa8daa
Reviewed-on: https://go-review.googlesource.com/2522
Reviewed-by: Rob Pike <r@golang.org>
9 years agobuild: increase Plan 9 timeout for runtime multi-CPU test, add temporary -v
Brad Fitzpatrick [Thu, 8 Jan 2015 01:05:51 +0000 (17:05 -0800)]
build: increase Plan 9 timeout for runtime multi-CPU test, add temporary -v

This isn't the final answer, but it will give us a clue about what's
going on.

Update #9491

Change-Id: I997f6004eb97e86a4a89a8caabaf58cfdf92a8f0
Reviewed-on: https://go-review.googlesource.com/2510
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/cgo, go/build: finish a cleanup TODO
Matthew Dempsky [Thu, 8 Jan 2015 00:30:24 +0000 (16:30 -0800)]
cmd/cgo, go/build: finish a cleanup TODO

Removing #cgo directive parsing from cmd/cgo was done in
https://golang.org/cl/8610044.

Change-Id: Id1bec58c6ec1f932df0ce0ee84ff253655bb73ff
Reviewed-on: https://go-review.googlesource.com/2501
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomisc/swig/stdio: fix broken nil pointer test
Shenghou Ma [Wed, 7 Jan 2015 06:23:45 +0000 (01:23 -0500)]
misc/swig/stdio: fix broken nil pointer test

SWIG has always returned a typed interface value for a C++ class,
so the interface value will never be nil even if the pointer itself
is NULL. ptr == NULL in C/C++ should be ptr.Swigcptr() == 0 in Go.

Fixes #9514.

Change-Id: I3778b91acf54d2ff22d7427fbf2b6ec9b9ce3b43
Reviewed-on: https://go-review.googlesource.com/2440
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agobuild: increase timeout in run.rc
David du Colombier [Wed, 7 Jan 2015 22:32:34 +0000 (23:32 +0100)]
build: increase timeout in run.rc

Increasing the timeout prevents the runtime test
to time out on the Plan 9 instances running on GCE.

Update golang/go#9491

Change-Id: Id9c2b0c4e59b103608565168655799b353afcd77
Reviewed-on: https://go-review.googlesource.com/2462
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/cgo: remove obsolete -cdefs flag
Matthew Dempsky [Wed, 7 Jan 2015 21:23:45 +0000 (13:23 -0800)]
cmd/cgo: remove obsolete -cdefs flag

Now that there's no 6c compiler anymore, there's no need for cgo to
generate C headers that are compatible with it.

Fixes #9528

Change-Id: I43f53869719eb9a6065f1b39f66f060e604cbee0
Reviewed-on: https://go-review.googlesource.com/2482
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: remove stray commas in assembly
Josh Bleecher Snyder [Wed, 7 Jan 2015 22:24:18 +0000 (14:24 -0800)]
runtime: remove stray commas in assembly

Change-Id: I4dc97ff8111bdc5ca6e4e3af06aaf4f768031c68
Reviewed-on: https://go-review.googlesource.com/2473
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/gc: optimize existence-only map lookups
Josh Bleecher Snyder [Mon, 22 Dec 2014 19:33:47 +0000 (11:33 -0800)]
cmd/gc: optimize existence-only map lookups

The compiler converts 'val, ok = m[key]' to

        tmp, ok = <runtime call>
        val = *tmp

For lookups of the form '_, ok = m[key]',
the second statement is unnecessary.
By not generating it we save a nil check.

Change-Id: I21346cc195cb3c62e041af8b18770c0940358695
Reviewed-on: https://go-review.googlesource.com/1975
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/6g, cmd/8g, liblink: improve handling of float constants
Josh Bleecher Snyder [Mon, 22 Dec 2014 23:12:28 +0000 (15:12 -0800)]
cmd/6g, cmd/8g, liblink: improve handling of float constants

* Enable basic constant propagation for floats.
  The constant propagation is still not as aggressive as it could be.
* Implement MOVSS $(0), Xx and MOVSD $(0), Xx as XORPS Xx, Xx.

Sample code:

func f32() float32 {
var f float32
return f
}

func f64() float64 {
var f float64
return f
}

Before:

"".f32 t=1 size=32 value=0 args=0x8 locals=0x0
0x0000 00000 (demo.go:3) TEXT "".f32+0(SB),4,$0-8
0x0000 00000 (demo.go:3) FUNCDATA $0,gclocals·a7a3692b8e27e823add69ec4239ba55f+0(SB)
0x0000 00000 (demo.go:3) FUNCDATA $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)
0x0000 00000 (demo.go:3) MOVSS $f32.00000000+0(SB),X0
0x0008 00008 (demo.go:4) MOVSS $f32.00000000+0(SB),X0
0x0010 00016 (demo.go:5) MOVSS X0,"".~r0+8(FP)
0x0016 00022 (demo.go:5) RET ,
"".f64 t=1 size=32 value=0 args=0x8 locals=0x0
0x0000 00000 (demo.go:8) TEXT "".f64+0(SB),4,$0-8
0x0000 00000 (demo.go:8) FUNCDATA $0,gclocals·a7a3692b8e27e823add69ec4239ba55f+0(SB)
0x0000 00000 (demo.go:8) FUNCDATA $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)
0x0000 00000 (demo.go:8) MOVSD $f64.0000000000000000+0(SB),X0
0x0008 00008 (demo.go:9) MOVSD $f64.0000000000000000+0(SB),X0
0x0010 00016 (demo.go:10) MOVSD X0,"".~r0+8(FP)
0x0016 00022 (demo.go:10) RET ,

After:

"".f32 t=1 size=16 value=0 args=0x8 locals=0x0
0x0000 00000 (demo.go:3) TEXT "".f32+0(SB),4,$0-8
0x0000 00000 (demo.go:3) FUNCDATA $0,gclocals·a7a3692b8e27e823add69ec4239ba55f+0(SB)
0x0000 00000 (demo.go:3) FUNCDATA $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)
0x0000 00000 (demo.go:3) XORPS X0,X0
0x0003 00003 (demo.go:5) MOVSS X0,"".~r0+8(FP)
0x0009 00009 (demo.go:5) RET ,
"".f64 t=1 size=16 value=0 args=0x8 locals=0x0
0x0000 00000 (demo.go:8) TEXT "".f64+0(SB),4,$0-8
0x0000 00000 (demo.go:8) FUNCDATA $0,gclocals·a7a3692b8e27e823add69ec4239ba55f+0(SB)
0x0000 00000 (demo.go:8) FUNCDATA $1,gclocals·3280bececceccd33cb74587feedb1f9f+0(SB)
0x0000 00000 (demo.go:8) XORPS X0,X0
0x0003 00003 (demo.go:10) MOVSD X0,"".~r0+8(FP)
0x0009 00009 (demo.go:10) RET ,

Change-Id: Ie9eb65e324af4f664153d0a7cd22bb16b0fba16d
Reviewed-on: https://go-review.googlesource.com/2053
Reviewed-by: Russ Cox <rsc@golang.org>