]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years agotest/fixedbugs: fix typo in comment
Dave Cheney [Sun, 29 Jun 2014 10:34:35 +0000 (20:34 +1000)]
test/fixedbugs: fix typo in comment

Fix copy paste error pointed out by rsc, https://golang.org/cl/107290043/diff/60001/test/fixedbugs/issue8074.go#newcode7

LGTM=ruiu, r
R=golang-codereviews, ruiu, r
CC=golang-codereviews
https://golang.org/cl/106210047

10 years agoruntime: fix GC bitmap corruption
Dmitriy Vyukov [Sun, 29 Jun 2014 02:20:46 +0000 (19:20 -0700)]
runtime: fix GC bitmap corruption
Fixes #8299.

R=golang-codereviews
CC=golang-codereviews, khr, rsc
https://golang.org/cl/103640044

10 years agostrings: Replacer is safe for concurrent use
Evan Shaw [Sat, 28 Jun 2014 22:53:07 +0000 (15:53 -0700)]
strings: Replacer is safe for concurrent use

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

10 years agocrypto/cipher: Fix typo in example comment
Preetam Jinka [Sat, 28 Jun 2014 17:11:26 +0000 (10:11 -0700)]
crypto/cipher: Fix typo in example comment

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

10 years agoflag: add a little more doc comment to Duration.
David Symonds [Sat, 28 Jun 2014 10:47:06 +0000 (20:47 +1000)]
flag: add a little more doc comment to Duration.

The only text that describes the accepted format is in the package doc,
which is far away from these functions. The other flag types don't need
this explicitness because they are more obvious.

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

10 years agonet/http: add TLS benchmark
Dmitriy Vyukov [Sat, 28 Jun 2014 01:30:09 +0000 (18:30 -0700)]
net/http: add TLS benchmark

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/110080045

10 years agoruntime: make garbage collector faster by deleting code again
Dmitriy Vyukov [Sat, 28 Jun 2014 01:19:02 +0000 (18:19 -0700)]
runtime: make garbage collector faster by deleting code again
Remove GC bitmap backward scanning.
This was already done once in https://golang.org/cl/5530074/
Still makes GC a bit faster.
On the garbage benchmark, before:
        gc-pause-one=237345195
        gc-pause-total=4746903
        cputime=32427775
        time=32458208
after:
        gc-pause-one=235484019
        gc-pause-total=4709680
        cputime=31861965
        time=31877772
Also prepares mgc0.c for future changes.

R=golang-codereviews, khr, khr
CC=golang-codereviews, rsc
https://golang.org/cl/105380043

10 years agoruntime: fix nacl amd64p32 flakiness
Russ Cox [Sat, 28 Jun 2014 00:13:16 +0000 (20:13 -0400)]
runtime: fix nacl amd64p32 flakiness

newproc takes two extra pointers, not two extra registers.
On amd64p32 (nacl) they are different.

We diagnosed this before the 1.3 cut but the tree was frozen.
I believe this is causing the random problems on the builder.

Fixes #8199.

TBR=r
CC=golang-codereviews
https://golang.org/cl/102710043

10 years agocmd/go: build non-runnable examples in xtests
Andrew Gerrand [Fri, 27 Jun 2014 21:15:22 +0000 (07:15 +1000)]
cmd/go: build non-runnable examples in xtests

Include these files in the build,
even though they don't get executed.

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

10 years agonet/http: [Post]FormValue ignores parse errors
Evan Shaw [Fri, 27 Jun 2014 18:21:57 +0000 (11:21 -0700)]
net/http: [Post]FormValue ignores parse errors

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

10 years agoruntime: fix Plan 9 build
Anthony Martin [Fri, 27 Jun 2014 13:36:41 +0000 (15:36 +0200)]
runtime: fix Plan 9 build

LGTM=0intro, aram
R=rsc, 0intro, aram
CC=golang-codereviews
https://golang.org/cl/109240044

10 years agoruntime: improve scheduler trace
Dmitriy Vyukov [Fri, 27 Jun 2014 00:16:43 +0000 (17:16 -0700)]
runtime: improve scheduler trace
Output number of spinning threads,
this is useful to understanding whether the scheduler
is in a steady state or not.

R=golang-codereviews, khr
CC=golang-codereviews, rsc
https://golang.org/cl/103540045

10 years agostrings: avoid pointless slice growth in makeBenchInputHard
Josh Bleecher Snyder [Thu, 26 Jun 2014 20:00:47 +0000 (13:00 -0700)]
strings: avoid pointless slice growth in makeBenchInputHard

LGTM=ruiu
R=golang-codereviews, ruiu
CC=golang-codereviews
https://golang.org/cl/108150043

10 years agoruntime: say when a goroutine is locked to OS thread
Dmitriy Vyukov [Thu, 26 Jun 2014 18:40:48 +0000 (11:40 -0700)]
runtime: say when a goroutine is locked to OS thread
Say when a goroutine is locked to OS thread in crash reports
and goroutine profiles.
It can be useful to understand what goroutines consume OS threads
(syscall and locked), e.g. if you forget to call UnlockOSThread
or leak locked goroutines.

R=golang-codereviews
CC=golang-codereviews, rsc
https://golang.org/cl/94170043

