]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years agocmd/go: handle \r in input text
Rob Pike [Mon, 15 Dec 2014 04:00:56 +0000 (15:00 +1100)]
cmd/go: handle \r in input text

Remove carriage returns from //go:generate lines.
Carriage returns are the predecessor of BOMs and still
live on Windows.

Fixes #9264

Change-Id: I637748c74335c696b3630f52f2100061153fcdb4
Reviewed-on: https://go-review.googlesource.com/1564
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agomisc/makerelease: fix build
Andrew Gerrand [Mon, 15 Dec 2014 01:54:29 +0000 (12:54 +1100)]
misc/makerelease: fix build

Fixes #9308

Change-Id: I0121adbbecc893eb93afc3321ecff97ea146d150
Reviewed-on: https://go-review.googlesource.com/1560
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agomisc/makerelease: remove mercurial-specific special case
Andrew Gerrand [Sun, 14 Dec 2014 23:17:00 +0000 (10:17 +1100)]
misc/makerelease: remove mercurial-specific special case

Change-Id: I2ae40e63bc78f3b6e4eb68ccbc928368db1e606f
Reviewed-on: https://go-review.googlesource.com/1535
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agodoc: replace hg commands with git commands in release.html
Kang Hu [Sun, 14 Dec 2014 08:17:48 +0000 (16:17 +0800)]
doc: replace hg commands with git commands in release.html

Change-Id: I5cc4740a858c40d820eeb7c00cf0508b20807c90
Reviewed-on: https://go-review.googlesource.com/1533
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agoencoding/json: mention that the "string" tag applies to booleans
Andrew Gerrand [Sun, 14 Dec 2014 22:30:53 +0000 (09:30 +1100)]
encoding/json: mention that the "string" tag applies to booleans

Fixes #9284

Change-Id: I0410a9ed82b861686a0a986c9ca4eeeacac8f296
Reviewed-on: https://go-review.googlesource.com/1534
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agomisc/chrome/gophertool: update URLs from code.google.com to new homes
Brad Fitzpatrick [Sat, 13 Dec 2014 08:47:22 +0000 (19:47 +1100)]
misc/chrome/gophertool: update URLs from code.google.com to new homes

Change-Id: I46bf9f1b84a331cabce2d3417b2b59ccb83d00fa
Reviewed-on: https://go-review.googlesource.com/1532
Reviewed-by: David Symonds <dsymonds@golang.org>
10 years agonet/http: document Response.Body Read+Close interaction with keep-alive
Brad Fitzpatrick [Sat, 13 Dec 2014 08:00:48 +0000 (19:00 +1100)]
net/http: document Response.Body Read+Close interaction with keep-alive

Fixes #5645

Change-Id: Ifb46d6faf7ac838792920f6fe00912947478e761
Reviewed-on: https://go-review.googlesource.com/1531
Reviewed-by: David Symonds <dsymonds@golang.org>
10 years agonet/http: fix timer leak in Transport when using ResponseHeaderTimeout
Brad Fitzpatrick [Sat, 13 Dec 2014 07:19:05 +0000 (18:19 +1100)]
net/http: fix timer leak in Transport when using ResponseHeaderTimeout

Fixes #9104

Change-Id: Ide5ac70215d73278e6910f5b9c7687ad7734c0be
Reviewed-on: https://go-review.googlesource.com/1530
Reviewed-by: David Symonds <dsymonds@golang.org>
10 years agobuild: change all.bash output to be more markdown-friendly
Russ Cox [Wed, 10 Dec 2014 15:45:59 +0000 (10:45 -0500)]
build: change all.bash output to be more markdown-friendly

People keep pasting all.bash output into GitHub bugs, which turns
the # lines into <h1> headlines. Add some more #s so that the
bug reports are more readable. Not ideal but seems like the best
of a few bad options.

Change-Id: I4c69930ec304b2d504d7cd66221281a8577b87ae
Reviewed-on: https://go-review.googlesource.com/1286
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago.gitattributes: prevent all magic line ending changes
Brad Fitzpatrick [Fri, 12 Dec 2014 22:49:08 +0000 (14:49 -0800)]
.gitattributes: prevent all magic line ending changes

Fixes #9281

Change-Id: Id060e9cbad086c994ec74b240f5c61e971e5690b
Reviewed-on: https://go-review.googlesource.com/1490
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/gc: add //go:nowritebarrier to diagnose unintended write barriers
Russ Cox [Tue, 9 Dec 2014 15:15:18 +0000 (10:15 -0500)]
cmd/gc: add //go:nowritebarrier to diagnose unintended write barriers

//go:nowritebarrier can only be used in package runtime.
It does not disable write barriers; it is an assertion, checked
by the compiler, that the following function needs no write
barriers.

Change-Id: Id7978b779b66dc1feea39ee6bda9fd4d80280b7c
Reviewed-on: https://go-review.googlesource.com/1224
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years ago.gitattributes: enforce unix eol style
Shenghou Ma [Fri, 12 Dec 2014 06:52:05 +0000 (01:52 -0500)]
.gitattributes: enforce unix eol style

Change-Id: I5f021b131f5650217bd14dec09cfb81fb0447b9e
Reviewed-on: https://go-review.googlesource.com/1422
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/api: treat a hex-y VERSION as devel and permit API changes
Brad Fitzpatrick [Fri, 12 Dec 2014 06:02:33 +0000 (17:02 +1100)]
cmd/api: treat a hex-y VERSION as devel and permit API changes

Change-Id: I2b05b7ff217586851ab41744e3077fddc480253c
Reviewed-on: https://go-review.googlesource.com/1405
Reviewed-by: David Symonds <dsymonds@golang.org>
10 years agocmd/api: update the API checker to Go 1.4 and git
Brad Fitzpatrick [Fri, 12 Dec 2014 04:54:24 +0000 (15:54 +1100)]
cmd/api: update the API checker to Go 1.4 and git

Still using the ancient go/types API. Updating that to the modern API
should be a separate effort in a separate change.

Change-Id: Ic1c5ae3c13711d34fe757507ecfc00ee883810bf
Reviewed-on: https://go-review.googlesource.com/1404
Reviewed-by: David Symonds <dsymonds@golang.org>
10 years agocmd/dist: ignore \r in crlf EOL when splitlines()
Shenghou Ma [Fri, 12 Dec 2014 04:07:04 +0000 (23:07 -0500)]
cmd/dist: ignore \r in crlf EOL when splitlines()

Fixes build on Windows. Fixes #9234.

Change-Id: Iebf4317e7cc20ba1afea5558553166cd89783316
Reviewed-on: https://go-review.googlesource.com/1421
Reviewed-by: <iant@golang.org>
10 years ago[release-branch.go1.4] cmd/api: make API check fail for undeclared API in release...
Russ Cox [Fri, 5 Dec 2014 19:04:17 +0000 (14:04 -0500)]
[release-branch.go1.4] cmd/api: make API check fail for undeclared API in release branch

We forgot to do the usual API review.
Make that not possible in the future.
I'll pull this change over to the main
branch too, but it's more important
(and only testable) here.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/185050043

10 years ago[release-branch.go1.4] api: create go1.4.txt
Russ Cox [Wed, 10 Dec 2014 00:07:40 +0000 (11:07 +1100)]
[release-branch.go1.4] api: create go1.4.txt

I read through and vetted these but others should look too.

LGTM=bradfitz, adg
R=r, minux, bradfitz, adg
CC=adg, golang-codereviews, gri, iant
https://golang.org/cl/182560043

10 years ago[release-branch.go1.4] doc: scrub references to code.google.com
Andrew Gerrand [Wed, 10 Dec 2014 00:01:55 +0000 (11:01 +1100)]
[release-branch.go1.4] doc: scrub references to code.google.com

These are the references that affect current Go users.
I left intact references in older release notes;
we can figure out what to do with them later.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/186140043

Conflicts:
doc/go1.4.html

Change-Id: I1032686f2b3ac6dacaf8f114b8c35cdf221330ca

10 years ago[release-branch.go1.4] [release-branch.go1.4] doc: update contribution guidelines
Andrew Gerrand [Tue, 9 Dec 2014 22:29:35 +0000 (09:29 +1100)]
[release-branch.go1.4] [release-branch.go1.4] doc: update contribution guidelines

LGTM=minux, adg, rsc
R=rsc, r, dsymonds, minux, bradfitz, adg, dave, iant
CC=golang-codereviews
https://golang.org/cl/185190043

10 years agodoc/play: revise peano.go comment again.
David Symonds [Fri, 12 Dec 2014 00:38:07 +0000 (11:38 +1100)]
doc/play: revise peano.go comment again.

Change-Id: I412358e99301d1c9603960fd34601dae60fca3cb
Reviewed-on: https://go-review.googlesource.com/1400
Reviewed-by: Rob Pike <r@golang.org>
10 years agomath: Added parity check to ProbablyPrime
Alberto Donizetti [Thu, 11 Dec 2014 18:09:39 +0000 (19:09 +0100)]
math: Added parity check to ProbablyPrime

Fixes #9269

Change-Id: I25751632e95978537b656aedfa5c35ab2273089b
Reviewed-on: https://go-review.googlesource.com/1380
Reviewed-by: Robert Griesemer <gri@golang.org>
10 years agodoc/play: update obsolete comment in peano.go.
David Symonds [Thu, 11 Dec 2014 10:54:20 +0000 (21:54 +1100)]
doc/play: update obsolete comment in peano.go.

Change-Id: Ibecc2ef1e70c927c325c48bc381091f52c09da85
Reviewed-on: https://go-review.googlesource.com/1355
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agocmd/pprof: remove -show_bytes from command line help
Austin Clements [Tue, 9 Dec 2014 20:36:10 +0000 (15:36 -0500)]
cmd/pprof: remove -show_bytes from command line help

This flag no longer exists.  It has been replaced with -unit=byte.

Change-Id: Iff9fc501f2c666067c9b1948c4623c8e3adddb8d
Reviewed-on: https://go-review.googlesource.com/1287
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix nacl build
Keith Randall [Thu, 11 Dec 2014 07:29:47 +0000 (23:29 -0800)]
runtime: fix nacl build

Change-Id: Ifa8b2d1d1cebe72f795db34974584a888d55cbd8
Reviewed-on: https://go-review.googlesource.com/1362
Reviewed-by: Keith Randall <khr@golang.org>
10 years agodoc: tweak Go 1.4 release notes
Andrew Gerrand [Thu, 11 Dec 2014 00:22:54 +0000 (11:22 +1100)]
doc: tweak Go 1.4 release notes

LGTM=dave, dsymonds
R=golang-codereviews, dave, dsymonds
CC=golang-codereviews
https://golang.org/cl/184350043

10 years agodoc: document go1.4
Andrew Gerrand [Wed, 10 Dec 2014 22:16:41 +0000 (09:16 +1100)]
doc: document go1.4

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/189810043

10 years agodoc: remove TODO from go1.4 release notes
Andrew Gerrand [Wed, 10 Dec 2014 22:11:08 +0000 (09:11 +1100)]
doc: remove TODO from go1.4 release notes

LGTM=bradfitz
R=iant, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/191750043