10 years agocmd/gc: moved usefield to correct section of go.h, from "reflect.c" to "walk.c".
Evan Kroske [Thu, 26 Jun 2014 17:02:16 +0000 (10:02 -0700)]
cmd/gc: moved usefield to correct section of go.h, from "reflect.c" to "walk.c".

LGTM=iant
R=golang-codereviews, gobot, iant, dave
CC=golang-codereviews
https://golang.org/cl/108990044

10 years agoC: add Evan Kroske (Google CLA)
Ian Lance Taylor [Thu, 26 Jun 2014 17:01:28 +0000 (10:01 -0700)]
C: add Evan Kroske (Google CLA)

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

10 years agogo/parser: permit parentheses in receiver types
Robert Griesemer [Thu, 26 Jun 2014 16:45:11 +0000 (09:45 -0700)]
go/parser: permit parentheses in receiver types

Pending acceptance of CL 101500044
and adjustment of test/fixedbugs/bug299.go.

LGTM=adonovan
R=golang-codereviews, adonovan
CC=golang-codereviews
https://golang.org/cl/110160043

10 years agoall: remove 'extern register M *m' from runtime
Russ Cox [Thu, 26 Jun 2014 15:54:39 +0000 (11:54 -0400)]
all: remove 'extern register M *m' from runtime

The runtime has historically held two dedicated values g (current goroutine)
and m (current thread) in 'extern register' slots (TLS on x86, real registers
backed by TLS on ARM).

This CL removes the extern register m; code now uses g->m.

On ARM, this frees up the register that formerly held m (R9).
This is important for NaCl, because NaCl ARM code cannot use R9 at all.

The Go 1 macrobenchmarks (those with per-op times >= 10 µs) are unaffected:

BenchmarkBinaryTree17              5491374955     5471024381     -0.37%
BenchmarkFannkuch11                4357101311     4275174828     -1.88%
BenchmarkGobDecode                 11029957       11364184       +3.03%
BenchmarkGobEncode                 6852205        6784822        -0.98%
BenchmarkGzip                      650795967      650152275      -0.10%
BenchmarkGunzip                    140962363      141041670      +0.06%
BenchmarkHTTPClientServer          71581          73081          +2.10%
BenchmarkJSONEncode                31928079       31913356       -0.05%
BenchmarkJSONDecode                117470065      113689916      -3.22%
BenchmarkMandelbrot200             6008923        5998712        -0.17%
BenchmarkGoParse                   6310917        6327487        +0.26%
BenchmarkRegexpMatchMedium_1K      114568         114763         +0.17%
BenchmarkRegexpMatchHard_1K        168977         169244         +0.16%
BenchmarkRevcomp                   935294971      914060918      -2.27%
BenchmarkTemplate                  145917123      148186096      +1.55%

Minux previous reported larger variations, but these were caused by
run-to-run noise, not repeatable slowdowns.

Actual code changes by Minux.
I only did the docs and the benchmarking.

LGTM=dvyukov, iant, minux
R=minux, josharian, iant, dave, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/109050043

10 years agocmd/gc: drop parenthesization restriction for receiver types
Russ Cox [Wed, 25 Jun 2014 13:57:48 +0000 (09:57 -0400)]
cmd/gc: drop parenthesization restriction for receiver types

Matches CL 101500044.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/110160044

10 years agoindex/suffixarray: reduce size of a benchmark
Dmitriy Vyukov [Wed, 25 Jun 2014 03:37:28 +0000 (20:37 -0700)]
index/suffixarray: reduce size of a benchmark
A single iteration of BenchmarkSaveRestore runs for 5 seconds
on my freebsd machine. 5 seconds looks like too long for a single
iteration.
This is the only benchmark that times out on freebsd-amd64-race builder.

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/107340044

10 years agoundo CL 107320046 / 97cd07dcb9d8
Andrew Gerrand [Wed, 25 Jun 2014 02:04:36 +0000 (12:04 +1000)]
undo CL 107320046 / 97cd07dcb9d8

Breaks the build

««« original CL description
cmd/go: build test files containing non-runnable examples

Even if we can't run them, we should at least check that they compile.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/107320046
»»»

TBR=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/110140044

10 years agoregexp: skip TestOnePassCutoff in short mode
Dmitriy Vyukov [Wed, 25 Jun 2014 00:19:10 +0000 (17:19 -0700)]
regexp: skip TestOnePassCutoff in short mode
Runs for 4 seconds on my mac.
Also this is the only test that times out on freebsd in -race mode.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/110150045

10 years agofmt: fix typo in help doc
Mihai Borobocea [Tue, 24 Jun 2014 23:59:33 +0000 (16:59 -0700)]
fmt: fix typo in help doc

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

10 years agoA+C: add Tetsuo Kiso (personal CLA)
Ian Lance Taylor [Tue, 24 Jun 2014 23:33:32 +0000 (16:33 -0700)]
A+C: add Tetsuo Kiso (personal CLA)

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

10 years agospec: receiver declaration is just a parameter declaration
Robert Griesemer [Tue, 24 Jun 2014 23:25:09 +0000 (16:25 -0700)]
spec: receiver declaration is just a parameter declaration

This CL removes the special syntax for method receivers and
makes it just like other parameters. Instead, the crucial
receiver-specific rules (exactly one receiver, receiver type
must be of the form T or *T) are specified verbally instead
of syntactically.