10 years agomisc/makerelease: handle git sub-repositories
Andrew Gerrand [Wed, 10 Dec 2014 02:04:06 +0000 (13:04 +1100)]
misc/makerelease: handle git sub-repositories

Also: checkout sub-repos from Mercurial manually
instead of using "go get". (for the 1.4 release)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/190720043

10 years agomisc/cgo/test: skip test8694 on ARM.
Shenghou Ma [Tue, 9 Dec 2014 03:27:29 +0000 (22:27 -0500)]
misc/cgo/test: skip test8694 on ARM.

LGTM=dave, bradfitz, rsc
R=golang-codereviews, dave, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/185130043

10 years agoruntime: faster aeshash implementation
Keith Randall [Wed, 10 Dec 2014 22:20:17 +0000 (14:20 -0800)]
runtime: faster aeshash implementation

The aesenc instruction has high latency.  For hashing large objects,
hash several streams in parallel.

benchmark                         old ns/op     new ns/op     delta
BenchmarkHash5                    7.02          7.45          +6.13%
BenchmarkHash16                   6.53          6.94          +6.28%
BenchmarkHash32                   8.38          8.26          -1.43%
BenchmarkHash64                   12.6          12.0          -4.76%
BenchmarkHash1024                 247           62.9          -74.53%
BenchmarkHash65536                17335         2966          -82.89%
BenchmarkHashInt32Speed           14.7          14.9          +1.36%
BenchmarkHashInt64Speed           14.6          14.9          +2.05%
BenchmarkHashBytesSpeed           35.4          28.6          -19.21%
BenchmarkHashStringSpeed          22.0          20.4          -7.27%
BenchmarkHashStringArraySpeed     65.8          56.3          -14.44%

Change-Id: Ia8ba03063acc64a9066b8ab2d79f2c9aaac1770f
Reviewed-on: https://go-review.googlesource.com/1330
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agodoc: update README.md and CONTRIBUTING.md in response to review comments
Andrew Gerrand [Wed, 10 Dec 2014 22:44:54 +0000 (09:44 +1100)]
doc: update README.md and CONTRIBUTING.md in response to review comments

I didn't 'add' these files before my final mail.

Change-Id: Id6f25629638e58421a3dee7632aec38aad9b1970
Reviewed-on: https://go-review.googlesource.com/1340
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agodoc: convert README to markdown and update CONTRIBUTING.md
Andrew Gerrand [Wed, 10 Dec 2014 05:06:47 +0000 (16:06 +1100)]
doc: convert README to markdown and update CONTRIBUTING.md

Fixes #9233

Change-Id: If64480cbfaafe44025fcdcc0f20d76c995ffb3a1
Reviewed-on: https://go-review.googlesource.com/1296
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: send android stderr to /dev/log/main
David Crawshaw [Wed, 10 Dec 2014 14:29:24 +0000 (09:29 -0500)]
runtime: send android stderr to /dev/log/main

I tried to submit this in Go 1.4 as cl/107540044 but tripped over the
changes for getting C off the G stack. This is a rewritten version that
avoids cgo and works directly with the underlying log device.

Change-Id: I14c227dbb4202690c2c67c5a613d6c6689a6662a
Reviewed-on: https://go-review.googlesource.com/1285
Reviewed-by: Keith Randall <khr@golang.org>
10 years agoruntime: clean up & go-ify the hash function seeder
Keith Randall [Tue, 9 Dec 2014 22:40:40 +0000 (14:40 -0800)]
runtime: clean up & go-ify the hash function seeder

Change-Id: I0e95f8a5962c547da20e19a356ae1cf8375c9107
Reviewed-on: https://go-review.googlesource.com/1270
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix finalizer iterator
Keith Randall [Tue, 9 Dec 2014 04:04:56 +0000 (20:04 -0800)]
runtime: fix finalizer iterator

It could only handle one finalizer before it raised an out-of-bounds error.

Fixes issue #9172

Change-Id: Ibb4d0c8aff2d78a1396e248c7129a631176ab427
Reviewed-on: https://go-review.googlesource.com/1201
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agomisc/makerelease: use new storage api, handle git sub-repos
Andrew Gerrand [Wed, 10 Dec 2014 02:05:37 +0000 (13:05 +1100)]
misc/makerelease: use new storage api, handle git sub-repos

Change-Id: I8c5b77d861aafdc594714982503da7bee053c9fe
Reviewed-on: https://go-review.googlesource.com/1291
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoall: tighten overly-broad runtime/z* gitignore line
Brad Fitzpatrick [Wed, 10 Dec 2014 00:43:04 +0000 (11:43 +1100)]
all: tighten overly-broad runtime/z* gitignore line

Fixes #9231

Change-Id: Ifed6cd37e885415d9a298b63d472d63f44e72321
Reviewed-on: https://go-review.googlesource.com/1290
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix some comment formatting
Rick Hudson [Tue, 9 Dec 2014 18:25:45 +0000 (13:25 -0500)]
runtime: fix some comment formatting

Change-Id: Ife7d6ce1131ff26444f09e8fda4f61344e669e21
Reviewed-on: https://go-review.googlesource.com/1260
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: restore error message on early needm
Austin Clements [Tue, 9 Dec 2014 17:31:11 +0000 (12:31 -0500)]
runtime: restore error message on early needm

needm used to print an error before exiting when it was called too
early, but this error was lost in the transition to Go.  Bring back
the error so we don't silently exit(1) when this happens.

Change-Id: I8086932783fd29a337d7dea31b9d6facb64cb5c1
Reviewed-on: https://go-review.googlesource.com/1226
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agotest/fixedbugs/bug302: fix test on windows.
Shenghou Ma [Tue, 9 Dec 2014 05:13:10 +0000 (00:13 -0500)]
test/fixedbugs/bug302: fix test on windows.

Change-Id: I74c2578d1620b37a6486eca00a774b9a736a8899
Reviewed-on: https://go-review.googlesource.com/1222
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agonet/http: avoid some allocations in DetectContentType
Brad Fitzpatrick [Tue, 9 Dec 2014 00:45:19 +0000 (11:45 +1100)]
net/http: avoid some allocations in DetectContentType

Change-Id: I64985f8de7ca09e63208e8c949a5d4f4fc09073f
Reviewed-on: https://go-review.googlesource.com/1230
Reviewed-by: David Symonds <dsymonds@golang.org>
10 years agotest: write Go wrapper code so that bug302 can be run by run.go
Ian Lance Taylor [Mon, 8 Dec 2014 18:28:18 +0000 (10:28 -0800)]
test: write Go wrapper code so that bug302 can be run by run.go

Issue #4139.

Change-Id: I50d85a65b22c0cfb4d2a078cee45cf7adb23ba77
Reviewed-on: https://go-review.googlesource.com/1210
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years agodoc: Fix the canonical location
Burcu Dogan [Tue, 9 Dec 2014 00:15:22 +0000 (16:15 -0800)]
doc: Fix the canonical location

Change-Id: I3030d678c4eee85970826c86332a2b818cf7f5b6
Reviewed-on: https://go-review.googlesource.com/1217
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/objdump: Fix error logging
Keith Randall [Mon, 8 Dec 2014 23:11:11 +0000 (15:11 -0800)]
cmd/objdump: Fix error logging

Change-Id: I6b1b4d3e8c039ba3198cb4b9765de75859ea8c32
Reviewed-on: https://go-review.googlesource.com/1214
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoFix whitespace (use blanks consistently).
Robert Griesemer [Mon, 8 Dec 2014 22:19:38 +0000 (14:19 -0800)]
Fix whitespace (use blanks consistently).

Change-Id: I73ecfe8f1e46e4821dafc6ed5788f48a1f0deeea
Reviewed-on: https://go-review.googlesource.com/1213
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoruntime: test for linear enqueue/dequeue behavior
Keith Randall [Mon, 8 Dec 2014 21:50:16 +0000 (13:50 -0800)]
runtime: test for linear enqueue/dequeue behavior

Make sure dequeueing from a channel queue does not exhibit quadratic time behavior.

Change-Id: Ifb7c709b026f74c7e783610d4914dd92909a441b
Reviewed-on: https://go-review.googlesource.com/1212
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agodoc: remove obsolete FAQ entry about using Mercurial vs. Git.
David Symonds [Mon, 8 Dec 2014 07:50:50 +0000 (18:50 +1100)]
doc: remove obsolete FAQ entry about using Mercurial vs. Git.

Change-Id: I9d9b02ad745208e7297cb75c86af49b2d858b12d
Reviewed-on: https://go-review.googlesource.com/1176
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agotest/fibo: a stand-alone bignum/allocation benchmark and test
Robert Griesemer [Mon, 8 Dec 2014 19:20:41 +0000 (11:20 -0800)]
test/fibo: a stand-alone bignum/allocation benchmark and test

Usage:
fibo <n>        compute fibonacci(n), n must be >= 0
fibo -bench     benchmark fibonacci computation (takes about 1 min)

Additional flags:
-half           add values using two half-digit additions
-opt            optimize memory allocation through reuse
-short          only print the first 10 digits of very large fibonacci numbers

This change was reviewed in detail as https://codereview.appspot.com/168480043 .

Change-Id: I7c86d49c5508532ea6206d00f424cf2117d2fe41
Reviewed-on: https://go-review.googlesource.com/1211
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: use doubly-linked lists for channel send/recv queues.
Keith Randall [Mon, 8 Dec 2014 18:11:08 +0000 (10:11 -0800)]
runtime: use doubly-linked lists for channel send/recv queues.

Avoids a potential O(n^2) performance problem when dequeueing
from very popular channels.

benchmark                old ns/op     new ns/op     delta
BenchmarkChanPopular     2563782       627201        -75.54%

Change-Id: I231aaeafea0ecd93d27b268a0b2128530df3ddd6
Reviewed-on: https://go-review.googlesource.com/1200
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix missing newline when dumping bad symbol table
Austin Clements [Mon, 8 Dec 2014 16:12:33 +0000 (11:12 -0500)]
runtime: fix missing newline when dumping bad symbol table

If the symbol table isn't sorted, we print it and abort.  However, we
were missing the line break after each symbol, resulting in one
gigantic line instead of a nicely formatted table.

Change-Id: Ie5c6f3c256d0e648277cb3db4496512a79d266dd
Reviewed-on: https://go-review.googlesource.com/1182
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agodoc: add CONRIBUTORS.md
Andrew Gerrand [Mon, 8 Dec 2014 11:05:57 +0000 (22:05 +1100)]
doc: add CONRIBUTORS.md

This file is known to GitHub and will be linked prominently when
potential contributors try to open pull requests.

Here's how it should appear:
https://gist.github.com/adg/e0ffcc922a32f20af3db

Change-Id: I41c5aadf284a0a24c485f96b7fe2caa338ad1e4f
Reviewed-on: https://go-review.googlesource.com/1178
Reviewed-by: Rob Pike <r@golang.org>
10 years agoremove the obsolete lib/codereview.
David Symonds [Mon, 8 Dec 2014 07:47:42 +0000 (18:47 +1100)]
remove the obsolete lib/codereview.