This is a fully backward-compatible (and minor) syntax
relaxation. As a result, the following syntactic restrictions
(which are completely irrelevant) and which were only in place
for receivers are removed:

a) receiver types cannot be parenthesized
b) receiver parameter lists cannot have a trailing comma

The result of this CL is a simplication of the spec and the
implementation, with no impact on existing (or future) code.

Noteworthy:

- gc already permits a trailing comma at the end of a receiver
  declaration:

  func (recv T,) m() {}

  This is technically a bug with the current spec; this CL will
  legalize this notation.

- gccgo produces a misleading error when a trailing comma is used:

  error: method has multiple receivers

  (even though there's only one receiver)

- Compilers and type-checkers won't need to report errors anymore
  if receiver types are parenthesized.

Fixes #4496.

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

10 years agorace.bash: support freebsd
Dmitriy Vyukov [Tue, 24 Jun 2014 22:47:22 +0000 (15:47 -0700)]
race.bash: support freebsd

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/110150044

10 years agocmd/go: build test files containing non-runnable examples
Andrew Gerrand [Tue, 24 Jun 2014 22:22:22 +0000 (08:22 +1000)]
cmd/go: build test files containing non-runnable examples

Even if we can't run them, we should at least check that they compile.

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

10 years agosyscall: implement setresuid(2) and setresgid(2) on OpenBSD/FreeBSD/DragonflyBSD
William Orr [Tue, 24 Jun 2014 20:30:30 +0000 (13:30 -0700)]
syscall: implement setresuid(2) and setresgid(2) on OpenBSD/FreeBSD/DragonflyBSD

Fixes #8218.

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

10 years agosyscall: add source-specific multicast socket options for Darwin
Mikio Hara [Tue, 24 Jun 2014 20:01:09 +0000 (05:01 +0900)]
syscall: add source-specific multicast socket options for Darwin

Update #8266

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

10 years agoC: add Glenn Lewis (Google CLA)
Glenn Lewis [Tue, 24 Jun 2014 19:52:48 +0000 (05:52 +1000)]
C: add Glenn Lewis (Google CLA)

For work on goauth2.

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

10 years agodoc/go1.4.txt: text/scanner: IsIdentRune
Rob Pike [Tue, 24 Jun 2014 18:09:13 +0000 (11:09 -0700)]
doc/go1.4.txt: text/scanner: IsIdentRune

R=gri
CC=golang-codereviews
https://golang.org/cl/104340043

10 years agostrings: additional tests
Dave Cheney [Tue, 24 Jun 2014 17:06:07 +0000 (03:06 +1000)]
strings: additional tests

This CL re-applies the tests added in CL 101330053 and subsequently rolled back in CL 102610043.

The original author of this change was Rui Ueyama <ruiu@google.com>

LGTM=r, ruiu
R=ruiu, r
CC=golang-codereviews
https://golang.org/cl/109170043

10 years agotesting: make benchmarking faster
Josh Bleecher Snyder [Tue, 24 Jun 2014 15:39:30 +0000 (08:39 -0700)]
testing: make benchmarking faster

The number of estimated iterations required to reach the benchtime is multiplied by a safety margin (to avoid falling just short) and then rounded up to a readable number. With an accurate estimate, in the worse case, the resulting number of iterations could be 3.75x more than necessary: 1.5x for safety * 2.5x to round up (e.g. from 2eX+1 to 5eX).

This CL reduces the safety margin to 1.2x. Experimentation showed a diminishing margin of return past 1.2x, although the average case continued to show improvements down to 1.05x.

This CL also reduces the maximum round-up multiplier from 2.5x (from 2eX+1 to 5eX) to 2x, by allowing the number of iterations to be of the form 3eX.

Both changes improve benchmark wall clock times, and the effects are cumulative.

From 1.5x to 1.2x safety margin:

package old s new s delta
bytes 163 125 -23%
encoding/json 27 21 -22%
net/http 42 36 -14%
runtime 463 418 -10%
strings 82 65 -21%

Allowing 3eX iterations:

package old s new s delta
bytes 163 134 -18%
encoding/json 27 23 -15%
net/http 42 36 -14%
runtime 463 422 -9%
strings 82 72 -12%

Combined:

package old s new s delta
bytes 163 112 -31%
encoding/json 27 20 -26%
net/http 42 30 -29%
runtime 463 346 -25%
strings 82 60 -27%

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

10 years agonet/http: remove a duplicated check
Robert Obryk [Tue, 24 Jun 2014 00:38:17 +0000 (17:38 -0700)]
net/http: remove a duplicated check

The previous call to parseRange already checks whether
all the ranges start before the end of file.

LGTM=robert.hencke, bradfitz
R=golang-codereviews, robert.hencke, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/91880044

10 years agosyscall: regenerate z-files for darwin
Mikio Hara [Tue, 24 Jun 2014 00:20:42 +0000 (09:20 +0900)]
syscall: regenerate z-files for darwin

Updates z-files from 10.7 kernel-based to 10.9 kernel-based.

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

10 years agodoc/go1.4: add note about Set{uid,gid} change
Dave Cheney [Mon, 23 Jun 2014 23:50:10 +0000 (09:50 +1000)]
doc/go1.4: add note about Set{uid,gid} change

LGTM=iant
R=ruiu, iant
CC=golang-codereviews
https://golang.org/cl/107320044

10 years agosyscall: disable Setuid/Setgid on linux
Dave Cheney [Mon, 23 Jun 2014 23:16:24 +0000 (09:16 +1000)]
syscall: disable Setuid/Setgid on linux

Update #1435

This proposal disables Setuid and Setgid on all linux platforms.

Issue 1435 has been open for a long time, and it is unlikely to be addressed soon so an argument was made by a commenter

https://code.google.com/p/go/issues/detail?id=1435#c45

That these functions should made to fail rather than succeed in their broken state.

LGTM=ruiu, iant
R=iant, ruiu
CC=golang-codereviews
https://golang.org/cl/106170043

10 years agosyscall: add source-specific multicast socket options for FreeBSD
Mikio Hara [Mon, 23 Jun 2014 22:03:44 +0000 (07:03 +0900)]
syscall: add source-specific multicast socket options for FreeBSD

Update #8266

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

10 years agoruntime: speed up amd64 memmove
Rui Ueyama [Mon, 23 Jun 2014 19:06:26 +0000 (12:06 -0700)]
runtime: speed up amd64 memmove

MOV with SSE registers seems faster than REP MOVSQ if the
size being copied is less than about 2K. Previously we
didn't use MOV if the memory region is larger than 256
byte. This patch improves the performance of 257 ~ 2048
byte non-overlapping copy by using MOV.

Here is the benchmark result on Intel Xeon 3.5GHz (Nehalem).

benchmark               old ns/op    new ns/op    delta
BenchmarkMemmove16              4            4   +0.42%
BenchmarkMemmove32              5            5   -0.20%
BenchmarkMemmove64              6            6   -0.81%
BenchmarkMemmove128             7            7   -0.82%
BenchmarkMemmove256            10           10   +1.92%
BenchmarkMemmove512            29           16  -44.90%
BenchmarkMemmove1024           37           25  -31.55%
BenchmarkMemmove2048           55           44  -19.46%
BenchmarkMemmove4096           92           91   -0.76%

benchmark                old MB/s     new MB/s  speedup
BenchmarkMemmove16        3370.61      3356.88    1.00x
BenchmarkMemmove32        6368.68      6386.99    1.00x
BenchmarkMemmove64       10367.37     10462.62    1.01x
BenchmarkMemmove128      17551.16     17713.48    1.01x
BenchmarkMemmove256      24692.81     24142.99    0.98x
BenchmarkMemmove512      17428.70     31687.72    1.82x
BenchmarkMemmove1024     27401.82     40009.45    1.46x
BenchmarkMemmove2048     36884.86     45766.98    1.24x
BenchmarkMemmove4096     44295.91     44627.86    1.01x

LGTM=khr
R=golang-codereviews, gobot, khr
CC=golang-codereviews
https://golang.org/cl/90500043

10 years agosyscall: consolidate, simplify socket options for Unix-like systems
Mikio Hara [Mon, 23 Jun 2014 09:46:01 +0000 (18:46 +0900)]
syscall: consolidate, simplify socket options for Unix-like systems

Also exposes common socket option functions on Solaris.

Update #7174
Update #7175

LGTM=aram
R=golang-codereviews, aram
CC=golang-codereviews
https://golang.org/cl/107280044

10 years agosyscall: don't display syscall prototype lines on godoc
Mikio Hara [Mon, 23 Jun 2014 05:33:33 +0000 (14:33 +0900)]
syscall: don't display syscall prototype lines on godoc

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

10 years agoimage/png: remove unnecessary function call
Rui Ueyama [Mon, 23 Jun 2014 00:29:56 +0000 (10:29 +1000)]
image/png: remove unnecessary function call

paeth(0, x, 0) == x for any uint8 value.

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

10 years agoundo CL 101330053 / c19c9a063fe8
Rui Ueyama [Sun, 22 Jun 2014 22:26:30 +0000 (15:26 -0700)]
undo CL 101330053 / c19c9a063fe8

sync.Pool is not supposed to be used everywhere, but is
a last resort.

««« original CL description
strings: use sync.Pool to cache buffer

benchmark                         old ns/op    new ns/op    delta
BenchmarkByteReplacerWriteString       3596         3094  -13.96%

benchmark                        old allocs   new allocs    delta
BenchmarkByteReplacerWriteString          1            0  -100.00%

LGTM=dvyukov
R=bradfitz, dave, dvyukov
CC=golang-codereviews
https://golang.org/cl/101330053
»»»

LGTM=dave
R=r, dave
CC=golang-codereviews
https://golang.org/cl/102610043

10 years agotest: add test case for issue 8074.
Dave Cheney [Sun, 22 Jun 2014 07:33:00 +0000 (17:33 +1000)]
test: add test case for issue 8074.

Fixes #8074.

The issue was not reproduceable by revision

go version devel +e0ad7e329637 Thu Jun 19 22:19:56 2014 -0700 linux/arm

But include the original test case in case the issue reopens itself.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://golang.org/cl/107290043

10 years agostrings: use sync.Pool to cache buffer
Rui Ueyama [Sun, 22 Jun 2014 05:08:43 +0000 (22:08 -0700)]
strings: use sync.Pool to cache buffer

benchmark                         old ns/op    new ns/op    delta
BenchmarkByteReplacerWriteString       3596         3094  -13.96%

benchmark                        old allocs   new allocs    delta
BenchmarkByteReplacerWriteString          1            0  -100.00%

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

10 years agodoc: say that race detector is supported on freebsd
Dmitriy Vyukov [Sat, 21 Jun 2014 16:19:49 +0000 (20:19 +0400)]
doc: say that race detector is supported on freebsd

R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/103520044

10 years agodoc: say that race detector is supported on freebsd
Dmitriy Vyukov [Sat, 21 Jun 2014 16:19:32 +0000 (20:19 +0400)]
doc: say that race detector is supported on freebsd

LGTM=ruiu
R=golang-codereviews, ruiu
CC=golang-codereviews
https://golang.org/cl/109100046

10 years agorun.bash: run race tests on freebsd
Dmitriy Vyukov [Sat, 21 Jun 2014 00:54:18 +0000 (20:54 -0400)]
run.bash: run race tests on freebsd

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

10 years agoruntime/race: support freebsd
Dmitriy Vyukov [Sat, 21 Jun 2014 00:20:56 +0000 (20:20 -0400)]
runtime/race: support freebsd
All tests pass except one test in regexp package.

LGTM=iant
R=golang-codereviews, iant, dave
CC=golang-codereviews
https://golang.org/cl/107270043

10 years agoruntime/race: update linux runtime
Dmitriy Vyukov [Fri, 20 Jun 2014 23:54:16 +0000 (03:54 +0400)]
runtime/race: update linux runtime
It was built on an old, bogus revision.

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

10 years agoruntime/race: update runtime to tip
Dmitriy Vyukov [Fri, 20 Jun 2014 23:36:21 +0000 (16:36 -0700)]
runtime/race: update runtime to tip
This requires minimal changes to the runtime hooks. In particular,
synchronization events must be done only on valid addresses now,
so I've added the additional checks to race.c.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/101000046

10 years agostrings: speed up byteReplacer.Replace
Rui Ueyama [Fri, 20 Jun 2014 19:18:33 +0000 (12:18 -0700)]
strings: speed up byteReplacer.Replace

benchmark                         old ns/op    new ns/op    delta
BenchmarkByteReplacerWriteString       7359         3661  -50.25%

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

10 years agosync: detect incorrect usages of RWMutex
Dmitriy Vyukov [Fri, 20 Jun 2014 05:19:56 +0000 (22:19 -0700)]
sync: detect incorrect usages of RWMutex
Fixes #7858.

LGTM=ruiu
R=ruiu
CC=golang-codereviews
https://golang.org/cl/92720045

10 years agonet: simplify code
Dmitriy Vyukov [Fri, 20 Jun 2014 05:04:37 +0000 (22:04 -0700)]
net: simplify code
Single-case select with a non-nil channel is pointless.

LGTM=mikioh.mikioh
R=mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/103920044

10 years agoruntime: remove obsolete afterprologue check
Dmitriy Vyukov [Fri, 20 Jun 2014 05:04:10 +0000 (22:04 -0700)]
runtime: remove obsolete afterprologue check
Afterprologue check was required when did not know
about return arguments of functions and/or they were not zeroed.
Now 100% precision is required for stacks due to stack copying,
so it must work w/o afterprologue one way or another.
I can limit this change for 1.3 to merely adding a TODO,
but this check is super confusing so I don't want this knowledge to get lost.

LGTM=rsc
R=golang-codereviews, gobot, rsc, khr
CC=golang-codereviews, khr, rsc
https://golang.org/cl/96580045

10 years agostrings: define byteBitmap.isSet
Rui Ueyama [Fri, 20 Jun 2014 03:10:55 +0000 (20:10 -0700)]
strings: define byteBitmap.isSet

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

10 years agoencoding/base64, encoding/base32: speed up Encode
Rui Ueyama [Thu, 19 Jun 2014 19:04:59 +0000 (12:04 -0700)]
encoding/base64, encoding/base32: speed up Encode
Avoid unnecessary bitwise-OR operations.

benchmark                      old MB/s     new MB/s  speedup
BenchmarkEncodeToStringBase64  179.02       205.74    1.15x
BenchmarkEncodeToStringBase32  155.86       167.82    1.08x

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

10 years agostrings: reduce allocation in byteStringReplacer.WriteString
Rui Ueyama [Thu, 19 Jun 2014 18:22:50 +0000 (11:22 -0700)]
strings: reduce allocation in byteStringReplacer.WriteString

Use WriteString instead of allocating a byte slice as a
buffer. This was a TODO.

benchmark               old ns/op    new ns/op    delta
BenchmarkWriteString        40139        19991  -50.20%

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

10 years agoimage/jpeg: encode *image.Gray as grayscale JPEGs.
Bill Thiede [Thu, 19 Jun 2014 12:18:24 +0000 (22:18 +1000)]
image/jpeg: encode *image.Gray as grayscale JPEGs.

Fixes #8201.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/105990046

10 years agotesting/quick: brought Check parameter name in line with function doc
Caleb Spare [Thu, 19 Jun 2014 05:49:14 +0000 (01:49 -0400)]
testing/quick: brought Check parameter name in line with function doc

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

10 years agoimage/jpeg: use a look-up table to speed up Huffman decoding. This
Nigel Tao [Thu, 19 Jun 2014 01:39:03 +0000 (11:39 +1000)]
image/jpeg: use a look-up table to speed up Huffman decoding. This
requires a decoder to do its own byte buffering instead of using
bufio.Reader, due to byte stuffing.

benchmark                      old MB/s     new MB/s     speedup
BenchmarkDecodeBaseline        33.40        50.65        1.52x
BenchmarkDecodeProgressive     24.34        31.92        1.31x

On 6g, unsafe.Sizeof(huffman{}) falls from 4872 to 964 bytes, and
the decoder struct contains 8 of those.

LGTM=r
R=r, nightlyone
CC=bradfitz, couchmoney, golang-codereviews, raph
https://golang.org/cl/109050045

10 years agotag go1.3
Andrew Gerrand [Thu, 19 Jun 2014 01:21:35 +0000 (11:21 +1000)]
tag go1.3

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

10 years agodoc: document Go 1.3
Andrew Gerrand [Thu, 19 Jun 2014 00:26:57 +0000 (10:26 +1000)]
doc: document Go 1.3

This is a clone of 101370043, which I accidentally applied to the
release branch first.
No big deal, it needed to be applied there anyway.

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

10 years agoimage: add RGBAAt, Gray16At, etc.
ChaiShushan [Thu, 19 Jun 2014 00:15:04 +0000 (10:15 +1000)]
image: add RGBAAt, Gray16At, etc.

Fixes #7694.

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

10 years agoencoding/base64, encoding/base32: make Encode faster
Rui Ueyama [Wed, 18 Jun 2014 19:05:46 +0000 (12:05 -0700)]
encoding/base64, encoding/base32: make Encode faster

Storing temporary values to a slice is slower than storing
them to local variables of type byte.

benchmark                         old MB/s     new MB/s  speedup
BenchmarkEncodeToStringBase32       102.21       156.66    1.53x
BenchmarkEncodeToStringBase64       124.25       177.91    1.43x

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

10 years agotesting: fix timing format inconsistency
Robert Dinu [Wed, 18 Jun 2014 17:59:25 +0000 (10:59 -0700)]
testing: fix timing format inconsistency

Fixes #8175.

LGTM=r
R=golang-codereviews, r, gobot
CC=golang-codereviews
https://golang.org/cl/103320043

10 years agofmt: include ±Inf and NaN in the complex format test
Rob Pike [Wed, 18 Jun 2014 17:57:18 +0000 (10:57 -0700)]
fmt: include ±Inf and NaN in the complex format test
Just to be more thorough.
No need to push this to 1.3; it's just a test change that
worked without any changes to the code being tested.

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

10 years agogo/build: update doc.go for go1.3 build tag.
David Symonds [Wed, 18 Jun 2014 15:47:05 +0000 (08:47 -0700)]
go/build: update doc.go for go1.3 build tag.

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

10 years agostrings: add fast path to Replace
Rui Ueyama [Wed, 18 Jun 2014 05:08:46 +0000 (22:08 -0700)]
strings: add fast path to Replace

genericReplacer.lookup is called for each byte of an input
string. In many (most?) cases, lookup will fail for the first
byte, and it will return immediately. Adding a fast path for
that case seems worth it.

Benchmark on my Xeon 3.5GHz Linux box:

benchmark                        old ns/op    new ns/op    delta
BenchmarkGenericNoMatch               2691          774  -71.24%
BenchmarkGenericMatch1                7920         8151   +2.92%
BenchmarkGenericMatch2               52336        39927  -23.71%
BenchmarkSingleMaxSkipping            1575         1575   +0.00%
BenchmarkSingleLongSuffixFail         1429         1429   +0.00%
BenchmarkSingleMatch                 56228        55444   -1.39%
BenchmarkByteByteNoMatch               568          568   +0.00%
BenchmarkByteByteMatch                 977          972   -0.51%
BenchmarkByteStringMatch              1669         1687   +1.08%
BenchmarkHTMLEscapeNew                 422          422   +0.00%
BenchmarkHTMLEscapeOld                 692          670   -3.18%
BenchmarkByteByteReplaces             8492         8474   -0.21%
BenchmarkByteByteMap                  2817         2808   -0.32%

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

10 years agoruntime: fix gogetcallerpc.
Keith Randall [Wed, 18 Jun 2014 04:59:50 +0000 (21:59 -0700)]
runtime: fix gogetcallerpc.

Make assembly govet-clean.
Clean up fixes for CL 93380044.

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

10 years agofmt: fix signs when zero padding.
Rob Pike [Tue, 17 Jun 2014 21:56:54 +0000 (14:56 -0700)]
fmt: fix signs when zero padding.
Bug was introduced recently. Add more tests, fix the bugs.
Suppress + sign when not required in zero padding.
Do not zero pad infinities.
All old tests still pass.
This time for sure!
Fixes #8217.

LGTM=rsc
R=golang-codereviews, dan.kortschak, rsc
CC=golang-codereviews
https://golang.org/cl/103480043

10 years agomisc/emacs: add new function godoc-at-point
Dominik Honnef [Tue, 17 Jun 2014 19:52:29 +0000 (15:52 -0400)]
misc/emacs: add new function godoc-at-point

LGTM=adonovan
R=adonovan, ruiu
CC=golang-codereviews
https://golang.org/cl/107160048

10 years agomisc/emacs: replace hacky go--delete-whole-line with own implementation
Dominik Honnef [Tue, 17 Jun 2014 18:43:35 +0000 (14:43 -0400)]
misc/emacs: replace hacky go--delete-whole-line with own implementation

Using flet to replace kill-region with delete-region was a hack,
flet is now (GNU Emacs 24.3) deprecated and at least two people
have reported an issue where using go--delete-whole-line would
permanently break their kill ring. While that issue is probably
caused by faulty third party code (possibly prelude), it's easier
to write a clean implementation than to tweak the hack.

LGTM=ruiu, adonovan
R=adonovan, ruiu
CC=adg, golang-codereviews
https://golang.org/cl/106010043

10 years agotext/scanner: fix comment
Robert Griesemer [Tue, 17 Jun 2014 16:34:11 +0000 (09:34 -0700)]
text/scanner: fix comment

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

10 years agoruntime: fix stringw test.
Keith Randall [Tue, 17 Jun 2014 16:17:33 +0000 (09:17 -0700)]
runtime: fix stringw test.

Null terminate string.  Make it endian-agnostic.

TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/106060044

10 years agotest: speed up chan/select5
Josh Bleecher Snyder [Tue, 17 Jun 2014 16:07:18 +0000 (09:07 -0700)]
test: speed up chan/select5

No functional changes.

Generating shorter functions improves compilation time. On my laptop, this test's running time goes from 5.5s to 1.5s; the wall clock time to run all tests goes down 1s. On Raspberry Pi, this CL cuts 50s off the wall clock time to run all tests.

Fixes #7503.

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

10 years agogo/parser: don't accept trailing explicit semicolon
Robert Griesemer [Tue, 17 Jun 2014 15:58:08 +0000 (08:58 -0700)]
go/parser: don't accept trailing explicit semicolon

Fixes #8207.

LGTM=gordon.klaus, bradfitz
R=golang-codereviews, wandakkelly, gordon.klaus, bradfitz
CC=golang-codereviews
https://golang.org/cl/106010046

10 years agoundo CL 105260044 / afd6f214cc81
Keith Randall [Tue, 17 Jun 2014 15:10:21 +0000 (08:10 -0700)]
undo CL 105260044 / afd6f214cc81

The go:nosplit change wasn't the problem, reinstating.

««« original CL description
undo CL 93380044 / 7f0999348917

Partial undo, just of go:nosplit annotation.  Somehow it
is breaking the windows builders.

TBR=bradfitz

««« original CL description
runtime: implement string ops in Go

Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/93380044
»»»

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/105260044
»»»

TBR=bradfitz
R=bradfitz, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/103490043

10 years agoruntime: disable funky wide string test for now.
Keith Randall [Tue, 17 Jun 2014 07:45:39 +0000 (00:45 -0700)]
runtime: disable funky wide string test for now.

TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/105280045

10 years agoruntime: reconstitute runetochar for use by gostringw.
Keith Randall [Tue, 17 Jun 2014 07:36:23 +0000 (00:36 -0700)]
runtime: reconstitute runetochar for use by gostringw.

Fixes windows builds (hopefully).

LGTM=bradfitz
R=golang-codereviews, bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/103470045

10 years agoundo CL 93380044 / 7f0999348917
Keith Randall [Tue, 17 Jun 2014 06:51:18 +0000 (23:51 -0700)]
undo CL 93380044 / 7f0999348917

Partial undo, just of go:nosplit annotation.  Somehow it
is breaking the windows builders.

TBR=bradfitz

««« original CL description
runtime: implement string ops in Go

Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/93380044
»»»

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/105260044

10 years agocmd/5c, cmd/6c, cmd/8c, cmd/cc: remove unused global variable retok.
Shenghou Ma [Tue, 17 Jun 2014 06:05:27 +0000 (02:05 -0400)]
cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove unused global variable retok.

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

10 years agoruntime: implement string ops in Go
Keith Randall [Tue, 17 Jun 2014 06:03:03 +0000 (23:03 -0700)]
runtime: implement string ops in Go

Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

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

10 years agoruntime: implement eqstring in assembly.
Keith Randall [Tue, 17 Jun 2014 04:00:37 +0000 (21:00 -0700)]
runtime: implement eqstring in assembly.

BenchmarkCompareStringEqual               10.4          7.33          -29.52%
BenchmarkCompareStringIdentical           3.99          3.67          -8.02%
BenchmarkCompareStringSameLength          9.80          6.84          -30.20%
BenchmarkCompareStringDifferentLength     1.09          0.95          -12.84%
BenchmarkCompareStringBigUnaligned        75220         76071         +1.13%
BenchmarkCompareStringBig                 69843         74746         +7.02%

LGTM=bradfitz, josharian
R=golang-codereviews, bradfitz, josharian, dave, khr
CC=golang-codereviews
https://golang.org/cl/105280044

10 years agonet: avoid array copy when shuffling SRV records
Rui Ueyama [Tue, 17 Jun 2014 01:00:28 +0000 (18:00 -0700)]
net: avoid array copy when shuffling SRV records

We don't need to shift array elements to shuffle them.
We just have to swap a selected element with 0th element.

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

10 years agotext/scanner: provide facility for custom identifiers
Robert Griesemer [Mon, 16 Jun 2014 23:32:47 +0000 (16:32 -0700)]
text/scanner: provide facility for custom identifiers

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

10 years agobufio: handle excessive white space in ScanWords
Matthew Dempsky [Mon, 16 Jun 2014 19:59:10 +0000 (12:59 -0700)]
bufio: handle excessive white space in ScanWords

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

10 years agofmt: don't put 0x on every byte of a compact hex-encoded string
Rob Pike [Mon, 16 Jun 2014 17:45:05 +0000 (10:45 -0700)]
fmt: don't put 0x on every byte of a compact hex-encoded string
Printf("%x", "abc") was "0x610x620x63"; is now "0x616263", which
is surely better.
Printf("% #x", "abc") is still "0x61 0x62 0x63".

Fixes #8080.

LGTM=bradfitz, gri
R=golang-codereviews, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/106990043

10 years agoos: disable TestGetppid on plan9
Alex Brainman [Sat, 14 Jun 2014 06:47:40 +0000 (16:47 +1000)]
os: disable TestGetppid on plan9

Fixes build.

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

10 years agosyscall: implement syscall.Getppid() on Windows
Alan Shreve [Sat, 14 Jun 2014 05:51:00 +0000 (15:51 +1000)]
syscall: implement syscall.Getppid() on Windows

Also added a test to verify os.Getppid() works across all platforms

LGTM=alex.brainman
R=golang-codereviews, alex.brainman, shreveal, iant
CC=golang-codereviews
https://golang.org/cl/102320044

10 years agoA+C: Alan Shreve (individual CLA)
Ian Lance Taylor [Sat, 14 Jun 2014 04:09:23 +0000 (21:09 -0700)]
A+C: Alan Shreve (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/102410044

10 years agoruntime: fix VDSO lookup to use dynamic hash table
Ian Lance Taylor [Fri, 13 Jun 2014 20:29:26 +0000 (13:29 -0700)]
runtime: fix VDSO lookup to use dynamic hash table

Reportedly in the Linux 3.16 kernel the VDSO will not have
section headers or a normal symbol table.

Too late for 1.3 but perhaps for 1.3.1, if there is one.

Fixes #8197.

LGTM=rsc
R=golang-codereviews, mattn.jp, rsc
CC=golang-codereviews
https://golang.org/cl/101260044

10 years agocompress/lzw: add commentary that TIFF's LZW differs from the standard
Nigel Tao [Fri, 13 Jun 2014 07:44:29 +0000 (17:44 +1000)]
compress/lzw: add commentary that TIFF's LZW differs from the standard
algorithm.

See https://golang.org/cl/105750045/ for an implementation of
TIFF's LZW.

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

10 years agoimage/png: fix compare-to-golden-file test.
Nigel Tao [Fri, 13 Jun 2014 07:43:02 +0000 (17:43 +1000)]
image/png: fix compare-to-golden-file test.

bufio.Scanner.Scan returns whether the scan succeeded, not whether it
is done, so the test was mistakenly breaking early.

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

10 years agodoc: link to new downloads page
Andrew Gerrand [Fri, 13 Jun 2014 06:34:52 +0000 (16:34 +1000)]
doc: link to new downloads page

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

10 years agoundo CL 101970047 / 30307cc8bef2
Russ Cox [Fri, 13 Jun 2014 06:04:03 +0000 (02:04 -0400)]
undo CL 101970047 / 30307cc8bef2

makes windows-amd64-race benchmarks slower

««« original CL description
testing: make benchmarking faster

Allow the number of benchmark iterations to grow faster for fast benchmarks, and don't round up twice.

Using the default benchtime, this CL reduces wall clock time to run benchmarks:

net/http        49s   -> 37s   (-24%)
runtime         8m31s -> 5m55s (-30%)
bytes           2m37s -> 1m29s (-43%)
encoding/json   29s   -> 21s   (-27%)
strings         1m16s -> 53s   (-30%)

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/101970047
»»»

TBR=josharian
CC=golang-codereviews
https://golang.org/cl/105950044

10 years agotag go1.3rc2
Andrew Gerrand [Fri, 13 Jun 2014 03:30:54 +0000 (13:30 +1000)]
tag go1.3rc2

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

10 years agoruntime: revise CL 105140044 (defer nil) to work on Windows
Russ Cox [Fri, 13 Jun 2014 01:12:53 +0000 (21:12 -0400)]
runtime: revise CL 105140044 (defer nil) to work on Windows

It appears that something about Go on Windows
cannot handle the fault cause by a jump to address 0.
The way Go represents and calls functions, this
never happened at all, until CL 105140044.

This CL changes the code added in CL 105140044
to make jump to 0 impossible once again.

Fixes #8047. (again, on Windows)

TBR=bradfitz
R=golang-codereviews, dave
CC=adg, golang-codereviews, iant, r
https://golang.org/cl/105120044

10 years agotime: micro symbol for microseconds
Rob Pike [Fri, 13 Jun 2014 00:19:33 +0000 (17:19 -0700)]
time: micro symbol for microseconds

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

10 years agolib/codereview: fix doc/go1.*.txt exception
Russ Cox [Fri, 13 Jun 2014 00:12:50 +0000 (20:12 -0400)]
lib/codereview: fix doc/go1.*.txt exception

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