Change-Id: Idd2e74053ce4a2be3d757aef1bb83313973de6f0
Reviewed-on: https://go-review.googlesource.com/1175
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agoremove dev.cc file, left over from merge of the dev.cc branch.
David Symonds [Mon, 8 Dec 2014 04:59:37 +0000 (15:59 +1100)]
remove dev.cc file, left over from merge of the dev.cc branch.

Change-Id: I6021f42ce4ac6a66632751b21ab13e9b22383af9
Reviewed-on: https://go-review.googlesource.com/1172
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agoadd bin/ to .gitignore.
David Symonds [Mon, 8 Dec 2014 00:39:11 +0000 (11:39 +1100)]
add bin/ to .gitignore.

Change-Id: I5c788d324e56ca88366fb54b67240cebf5dced2c
Reviewed-on: https://go-review.googlesource.com/1171
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agocmd/dist: convert dist from Hg to Git.
David Symonds [Mon, 8 Dec 2014 02:53:11 +0000 (13:53 +1100)]
cmd/dist: convert dist from Hg to Git.

10 years agoconvert .hgignore to .gitignore.
David Symonds [Mon, 8 Dec 2014 02:50:49 +0000 (13:50 +1100)]
convert .hgignore to .gitignore.

10 years agoremove .hgtags.
David Symonds [Mon, 8 Dec 2014 02:50:49 +0000 (13:50 +1100)]
remove .hgtags.

10 years agoencoding/xml: remove SyntaxError.Byte
Russ Cox [Sat, 6 Dec 2014 02:33:07 +0000 (21:33 -0500)]
encoding/xml: remove SyntaxError.Byte

It is unused. It was introduced in the CL that added InputOffset.
I suspect it was an editing mistake.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/182580043

10 years agoall: merge dev.garbage (d1238958d4ae) into default branch
Russ Cox [Sat, 6 Dec 2014 01:34:45 +0000 (20:34 -0500)]
all: merge dev.garbage (d1238958d4ae) into default branch

When we start work on Gerrit, ppc64 and garbage collection
work will continue in the master branch, not the dev branches.

(We may still use dev branches for other things later, but
these are ready to be merged, and doing it now, before moving
to Git means we don't have to have dev branches working
in the Gerrit workflow on day one.)

TBR=rlh
CC=golang-codereviews
https://golang.org/cl/183140043

10 years ago[dev.garbage] runtime: raise StackGuard limit for Windows (again)
Russ Cox [Sat, 6 Dec 2014 00:50:09 +0000 (19:50 -0500)]
[dev.garbage] runtime: raise StackGuard limit for Windows (again)

640 bytes ought to be enough for anybody.

We'll bring this back down before Go 1.5. That's issue 9214.

TBR=rlh
CC=golang-codereviews
https://golang.org/cl/188730043

10 years agoall: power64 is now ppc64
Russ Cox [Sat, 6 Dec 2014 00:13:20 +0000 (19:13 -0500)]
all: power64 is now ppc64

Fixes #8654.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/180600043

10 years ago[dev.garbage] runtime: reduce stack footprint of write barriers
Russ Cox [Fri, 5 Dec 2014 21:47:50 +0000 (16:47 -0500)]
[dev.garbage] runtime: reduce stack footprint of write barriers

This is going to hurt a bit but we'll make it better later.
Now the race detector can be run again.

I added the write barrier optimizations from
CL 183020043 to try to make it hurt a little less.

TBR=rlh
CC=golang-codereviews
https://golang.org/cl/185070043

10 years agoruntime: generate windows callback list with go generate
Russ Cox [Fri, 5 Dec 2014 21:24:20 +0000 (16:24 -0500)]
runtime: generate windows callback list with go generate

This is the last system-dependent file written by cmd/dist.
They are all now written by go generate.

cmd/dist is not needed to start building package runtime
for a different system anymore.

Now all the generated files can be assumed generated, so
delete the clumsy hacks in cmd/api.

Re-enable api check in run.bash.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/185040044

10 years agoruntime: convert netbsd/arm to Go
Russ Cox [Fri, 5 Dec 2014 21:17:09 +0000 (16:17 -0500)]
runtime: convert netbsd/arm to Go

This was the last src/runtime/*.c file.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/187770043

10 years agoall: merge default (faa3ed1dc30e) into dev.garbage
Russ Cox [Fri, 5 Dec 2014 16:45:03 +0000 (11:45 -0500)]
all: merge default (faa3ed1dc30e) into dev.garbage

10 years agoall: merge dev.cc (81884b89bd88) into default
Russ Cox [Fri, 5 Dec 2014 16:43:41 +0000 (11:43 -0500)]
all: merge dev.cc (81884b89bd88) into default

With this change, default now contains Go 1.5 work.
Any future bug fixes for Go 1.4 in the compilers or
the runtime will have to be made directly to the
release branch.

10 years ago[dev.garbage] all: merge dev.cc (81884b89bd88) into dev.garbage
Russ Cox [Fri, 5 Dec 2014 16:40:41 +0000 (11:40 -0500)]
[dev.garbage] all: merge dev.cc (81884b89bd88) into dev.garbage

TBR=rlh
CC=golang-codereviews
https://golang.org/cl/181100044

10 years ago[dev.cc] all: merge default (8d42099cdc23) into dev.cc
Russ Cox [Fri, 5 Dec 2014 16:18:10 +0000 (11:18 -0500)]
[dev.cc] all: merge default (8d42099cdc23) into dev.cc

TBR=austin
CC=golang-codereviews
https://golang.org/cl/178700044

10 years ago[dev.cc] liblink: don't patch jumps to jumps to symbols
Austin Clements [Fri, 5 Dec 2014 14:24:01 +0000 (09:24 -0500)]
[dev.cc] liblink: don't patch jumps to jumps to symbols

When liblink sees something like

       JMP x
       ...
    x: JMP y

it rewrites the first jump to jump directly to y.  This is
fine if y is a resolved label.  However, it *also* does this
if y is a function symbol, but fails to carry over the
relocation that would later patch in that symbol's value.  As
a result, the original jump becomes either a self-jump (if
relative) or a jump to PC 0 (if absolute).

Fix this by disabling this optimization if the jump being
patched in is a jump to a symbol.

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/185890044

10 years ago[dev.cc] cmd/ld: finalize linkmode before determining whether to import runtime/cgo
Shenghou Ma [Fri, 5 Dec 2014 07:22:20 +0000 (02:22 -0500)]
[dev.cc] cmd/ld: finalize linkmode before determining whether to import runtime/cgo

Frankly, I don't understand how the current code could possibly work except
when every android program is using cgo. Discovered this while working on
the iOS port.

LGTM=crawshaw, rsc
R=rsc, crawshaw
CC=golang-codereviews
https://golang.org/cl/177470043

10 years agocmd/go: fix build
Rob Pike [Fri, 5 Dec 2014 00:37:56 +0000 (09:37 +0900)]
cmd/go: fix build
The new semantics of split require the newline be present.
The test was stale.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/182480043

10 years agocmd/go: avoid use of bufio.Scanner in generate
Rob Pike [Fri, 5 Dec 2014 00:15:38 +0000 (09:15 +0900)]
cmd/go: avoid use of bufio.Scanner in generate

Scanner can't handle stupid long lines and there are
reports of stupid long lines in production.

Note the issue isn't long "//go:generate" lines, but
any long line in any Go source file.

To be fair, if you're going to have a stupid long line
it's not a bad bet you'll want to run it through go
generate, because it's some embeddable asset that
has been machine generated. (One could ask why
that generation process didn't add a newline or two,
but we should cope anyway.)

Rewrite the file scanner in "go generate" so it can
handle arbitrarily long lines, and only stores in memory
those lines that start "//go:generate".

Also: Adjust the documentation to make clear that it
does not parse the file.

Fixes #9143.
Fixes #9196.

LGTM=rsc, dominik.honnef
R=rsc, cespare, minux, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/182970043

10 years agocmd/pprof/internal/commands: add command to open browser on windows
Shenghou Ma [Thu, 4 Dec 2014 16:24:23 +0000 (11:24 -0500)]
cmd/pprof/internal/commands: add command to open browser on windows

While we're at there, also add a message to prompt the user to install
Graphviz if "dot" command is not found.

Fixes #9178.

LGTM=adg, alex.brainman, cookieo9, rsc
R=rsc, adg, bradfitz, alex.brainman, cookieo9, smyrman
CC=golang-codereviews
https://golang.org/cl/180380043

10 years agolib/time: update to ICANN time zone database 2014j
Rob Pike [Thu, 4 Dec 2014 04:07:48 +0000 (20:07 -0800)]
lib/time: update to ICANN time zone database 2014j

Fixes #9189.

LGTM=dsymonds
R=golang-codereviews, dsymonds
CC=golang-codereviews
https://golang.org/cl/178660043

10 years agospec: add comment marker for consistency.
David Symonds [Wed, 3 Dec 2014 22:29:29 +0000 (09:29 +1100)]
spec: add comment marker for consistency.

LGTM=r
R=gri, r
CC=golang-codereviews
https://golang.org/cl/185830043

10 years agocmd/pprof: fix symbol resolution for remote profiles
Russ Cox [Wed, 3 Dec 2014 19:14:00 +0000 (14:14 -0500)]
cmd/pprof: fix symbol resolution for remote profiles

Fixes #9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043

10 years agocmd/go: regenerate doc.go
Dominik Honnef [Tue, 2 Dec 2014 23:28:54 +0000 (10:28 +1100)]
cmd/go: regenerate doc.go

Move change from CL 170770043 to correct file and regenerate docs
for changes from CL 164120043.

LGTM=adg
R=golang-codereviews, adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/183000043

10 years agotag go1.4rc2
Andrew Gerrand [Tue, 2 Dec 2014 03:39:23 +0000 (14:39 +1100)]
tag go1.4rc2

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/178600043

10 years agoruntime: fix hang in GC due to shrinkstack vs netpoll race
Russ Cox [Mon, 1 Dec 2014 21:32:06 +0000 (16:32 -0500)]
runtime: fix hang in GC due to shrinkstack vs netpoll race

During garbage collection, after scanning a stack, we think about
shrinking it to reclaim some memory. The shrinking code (called
while the world is stopped) checked that the status was Gwaiting
or Grunnable and then changed the state to Gcopystack, to essentially
lock the stack so that no other GC thread is scanning it.
The same locking happens for stack growth (and is more necessary there).

        oldstatus = runtime·readgstatus(gp);
        oldstatus &= ~Gscan;
        if(oldstatus == Gwaiting || oldstatus == Grunnable)
                runtime·casgstatus(gp, oldstatus, Gcopystack); // oldstatus is Gwaiting or Grunnable
        else
                runtime·throw("copystack: bad status, not Gwaiting or Grunnable");

Unfortunately, "stop the world" doesn't stop everything. It stops all
normal goroutine execution, but the network polling thread is still
blocked in epoll and may wake up. If it does, and it chooses a goroutine
to mark runnable, and that goroutine is the one whose stack is shrinking,
then it can happen that between readgstatus and casgstatus, the status
changes from Gwaiting to Grunnable.

casgstatus assumes that if the status is not what is expected, it is a
transient change (like from Gwaiting to Gscanwaiting and back, or like
from Gwaiting to Gcopystack and back), and it loops until the status
has been restored to the expected value. In this case, the status has
changed semi-permanently from Gwaiting to Grunnable - it won't
change again until the GC is done and the world can continue, but the
GC is waiting for the status to change back. This wedges the program.

To fix, call a special variant of casgstatus that accepts either Gwaiting
or Grunnable as valid statuses.

Without the fix bug with the extra check+throw in casgstatus, the
program below dies in a few seconds (2-10) with GOMAXPROCS=8
on a 2012 Retina MacBook Pro. With the fix, it runs for minutes
and minutes.

package main

import (
        "io"
        "log"
        "net"
        "runtime"
)

func main() {
        const N = 100
        for i := 0; i < N; i++ {
                l, err := net.Listen("tcp", "127.0.0.1:0")
                if err != nil {
                        log.Fatal(err)
                }
                ch := make(chan net.Conn, 1)
                go func() {
                        var err error
                        c1, err := net.Dial("tcp", l.Addr().String())
                        if err != nil {
                                log.Fatal(err)
                        }
                        ch <- c1
                }()
                c2, err := l.Accept()
                if err != nil {
                        log.Fatal(err)
                }
                c1 := <-ch
                l.Close()
                go netguy(c1, c2)
                go netguy(c2, c1)
                c1.Write(make([]byte, 100))
        }
        for {
                runtime.GC()
        }
}

func netguy(r, w net.Conn) {
        buf := make([]byte, 100)
        for {
                bigstack(1000)
                _, err := io.ReadFull(r, buf)
                if err != nil {
                        log.Fatal(err)
                }
                w.Write(buf)
        }
}

var g int

func bigstack(n int) {
        var buf [100]byte
        if n > 0 {
                bigstack(n - 1)
        }
        g = int(buf[0]) + int(buf[99])
}

Fixes #9186.

LGTM=rlh
R=austin, rlh
CC=dvyukov, golang-codereviews, iant, khr, r
https://golang.org/cl/179680043

10 years agoreflect: Fix reflect.funcLayout. The GC bitmap has two bits per
Keith Randall [Mon, 1 Dec 2014 15:52:09 +0000 (07:52 -0800)]
reflect: Fix reflect.funcLayout.  The GC bitmap has two bits per
pointer, not one.

Fixes #9179

LGTM=iant, rsc
R=golang-codereviews, iant, rsc
CC=golang-codereviews
https://golang.org/cl/182160043

10 years ago[dev.cc] 9l: make R_CALLPOWER like ELF's R_PPC64_REL24
Austin Clements [Tue, 25 Nov 2014 21:00:25 +0000 (16:00 -0500)]
[dev.cc] 9l: make R_CALLPOWER like ELF's R_PPC64_REL24

These accomplished the same thing, but R_CALLPOWER expected
the whole instruction to be in the addend (and completely
overwrote what was in the text section), while R_PPC64_REL24
overwrites only bits 6 through 24 of whatever was in the text
section.  Make R_CALLPOWER work like R_PPC64_REL24 to ease the
implementation of dynamic linking.

LGTM=rsc
R=rsc
CC=golang-codereviews, minux
https://golang.org/cl/177430043

10 years ago[dev.cc] cmd/5g,cmd/6g,cmd/9g: fix warnings on Plan 9
David du Colombier [Tue, 25 Nov 2014 07:42:00 +0000 (08:42 +0100)]
[dev.cc] cmd/5g,cmd/6g,cmd/9g: fix warnings on Plan 9

warning: src/cmd/5g/reg.c:461 format mismatch d VLONG, arg 5
warning: src/cmd/6g/reg.c:396 format mismatch d VLONG, arg 5
warning: src/cmd/9g/reg.c:440 format mismatch d VLONG, arg 5

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/179300043

10 years agodoc: tidy up "Projects" page; add Go 1.4
Andrew Gerrand [Tue, 25 Nov 2014 04:41:33 +0000 (15:41 +1100)]
doc: tidy up "Projects" page; add Go 1.4

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/182750043

10 years agogo/build: build $GOOS_test.go always
Russ Cox [Tue, 25 Nov 2014 01:18:44 +0000 (20:18 -0500)]
go/build: build $GOOS_test.go always

We decided to build $GOOS.go always
but forgot to test $GOOS_test.go.

Fixes #9159.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/176290043

10 years ago[dev.garbage] all: merge dev.cc (493ad916c3b1) into dev.garbage
Russ Cox [Mon, 24 Nov 2014 17:07:11 +0000 (12:07 -0500)]
[dev.garbage] all: merge dev.cc (493ad916c3b1) into dev.garbage

TBR=austin
CC=golang-codereviews
https://golang.org/cl/179290043

10 years ago[dev.cc] 9g: peephole optimizer
Austin Clements [Mon, 24 Nov 2014 16:42:15 +0000 (11:42 -0500)]
[dev.cc] 9g: peephole optimizer

This was based on the 9c peephole optimizer, modified to work
with code generated by gc and use the proginfo infrastructure
in gc.

LGTM=rsc
R=rsc, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/179190043

10 years ago[dev.cc] 9g: fill progtable for CC, V, and VCC instruction variants
Austin Clements [Mon, 24 Nov 2014 16:40:36 +0000 (11:40 -0500)]
[dev.cc] 9g: fill progtable for CC, V, and VCC instruction variants

This adds some utilities for converting between the CC, V, and
VCC variants of operations and uses these to derive the
ProgInfo entries for these variants (which are identical to
the ProgInfo for the base operations).

The 9g peephole optimizer will also use these conversion
utilities.

LGTM=minux, rsc
R=rsc, dave, minux
CC=golang-codereviews
https://golang.org/cl/180110044

10 years ago[dev.cc] runtime: convert dragonfly/386 port to Go
Joel Sing [Mon, 24 Nov 2014 16:15:11 +0000 (03:15 +1100)]
[dev.cc] runtime: convert dragonfly/386 port to Go

LGTM=rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/178210043

10 years ago[dev.cc] all: merge default (95f5614b4648) into dev.cc
Russ Cox [Sun, 23 Nov 2014 20:13:48 +0000 (15:13 -0500)]
[dev.cc] all: merge default (95f5614b4648) into dev.cc

TBR=austin
CC=golang-codereviews
https://golang.org/cl/177220044

10 years agoimage/jpeg: handle Read returning n > 0, err != nil in d.fill
Russ Cox [Sat, 22 Nov 2014 18:55:33 +0000 (13:55 -0500)]
image/jpeg: handle Read returning n > 0, err != nil in d.fill

Fixes #9127.

LGTM=r
R=bradfitz, r
CC=golang-codereviews, nigeltao
https://golang.org/cl/178120043

10 years agocmd/go: fix running pprof on windows.
Shenghou Ma [Sat, 22 Nov 2014 18:37:46 +0000 (13:37 -0500)]
cmd/go: fix running pprof on windows.

Fixes #9149.

LGTM=alex.brainman, rsc
R=rsc, dave, alex.brainman
CC=golang-codereviews
https://golang.org/cl/176170043

10 years ago[dev.cc] runtime: convert netbsd/386 port to Go
Joel Sing [Sat, 22 Nov 2014 11:09:11 +0000 (22:09 +1100)]
[dev.cc] runtime: convert netbsd/386 port to Go

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/177170043

10 years ago[dev.cc] runtime: convert netbsd/amd64 port to Go
Joel Sing [Sat, 22 Nov 2014 05:05:31 +0000 (16:05 +1100)]
[dev.cc] runtime: convert netbsd/amd64 port to Go

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169620043

10 years ago[dev.cc] runtime: migrate Android/ARM port to Go.
Shenghou Ma [Fri, 21 Nov 2014 23:15:30 +0000 (18:15 -0500)]
[dev.cc] runtime: migrate Android/ARM port to Go.

I tested building Go itself, but not any of go.mobile tests.

LGTM=crawshaw
R=crawshaw, rsc
CC=golang-codereviews
https://golang.org/cl/179110043

10 years ago[dev.cc] runtime: explicitly exclude android in zgoos_linux.go
Shenghou Ma [Fri, 21 Nov 2014 23:13:59 +0000 (18:13 -0500)]
[dev.cc] runtime: explicitly exclude android in zgoos_linux.go

Otherwise both zgoos_linux.go and zgoos_android.go will be compiled
for GOOS=android.

LGTM=crawshaw, rsc
R=rsc, crawshaw
CC=golang-codereviews
https://golang.org/cl/178110043

10 years ago[dev.garbage] runtime: Stop running gs during the GCscan phase.
Rick Hudson [Fri, 21 Nov 2014 21:46:27 +0000 (16:46 -0500)]
[dev.garbage] runtime: Stop running gs during the GCscan phase.
Ensure that all gs are in a scan state when their stacks are being scanned.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/179160044

10 years ago[dev.cc] liblink: more docs on Prog and Addr fields
Austin Clements [Fri, 21 Nov 2014 20:58:29 +0000 (15:58 -0500)]
[dev.cc] liblink: more docs on Prog and Addr fields

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/174530043

10 years ago[dev.cc] 9g: correct bad proginfo for ADUFFZERO and ADUFFCOPY
Austin Clements [Fri, 21 Nov 2014 20:58:01 +0000 (15:58 -0500)]
[dev.cc] 9g: correct bad proginfo for ADUFFZERO and ADUFFCOPY

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/176130044

10 years ago[dev.garbage] runtime: add prefetcht0, prefetcht1, prefetcht2, prefetcht3, prefetchnt...
Russ Cox [Fri, 21 Nov 2014 20:57:10 +0000 (15:57 -0500)]
[dev.garbage] runtime: add prefetcht0, prefetcht1, prefetcht2, prefetcht3, prefetchnta for GC

We don't know what we need yet, so add them all.
Add them even on x86 architectures (as no-ops) so that
the GC can refer to them unconditionally.

Eventually we'll know what we want and probably
have just one 'prefetch' with an appropriate meaning
on each architecture.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/179160043

10 years ago[dev.cc] liblink: fix warnings on Plan 9
David du Colombier [Fri, 21 Nov 2014 19:56:33 +0000 (20:56 +0100)]
[dev.cc] liblink: fix warnings on Plan 9

warning: src/liblink/list6.c:94 set and not used: s
warning: src/liblink/list6.c:157 format mismatch ld VLONG, arg 3
warning: src/liblink/list6.c:157 format mismatch E UINT, arg 4
warning: src/liblink/list6.c:157 format mismatch d VLONG, arg 5
warning: src/liblink/list6.c:163 set and not used: s
warning: src/liblink/list9.c:105 set and not used: s
warning: src/liblink/list9.c:185 format mismatch ld VLONG, arg 3
warning: src/liblink/list9.c:185 format mismatch E UINT, arg 4
warning: src/liblink/list9.c:185 format mismatch d VLONG, arg 5
warning: src/liblink/list9.c:193 set and not used: s

LGTM=rsc
R=rsc
CC=austin, golang-codereviews, minux
https://golang.org/cl/176130043