1
0
mirror of https://github.com/golang/go synced 2024-10-01 18:38:34 -06:00
Commit Graph

32265 Commits

Author SHA1 Message Date
Michael Munday
fc2d9cdf50 cmd/compile: remove underscore from variable names in constant comparison test
The leading underscores aren't necessary.

Change-Id: I1d4c4b681e2a29ef40a0a6cf705c3b17a49c9f65
Reviewed-on: https://go-review.googlesource.com/40873
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 18:30:01 +00:00
Mostyn Bramley-Moore
273f449783 cmd/go/internal/work: clean up after TestRespectGroupSticky
Use our own tempdir, to avoid having to Init (and somehow teardown)
Builder.  This way we don't leave behind any temp files.

Also, don't create a hardcoded path inside a testcase.

Followup to golang/go#18878.
Fixes golang/go#19449.

Change-Id: Ieb1ebeab24ae8a74a6fa058d9c23f72b3fc1c444
Reviewed-on: https://go-review.googlesource.com/40912
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-17 18:05:22 +00:00
Michael Munday
eed6938cbb cmd/asm, cmd/internal/obj/s390x, math: add LGDR and LDGR instructions
The instructions allow moves between floating point and general
purpose registers without any conversion taking place.

Change-Id: I82c6f3ad9c841a83783b5be80dcf5cd538ff49e6
Reviewed-on: https://go-review.googlesource.com/38777
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-04-17 16:33:51 +00:00
Josh Bleecher Snyder
58908114a8 cmd/go: don't generate DWARF in the compiler for plan9
Follow-up to CL 40859.

Change-Id: I785b8b28f179a8f2fcd42b0a97ffcd41de4b21bc
Reviewed-on: https://go-review.googlesource.com/40865
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 03:39:47 +00:00
Josh Bleecher Snyder
6bfd65631f cmd/go: disable compiler DWARF generation on some platforms
The linker disables DWARF for these platforms.
Given that, we can spare the compiler some work.

Change-Id: Ic5a6b675150aca199bdc1dd2cdf5eeb4e215bdff
Reviewed-on: https://go-review.googlesource.com/40859
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 03:18:22 +00:00
Josh Bleecher Snyder
87065a3c13 cmd/go: don't generate DWARF in the compiler if the linker will discard it
Change-Id: I7610f968f5c22b51a6a8813d6f31ccb772a12ba9
Reviewed-on: https://go-review.googlesource.com/40858
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 03:16:36 +00:00
Josh Bleecher Snyder
da67c23fbb cmd/compile: add flag to disable DWARF generation
DWARF generation has non-trivial cost,
and in some cases is not necessary.
Provide an option to opt out.

Alloc impact of disabling DWARF generation:

name       old alloc/op      new alloc/op      delta
Template        38.7MB ± 0%       37.6MB ± 0%  -2.77%  (p=0.016 n=5+4)
Unicode         29.8MB ± 0%       29.8MB ± 0%  -0.16%  (p=0.032 n=5+5)
GoTypes          113MB ± 0%        110MB ± 0%  -2.38%  (p=0.008 n=5+5)
Compiler         463MB ± 0%        457MB ± 0%  -1.34%  (p=0.008 n=5+5)
SSA             1.25GB ± 0%       1.23GB ± 0%  -1.64%  (p=0.008 n=5+5)
Flate           25.3MB ± 0%       25.0MB ± 0%  -1.05%  (p=0.008 n=5+5)
GoParser        31.7MB ± 0%       30.9MB ± 0%  -2.74%  (p=0.008 n=5+5)
Reflect         78.2MB ± 0%       76.7MB ± 0%  -1.90%  (p=0.008 n=5+5)
Tar             26.5MB ± 0%       26.0MB ± 0%  -2.04%  (p=0.008 n=5+5)
XML             42.4MB ± 0%       41.1MB ± 0%  -2.86%  (p=0.008 n=5+5)

name       old allocs/op     new allocs/op     delta
Template          377k ± 0%         360k ± 1%  -4.46%  (p=0.008 n=5+5)
Unicode           321k ± 0%         320k ± 0%    ~     (p=0.151 n=5+5)
GoTypes          1.14M ± 0%        1.10M ± 0%  -4.13%  (p=0.008 n=5+5)
Compiler         4.26M ± 0%        4.13M ± 0%  -3.14%  (p=0.008 n=5+5)
SSA              9.70M ± 0%        9.33M ± 0%  -3.89%  (p=0.008 n=5+5)
Flate             233k ± 0%         228k ± 0%  -2.40%  (p=0.008 n=5+5)
GoParser          316k ± 0%         302k ± 0%  -4.48%  (p=0.008 n=5+5)
Reflect           980k ± 0%         945k ± 0%  -3.62%  (p=0.008 n=5+5)
Tar               249k ± 0%         241k ± 0%  -3.19%  (p=0.008 n=5+5)
XML               391k ± 0%         376k ± 0%  -3.95%  (p=0.008 n=5+5)

Change-Id: I97dbfb6b40195d1e0b91be097a4bf0e7f65b26af
Reviewed-on: https://go-review.googlesource.com/40857
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 03:16:28 +00:00
Josh Bleecher Snyder
89a355c930 cmd/internal/obj: unify Setuintxx and WriteInt
They do basically the same work.

Setuintxx was only used in a single place,
so eliminate it in favor of WriteInt.

duintxxLSym's alignment rounding was not used in practice;
change it into alignment assertion.

Passes toolstash-check. No compiler performance changes.

Change-Id: I0f7410cf2ccffbdc02ad796eaf973ee6a83074f8
Reviewed-on: https://go-review.googlesource.com/40863
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-17 03:15:02 +00:00
Josh Bleecher Snyder
bb215de8a6 cmd/internal/obj: pretty-print LSym.Type when debugging
We have a stringer for LSym.Type. Use it.

Before:

	"".algarray t=31 size=224

After:

	"".algarray SBSS size=224

Change-Id: Ib4c7d2bc1dbe9943cf2a5dfa5d9f2d7fbd50b7f2
Reviewed-on: https://go-review.googlesource.com/40862
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 03:12:49 +00:00
Josh Bleecher Snyder
3d0a898385 cmd/compile: improve output when TestAssembly build fails
Change-Id: Ibee84399d81463d3e7d5319626bb0d6b60b86bd9
Reviewed-on: https://go-review.googlesource.com/40861
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-17 03:12:34 +00:00
Takuto Ikuta
a306a851cc regexp: Use []bool instead of map[uint32]bool in makeOnePass
Variable m is accessed like variable onePassRunes.
So, we can use array instead of map for variable m.

Onepass compile performance is improved 10~20%.

name                                      old time/op    new time/op    delta
CompileOnepass/^(?:(?:(?:.(?:$))?))...-4    4.60µs ± 1%    4.10µs ± 1%  -10.98%  (p=0.008 n=5+5)
CompileOnepass/^abcd$-4                     3.76µs ± 2%    3.33µs ± 1%  -11.43%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a{0,})*?)$-4          4.47µs ± 1%    4.14µs ± 1%   -7.49%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a+)*)$-4              4.07µs ± 1%    3.81µs ± 2%   -6.60%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a|(?:aa)))$-4         5.21µs ± 1%    4.80µs ± 2%   -7.90%  (p=0.008 n=5+5)
CompileOnepass/^(?:[^\s\S])$-4              3.26µs ± 1%    3.06µs ± 1%   -6.15%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:(?:a*)+))$-4          4.33µs ± 0%    4.04µs ± 3%   -6.78%  (p=0.008 n=5+5)
CompileOnepass/^[a-c]+$-4                   3.33µs ± 1%    3.06µs ± 4%   -8.24%  (p=0.008 n=5+5)
CompileOnepass/^[a-c]*$-4                   3.69µs ± 1%    3.39µs ± 4%   -8.26%  (p=0.008 n=5+5)
CompileOnepass/^(?:a*)$-4                   3.78µs ± 2%    3.36µs ± 0%  -11.09%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:aa)|a)$-4             5.11µs ± 1%    4.60µs ± 1%   -9.85%  (p=0.008 n=5+5)
CompileOnepass/^...$-4                      3.51µs ± 1%    3.25µs ± 1%   -7.37%  (p=0.008 n=5+5)
CompileOnepass/^(?:a|(?:aa))$-4             5.05µs ± 1%    4.59µs ± 1%   -9.13%  (p=0.008 n=5+5)
CompileOnepass/^a((b))c$-4                  5.24µs ± 1%    4.66µs ± 1%  -11.16%  (p=0.008 n=5+5)
CompileOnepass/^a.[l-nA-Cg-j]?e$-4          5.94µs ± 7%    5.02µs ± 1%  -15.62%  (p=0.008 n=5+5)
CompileOnepass/^a((b))$-4                   5.34µs ± 7%    4.21µs ± 2%  -21.05%  (p=0.008 n=5+5)
CompileOnepass/^a(?:(b)|(c))c$-4            7.25µs ± 7%    5.86µs ± 1%  -19.17%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b|c)$-4                 4.13µs ± 9%    3.35µs ± 1%  -18.99%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b?|c)$-4                6.48µs ± 4%    5.05µs ± 1%  -22.16%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b?|c+)$-4               7.05µs ± 7%    5.48µs ± 1%  -22.21%  (p=0.008 n=5+5)
CompileOnepass/^a(?:bc)+$-4                 4.71µs ± 4%    3.85µs ± 0%  -18.14%  (p=0.008 n=5+5)
CompileOnepass/^a(?:[bcd])+$-4              4.10µs ± 2%    3.69µs ± 1%   -9.98%  (p=0.008 n=5+5)
CompileOnepass/^a((?:[bcd])+)$-4            5.20µs ± 1%    4.59µs ± 0%  -11.72%  (p=0.008 n=5+5)
CompileOnepass/^a(:?b|c)*d$-4               9.29µs ± 2%    8.23µs ± 1%  -11.43%  (p=0.008 n=5+5)
CompileOnepass/^.bc(d|e)*$-4                6.33µs ± 3%    5.51µs ± 5%  -12.95%  (p=0.008 n=5+5)
CompileOnepass/^loooooooooooooooooo...-4     162µs ± 0%     138µs ± 2%  -14.70%  (p=0.008 n=5+5)

name                                      old alloc/op   new alloc/op   delta
CompileOnepass/^(?:(?:(?:.(?:$))?))...-4    3.38kB ± 0%    3.27kB ± 0%   -3.08%  (p=0.008 n=5+5)
CompileOnepass/^abcd$-4                     2.74kB ± 0%    2.59kB ± 0%   -5.54%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a{0,})*?)$-4          3.34kB ± 0%    3.23kB ± 0%   -3.12%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a+)*)$-4              2.95kB ± 0%    2.85kB ± 0%   -3.52%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a|(?:aa)))$-4         3.74kB ± 0%    3.58kB ± 0%   -4.07%  (p=0.008 n=5+5)
CompileOnepass/^(?:[^\s\S])$-4              2.45kB ± 0%    2.35kB ± 0%   -4.20%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:(?:a*)+))$-4          3.13kB ± 0%    3.02kB ± 0%   -3.32%  (p=0.008 n=5+5)
CompileOnepass/^[a-c]+$-4                   2.48kB ± 0%    2.38kB ± 0%   -4.19%  (p=0.008 n=5+5)
CompileOnepass/^[a-c]*$-4                   2.52kB ± 0%    2.42kB ± 0%   -4.13%  (p=0.008 n=5+5)
CompileOnepass/^(?:a*)$-4                   2.63kB ± 0%    2.53kB ± 0%   -3.95%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:aa)|a)$-4             3.62kB ± 0%    3.47kB ± 0%   -4.19%  (p=0.008 n=5+5)
CompileOnepass/^...$-4                      2.87kB ± 0%    2.78kB ± 0%   -3.34%  (p=0.008 n=5+5)
CompileOnepass/^(?:a|(?:aa))$-4             3.62kB ± 0%    3.47kB ± 0%   -4.19%  (p=0.008 n=5+5)
CompileOnepass/^a((b))c$-4                  4.38kB ± 0%    4.23kB ± 0%   -3.33%  (p=0.008 n=5+5)
CompileOnepass/^a.[l-nA-Cg-j]?e$-4          4.30kB ± 0%    4.15kB ± 0%   -3.35%  (p=0.008 n=5+5)
CompileOnepass/^a((b))$-4                   4.05kB ± 0%    3.90kB ± 0%   -3.56%  (p=0.008 n=5+5)
CompileOnepass/^a(?:(b)|(c))c$-4            5.30kB ± 0%    5.05kB ± 0%   -4.83%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b|c)$-4                 2.87kB ± 0%    2.77kB ± 0%   -3.62%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b?|c)$-4                4.35kB ± 0%    4.21kB ± 0%   -3.31%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b?|c+)$-4               4.58kB ± 0%    4.44kB ± 0%   -3.14%  (p=0.008 n=5+5)
CompileOnepass/^a(?:bc)+$-4                 3.15kB ± 0%    3.00kB ± 0%   -4.82%  (p=0.008 n=5+5)
CompileOnepass/^a(?:[bcd])+$-4              2.94kB ± 0%    2.84kB ± 0%   -3.53%  (p=0.008 n=5+5)
CompileOnepass/^a((?:[bcd])+)$-4            4.08kB ± 0%    3.94kB ± 0%   -3.53%  (p=0.008 n=5+5)
CompileOnepass/^a(:?b|c)*d$-4               6.10kB ± 0%    5.85kB ± 0%   -4.19%  (p=0.008 n=5+5)
CompileOnepass/^.bc(d|e)*$-4                4.46kB ± 0%    4.31kB ± 0%   -3.28%  (p=0.008 n=5+5)
CompileOnepass/^loooooooooooooooooo...-4     135kB ± 0%     127kB ± 0%   -5.88%  (p=0.008 n=5+5)

name                                      old allocs/op  new allocs/op  delta
CompileOnepass/^(?:(?:(?:.(?:$))?))...-4      47.0 ± 0%      46.0 ± 0%   -2.13%  (p=0.008 n=5+5)
CompileOnepass/^abcd$-4                       41.0 ± 0%      40.0 ± 0%   -2.44%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a{0,})*?)$-4            49.0 ± 0%      48.0 ± 0%   -2.04%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a+)*)$-4                44.0 ± 0%      43.0 ± 0%   -2.27%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:a|(?:aa)))$-4           54.0 ± 0%      53.0 ± 0%   -1.85%  (p=0.008 n=5+5)
CompileOnepass/^(?:[^\s\S])$-4                33.0 ± 0%      32.0 ± 0%   -3.03%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:(?:a*)+))$-4            46.0 ± 0%      45.0 ± 0%   -2.17%  (p=0.008 n=5+5)
CompileOnepass/^[a-c]+$-4                     36.0 ± 0%      35.0 ± 0%   -2.78%  (p=0.008 n=5+5)
CompileOnepass/^[a-c]*$-4                     41.0 ± 0%      40.0 ± 0%   -2.44%  (p=0.008 n=5+5)
CompileOnepass/^(?:a*)$-4                     42.0 ± 0%      41.0 ± 0%   -2.38%  (p=0.008 n=5+5)
CompileOnepass/^(?:(?:aa)|a)$-4               53.0 ± 0%      52.0 ± 0%   -1.89%  (p=0.008 n=5+5)
CompileOnepass/^...$-4                        39.0 ± 0%      38.0 ± 0%   -2.56%  (p=0.008 n=5+5)
CompileOnepass/^(?:a|(?:aa))$-4               53.0 ± 0%      52.0 ± 0%   -1.89%  (p=0.008 n=5+5)
CompileOnepass/^a((b))c$-4                    53.0 ± 0%      52.0 ± 0%   -1.89%  (p=0.008 n=5+5)
CompileOnepass/^a.[l-nA-Cg-j]?e$-4            56.0 ± 0%      55.0 ± 0%   -1.79%  (p=0.008 n=5+5)
CompileOnepass/^a((b))$-4                     47.0 ± 0%      46.0 ± 0%   -2.13%  (p=0.008 n=5+5)
CompileOnepass/^a(?:(b)|(c))c$-4              65.0 ± 0%      64.0 ± 0%   -1.54%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b|c)$-4                   40.0 ± 0%      39.0 ± 0%   -2.50%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b?|c)$-4                  57.0 ± 0%      56.0 ± 0%   -1.75%  (p=0.008 n=5+5)
CompileOnepass/^a(?:b?|c+)$-4                 63.0 ± 0%      62.0 ± 0%   -1.59%  (p=0.008 n=5+5)
CompileOnepass/^a(?:bc)+$-4                   46.0 ± 0%      45.0 ± 0%   -2.17%  (p=0.008 n=5+5)
CompileOnepass/^a(?:[bcd])+$-4                43.0 ± 0%      42.0 ± 0%   -2.33%  (p=0.008 n=5+5)
CompileOnepass/^a((?:[bcd])+)$-4              49.0 ± 0%      48.0 ± 0%   -2.04%  (p=0.008 n=5+5)
CompileOnepass/^a(:?b|c)*d$-4                  101 ± 0%       100 ± 0%   -0.99%  (p=0.008 n=5+5)
CompileOnepass/^.bc(d|e)*$-4                  60.0 ± 0%      59.0 ± 0%   -1.67%  (p=0.008 n=5+5)
CompileOnepass/^loooooooooooooooooo...-4     1.09k ± 0%     1.08k ± 0%   -0.74%  (p=0.008 n=5+5)

Fixes #19984

Change-Id: I2268b28d068926a057c62751528de15b6de61a7b
Reviewed-on: https://go-review.googlesource.com/40890
Reviewed-by: Ralph Corderoy <ralph@inputplus.co.uk>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-16 15:24:48 +00:00
Andreas Auernhammer
d71863adbf vendor: update golang_org/x/net/route package
Update the route package to git rev 6b27048a.

Introduce the following changes:
 - 6b27048 route: drop support for go1.5
 - b7fd658 route: fix typo
 - 41bba8d route: add support for the manipulation of routing informaion

Updates #19967

Change-Id: Id2bb93df97a45254a2df2b048db0143e3e52bbdf
Reviewed-on: https://go-review.googlesource.com/40830
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-16 15:24:12 +00:00
Josh Bleecher Snyder
0e4824aacc cmd/compile: remove flag_largemodel
It was added in 2013 in CL 7064048.
All uses of it in the compiler disappeared with
(or possibly before) the SSA backend.
Several releases have gone by without it,
from which I conclude that it is now not needed.

Change-Id: I2095f4ac05d4d7ab998168993a7fd5d954aeee88
Reviewed-on: https://go-review.googlesource.com/40856
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-16 14:53:20 +00:00
Andreas Auernhammer
3f2b2dea9f vendor: update golang_org/x/net/http2 packages
Update the http2/hpack package to rev 05d3205.

Introduce the following changes:
 - 05d3205 http2/hpack: fix memory leak in headerFieldTable lookup maps
 - bce15e7 http2/hpack: speedup Encoder.searchTable
 - dd2d9a6 http2/hpack: remove hpack's constant time string comparison
 - 357296a all: single space after period
 - 71a0359 x/net/http2: Fix various typos in doc comments.

Updates #19967

Change-Id: Ie2c8edcaaf96abde515cb995dfa503b54776abfe
Reviewed-on: https://go-review.googlesource.com/40833
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-15 23:36:55 +00:00
Andreas Auernhammer
157a230413 vendor: update golang_org/x/net/lif package
Update the lif package to rev 7bf7a75.

Introduce the following changes:
 - 7bf7a75 lif: use of nativeEndian to make API endian agnostic
 - adc6ba9 lif: drop support for go1.5

Updates #19967

Change-Id: Iaba893b5ee9af4c54bf5ba4244ce5752ce9f6ad3
Reviewed-on: https://go-review.googlesource.com/40831
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-15 23:36:42 +00:00
Damien Lespiau
619e37bdcc cmd/compile: Budget for inlining is now 80 nodes, not 40
This comment was out of date since the bump to 80 done as the same time
as inlining transitive functions in:

  commit 77ccb16eb1
  Author: Russ Cox <rsc@golang.org>
  Date:   Tue Feb 24 12:19:01 2015 -0500

      cmd/internal/gc: transitive inlining

Adjust the comment at the top of the file accordingly.

Change-Id: Ia6d7397c874e3b85396e82dc9678e56aab9ad728
Reviewed-on: https://go-review.googlesource.com/40910
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-15 23:21:22 +00:00
Mikio Hara
6694a6888b net: delay IP protocol stack-snooping system calls
This change delays IP protocol stack-snooping system calls until the
start of connection setup for the better experience with some system
call auditing, such as seccomp on Linux. See #16789 for examples.

Also updates the documentation on favoriteAddrFamily, which is the
owner of stack-snooping system calls.

Fixes #16789.

Change-Id: I4af27bc1ed06ffb1f657b6f6381c328c1f41c66c
Reviewed-on: https://go-review.googlesource.com/40750
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-15 22:22:09 +00:00
Caleb Spare
bc29313722 testing: add TB.Helper to better support test helpers
This CL implements the proposal at
https://github.com/golang/proposal/blob/master/design/4899-testing-helper.md.

It's based on Josh's CL 79890043 from a few years ago:
https://codereview.appspot.com/79890043 but makes several changes,
most notably by using the new CallersFrames API so that it works with
mid-stack inlining.

Another detail came up while I was working on this: I didn't want the
user to be able to call t.Helper from inside their TestXxx function
directly (which would mean we'd print a file:line from inside the
testing package itself), so I explicitly prevented this from working.

Fixes #4899.

Change-Id: I37493edcfb63307f950442bbaf993d1589515310
Reviewed-on: https://go-review.googlesource.com/38796
Run-TryBot: Caleb Spare <cespare@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-14 16:47:25 +00:00
Alberto Donizetti
6266b0f08f cmd/compile: add test for Issue 12536
The fixedbugs/issue12536.go file was erroneously deleted just before
committing the patch that fixed the issue (CL 14400).

That's an easy test and there's a small reproducer in the issue, add
it back.

Updates #12536

Change-Id: Ib7b0cd245588299e9a5469e1d75805fd0261ce1a
Reviewed-on: https://go-review.googlesource.com/40712
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-14 14:16:09 +00:00
Andreas Auernhammer
3b6ecdf934 vendor: update golang_org/x/crypto packages
Update the poly1305 and curve25519 packages to the current state of /x/crypto.

Updates #19967

Change-Id: Ib71534f78040f31bfd5debb06f3c4a54a77955b3
Reviewed-on: https://go-review.googlesource.com/40711
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-14 13:39:57 +00:00
David Lazar
3249cb0ab4 runtime/trace: iterate over frames instead of PCs
Now the runtime/trace tests pass with -l=4.

This also gets rid of the frames cache for multiple reasons:

1) The frames cache was used to avoid repeated calls to funcname and
funcline. Now these calls happen inside the CallersFrames iterator.

2) Maintaining a frames cache is harder: map[uintptr]traceFrame
doesn't work since each PC can map to multiple traceFrames.

3) It's not clear that the cache is important.

Change-Id: I2914ac0b3ba08e39b60149d99a98f9f532b35bbb
Reviewed-on: https://go-review.googlesource.com/40591
Run-TryBot: David Lazar <lazard@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2017-04-14 12:21:21 +00:00
David Lazar
a7276742e6 runtime/trace: better output when test fails
Change-Id: I108d15eb4cd25904bb76de4ed7548c039c69d1a3
Reviewed-on: https://go-review.googlesource.com/40590
Run-TryBot: David Lazar <lazard@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2017-04-14 12:21:02 +00:00
Mikio Hara
7337181daf net: validate network in Dial{,IP} and Listen{Packet,IP} for IP networks
The argument of the first parameter for connection setup functions on
IP networks must contain a protocol name or number. This change adds
validation for arguments of IP networks to connection setup functions.

Fixes #18185.

Change-Id: I6aaedd7806e3ed1043d4b1c834024f350b99361d
Reviewed-on: https://go-review.googlesource.com/40512
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-14 08:44:45 +00:00
Mikio Hara
dc74f51c43 net: don't enclose non-literal IPv6 addresses in square brackets
The net package uses various textual representations for network
identifiers and locators on the Internet protocol suite as API.
In fact, the representations are the composition of subset of multple
RFCs: RFC 3986, RFC 4007, RFC 4632, RFC 4291 and RFC 5952.

RFC 4007 describes guidelines for the use of textual representation of
IPv6 addressing/routing scope zone and doesn't prohibit the format for
implementation dependent purposes, as in, specifying a literal IPv6
address and its connected region of routing topology as application
user interface. However, a non-literal IPv6 address, for example, a
host name, with a zone enclosed in square brackets confuses us because
a zone is basically for non-global IPv6 addresses and a pair of square
brackets is used as a set of delimiters between a literal IPv6 address
and a service name or transport port number.

To mitigate such confusion, this change makes JoinHostPort not enclose
non-literal IPv6 addresses in square brackets and SplitHostPort accept
the form "host%zone:port" to recommend that anything enclosed in
square brackets should be a literal IPv6 address.

Before this change:
	JoinHostPort("name%zone", "80") = "[name%zone]:80"
	JoinHostPort("[::1%zone]", "80") = "[::1%zone]:80"
	SplitHostPort("name%zone:80") = "", "", "address name%zone:80: missing brackets in address"
	SplitHostPort("[name%zone]:80") = "name%zone", "80", nil
	SplitHostPort("[::1%zone]:80") = "::1%zone", "80", nil

After this change:
	JoinHostPort("name%zone", "80") = "name%zone:80"
	JoinHostPort("[::1%zone]", "80") = "[::1%zone]:80"
	SplitHostPort("name%zone:80") = "name%zone", "80", nil
	SplitHostPort("[name%zone]:80") = "name%zone", "80", nil // for backwards compatibility
	SplitHostPort("[::1%zone]:80") = "::1%zone", "80", nil

Also updates docs and test cases on SplitHostPort and JoinHostPort for
clarification.

Fixes #18059.
Fixes #18060.

Change-Id: I5c3ccce4fa0fbdd58f698fc280635ea4a14d2a37
Reviewed-on: https://go-review.googlesource.com/40510
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-14 08:44:22 +00:00
Wei Xiao
1cf6d4748c cmd/dist: fix incorrect platform string shared by all tests
all tests currently share the same platform string and fail to
vet expected platforms

Fixes #19958

Change-Id: I2801e1e84958e31975769581e27ea5ca6a0edf5b
Reviewed-on: https://go-review.googlesource.com/40511
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-14 03:15:59 +00:00
Jess Frazelle
75176947d6 syscall: fix TestGroupCleanup{UserNamespace} on Alpine
This updates TestGroupCleanup and TestGroupCleanupUserNamespace to pass in the
Alpine builder.

Updates #19938

Change-Id: Iacbfd73782eccd57f872f9e85726c6024529c277
Reviewed-on: https://go-review.googlesource.com/40692
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-13 22:47:55 +00:00
Michael Munday
f75b5e99ed cmd/compile: fix s390x unsigned comparison constant merging rules
On s390x unsigned integer comparisons with immediates require the immediate
to be an unsigned 32-bit integer. The rule was checking that the immediate
was a signed 32-bit integer.

This CL also adds a test for comparisons that could be turned into compare
with immediate or equivalent instructions (depending on architecture and
optimizations applied).

Fixes #19940.

Change-Id: Ifd6aa989fd3d50e282f7d30fec9db462c28422b1
Reviewed-on: https://go-review.googlesource.com/40433
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-04-13 18:35:11 +00:00
Brad Fitzpatrick
dc09a7af2e test: disable flaky test/fixedbugs/issue10958.go
Updates #18589

Change-Id: I2c3bbc8257c68295051bd2e63e1e11794d0609c3
Reviewed-on: https://go-review.googlesource.com/40651
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-13 18:28:29 +00:00
Austin Clements
051809e352 runtime: free workbufs during sweeping
This extends the sweeper to free workbufs back to the heap between GC
cycles, allowing this memory to be reused for GC'd allocations or
eventually returned to the OS.

This helps for applications that have high peak heap usage relative to
their regular heap usage (for example, a high-memory initialization
phase). Workbuf memory is roughly proportional to heap size and since
we currently never free workbufs, it's proportional to *peak* heap
size. By freeing workbufs, we can release and reuse this memory for
other purposes when the heap shrinks.

This is somewhat complicated because this costs ~1–2 µs per workbuf
span, so for large heaps it's too expensive to just do synchronously
after mark termination between starting the world and dropping the
worldsema. Hence, we do it asynchronously in the sweeper. This adds a
list of "free" workbuf spans that can be returned to the heap. GC
moves all workbuf spans to this list after mark termination and the
background sweeper drains this list back to the heap. If the sweeper
doesn't finish, that's fine, since getempty can directly reuse any
remaining spans to allocate more workbufs.

Performance impact is negligible. On the x/benchmarks, this reduces
GC-bytes-from-system by 6–11%.

Fixes #19325.

Change-Id: Icb92da2196f0c39ee984faf92d52f29fd9ded7a8
Reviewed-on: https://go-review.googlesource.com/38582
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:47 +00:00
Austin Clements
9cc883a466 runtime: allocate GC workbufs from manually-managed spans
Currently the runtime allocates workbufs from persistent memory, which
means they can never be freed.

Switch to allocating them from manually-managed heap spans. This
doesn't free them yet, but it puts us in a position to do so.

For #19325.

Change-Id: I94b2512a2f2bbbb456cd9347761b9412e80d2da9
Reviewed-on: https://go-review.googlesource.com/38581
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:44 +00:00
Austin Clements
42c1214762 runtime: eliminate write barriers from alloc/mark bitmaps
This introduces a new type, *gcBits, to use for alloc/mark bitmap
allocations instead of *uint8. This type is marked go:notinheap, so
uses of it correctly eliminate write barriers. Since we now have a
type, this also extracts some common operations to methods both for
convenience and to avoid (*uint8) casts at most use sites.

For #19325.

Change-Id: Id51f734fb2e96b8b7715caa348c8dcd4aef0696a
Reviewed-on: https://go-review.googlesource.com/38580
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:42 +00:00
Austin Clements
9d1b2f888e runtime: rename gcBits -> gcBitsArena
This clarifies that the gcBits type is actually an arena of gcBits and
will let us introduce a new gcBits type representing a single
mark/alloc bitmap allocated from the arena.

For #19325.

Change-Id: Idedf76d202d9174a17c61bcca9d5539e042e2445
Reviewed-on: https://go-review.googlesource.com/38579
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:40 +00:00
Austin Clements
dc0f0ab70f runtime: don't count manually-managed spans from heap_{inuse,sys}
Currently, manually-managed spans are included in memstats.heap_inuse
and memstats.heap_sys, but when we export these stats to the user, we
subtract out how much has been allocated for stack spans from both.
This works for now because stacks are the only manually-managed spans
we have.

However, we're about to use manually-managed spans for more things
that don't necessarily have obvious stats we can use to adjust the
user-presented numbers. Prepare for this by changing the accounting so
manually-managed spans don't count toward heap_inuse or heap_sys. This
makes these fields align with the fields presented to the user and
means we don't have to track more statistics just so we can adjust
these statistics.

For #19325.

Change-Id: I5cb35527fd65587ff23339276ba2c3969e2ad98f
Reviewed-on: https://go-review.googlesource.com/38577
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:38 +00:00
Austin Clements
407c56ae9f runtime: generalize {alloc,free}Stack to {alloc,free}Manual
We're going to start using manually-managed spans for GC workbufs, so
rename the allocate/free methods and pass in a pointer to the stats to
use instead of using the stack stats directly.

For #19325.

Change-Id: I37df0147ae5a8e1f3cb37d59c8e57a1fcc6f2980
Reviewed-on: https://go-review.googlesource.com/38576
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:35 +00:00
Austin Clements
ab9db51e1c runtime: rename mspan.stackfreelist -> manualFreeList
We're going to use this free list for other types of manually-managed
memory in the heap.

For #19325.

Change-Id: Ib7e682295133eabfddf3a84f44db43d937bfdd9c
Reviewed-on: https://go-review.googlesource.com/38575
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:33 +00:00
Austin Clements
8fbaa4f70b runtime: rename _MSpanStack -> _MSpanManual
We're about to generalize _MSpanStack to be used for other forms of
in-heap manual memory management in the runtime. This is an automated
rename of _MSpanStack to _MSpanManual plus some comment fix-ups.

For #19325.

Change-Id: I1e20a57bb3b87a0d324382f92a3e294ffc767395
Reviewed-on: https://go-review.googlesource.com/38574
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-13 18:20:30 +00:00
Josh Bleecher Snyder
16df2ccded cmd/compile: emit string symbols during walk
This avoids needing a mutex to protect stringsym,
and preserves a consistent ctxt.Data ordering
in the face of a concurrent backend.

Updates #15756

Change-Id: I775daae11db5db1269533a00f5249e3a03086ffc
Reviewed-on: https://go-review.googlesource.com/40509
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-13 16:37:04 +00:00
Robert Griesemer
b0e5a0c93c spec: clarify size hint for make of maps
For #19903.

Change-Id: Ib28d08d45bfad653bcc1446f160b7b4a485529af
Reviewed-on: https://go-review.googlesource.com/40393
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-04-13 16:15:45 +00:00
Alberto Donizetti
55b56d2b2f cmd/compile: remove last c-isms from typecheck.go comments
Change-Id: I0b1ae9d296115000fb30aab39f9eac1200ae68d0
Reviewed-on: https://go-review.googlesource.com/40451
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-13 15:40:32 +00:00
Josh Bleecher Snyder
7b5f94e76c cmd/internal/obj: cache dwarfSym
Follow-up to review feedback from
mdempsky on CL 40507.

Reduces mutex contention by about 1%.

Change-Id: I540ea6772925f4a59e58f55a3458eff15880c328
Reviewed-on: https://go-review.googlesource.com/40575
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-13 15:18:54 +00:00
Josh Bleecher Snyder
adc80c0665 cmd/compile: refactor Linksym
Extract a helper function, linksymname.
This simplifies Linksym,
and linksymname will be useful in future work.

Change-Id: Ic5ff8b704a16d5020f6931e008e2f630f687cbd3
Reviewed-on: https://go-review.googlesource.com/40550
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-13 15:04:20 +00:00
Josh Bleecher Snyder
4e4e51c5c5 cmd/internal/obj: generate function DWARF symbols early
This removes a concurrent access of ctxt.Data.

Updates #15756

Change-Id: Id017e90e47e093cd8825907f3853bb3d3bf8280d
Reviewed-on: https://go-review.googlesource.com/40507
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-13 14:38:01 +00:00
Josh Bleecher Snyder
7fa3b79ce5 cmd/vet/all: print all unparseable lines
In my experience, this usually happens when vet panics.
Dumping all unparseable lines should help diagnosis.

Inspired by the trybot failures in CL 40511.

Change-Id: Ib73e8c8b2942832589c3cc5d33ef35fdafe9965a
Reviewed-on: https://go-review.googlesource.com/40508
Reviewed-by: Rob Pike <r@golang.org>
2017-04-13 14:05:34 +00:00
Wei Xiao
ab636b899c hash/crc32: optimize arm64 crc32 implementation
ARMv8 defines crc32 instruction.

Comparing to the original crc32 calculation, this patch makes use of
crc32 instructions to do crc32 calculation instead of the multiple
lookup table algorithms.

ARMv8 provides IEEE and Castagnoli polynomials for crc32 calculation
so that the perfomance of these two types of crc32 get significant
improved.

name                                        old time/op   new time/op    delta
CRC32/poly=IEEE/size=15/align=0-32            117ns ± 0%      38ns ± 0%   -67.44%
CRC32/poly=IEEE/size=15/align=1-32            117ns ± 0%      38ns ± 0%   -67.52%
CRC32/poly=IEEE/size=40/align=0-32            129ns ± 0%      41ns ± 0%   -68.37%
CRC32/poly=IEEE/size=40/align=1-32            129ns ± 0%      41ns ± 0%   -68.29%
CRC32/poly=IEEE/size=512/align=0-32           828ns ± 0%     246ns ± 0%   -70.29%
CRC32/poly=IEEE/size=512/align=1-32           828ns ± 0%     132ns ± 0%   -84.06%
CRC32/poly=IEEE/size=1kB/align=0-32          1.58µs ± 0%    0.46µs ± 0%   -70.98%
CRC32/poly=IEEE/size=1kB/align=1-32          1.58µs ± 0%    0.46µs ± 0%   -70.92%
CRC32/poly=IEEE/size=4kB/align=0-32          6.06µs ± 0%    1.74µs ± 0%   -71.27%
CRC32/poly=IEEE/size=4kB/align=1-32          6.10µs ± 0%    1.74µs ± 0%   -71.44%
CRC32/poly=IEEE/size=32kB/align=0-32         48.3µs ± 0%    13.7µs ± 0%   -71.61%
CRC32/poly=IEEE/size=32kB/align=1-32         48.3µs ± 0%    13.7µs ± 0%   -71.60%
CRC32/poly=Castagnoli/size=15/align=0-32      116ns ± 0%      38ns ± 0%   -67.07%
CRC32/poly=Castagnoli/size=15/align=1-32      116ns ± 0%      38ns ± 0%   -66.90%
CRC32/poly=Castagnoli/size=40/align=0-32      127ns ± 0%      40ns ± 0%   -68.11%
CRC32/poly=Castagnoli/size=40/align=1-32      127ns ± 0%      40ns ± 0%   -68.11%
CRC32/poly=Castagnoli/size=512/align=0-32     828ns ± 0%     132ns ± 0%   -84.06%
CRC32/poly=Castagnoli/size=512/align=1-32     827ns ± 0%     132ns ± 0%   -84.04%
CRC32/poly=Castagnoli/size=1kB/align=0-32    1.59µs ± 0%    0.22µs ± 0%   -85.89%
CRC32/poly=Castagnoli/size=1kB/align=1-32    1.58µs ± 0%    0.22µs ± 0%   -85.79%
CRC32/poly=Castagnoli/size=4kB/align=0-32    6.14µs ± 0%    0.77µs ± 0%   -87.40%
CRC32/poly=Castagnoli/size=4kB/align=1-32    6.06µs ± 0%    0.77µs ± 0%   -87.25%
CRC32/poly=Castagnoli/size=32kB/align=0-32   48.3µs ± 0%     5.9µs ± 0%   -87.71%
CRC32/poly=Castagnoli/size=32kB/align=1-32   48.4µs ± 0%     6.0µs ± 0%   -87.69%
CRC32/poly=Koopman/size=15/align=0-32         104ns ± 0%     104ns ± 0%    +0.00%
CRC32/poly=Koopman/size=15/align=1-32         104ns ± 0%     104ns ± 0%    +0.00%
CRC32/poly=Koopman/size=40/align=0-32         235ns ± 0%     235ns ± 0%    +0.00%
CRC32/poly=Koopman/size=40/align=1-32         235ns ± 0%     235ns ± 0%    +0.00%
CRC32/poly=Koopman/size=512/align=0-32       2.71µs ± 0%    2.71µs ± 0%    -0.07%
CRC32/poly=Koopman/size=512/align=1-32       2.71µs ± 0%    2.71µs ± 0%    -0.04%
CRC32/poly=Koopman/size=1kB/align=0-32       5.40µs ± 0%    5.39µs ± 0%    -0.06%
CRC32/poly=Koopman/size=1kB/align=1-32       5.40µs ± 0%    5.40µs ± 0%    +0.02%
CRC32/poly=Koopman/size=4kB/align=0-32       21.5µs ± 0%    21.5µs ± 0%    -0.16%
CRC32/poly=Koopman/size=4kB/align=1-32       21.5µs ± 0%    21.5µs ± 0%    -0.05%
CRC32/poly=Koopman/size=32kB/align=0-32       172µs ± 0%     172µs ± 0%    -0.07%
CRC32/poly=Koopman/size=32kB/align=1-32       172µs ± 0%     172µs ± 0%    -0.01%

name                                        old speed     new speed      delta
CRC32/poly=IEEE/size=15/align=0-32          128MB/s ± 0%   394MB/s ± 0%  +207.95%
CRC32/poly=IEEE/size=15/align=1-32          128MB/s ± 0%   394MB/s ± 0%  +208.09%
CRC32/poly=IEEE/size=40/align=0-32          310MB/s ± 0%   979MB/s ± 0%  +216.07%
CRC32/poly=IEEE/size=40/align=1-32          310MB/s ± 0%   979MB/s ± 0%  +216.16%
CRC32/poly=IEEE/size=512/align=0-32         618MB/s ± 0%  2074MB/s ± 0%  +235.72%
CRC32/poly=IEEE/size=512/align=1-32         618MB/s ± 0%  3852MB/s ± 0%  +523.55%
CRC32/poly=IEEE/size=1kB/align=0-32         646MB/s ± 0%  2225MB/s ± 0%  +244.57%
CRC32/poly=IEEE/size=1kB/align=1-32         647MB/s ± 0%  2225MB/s ± 0%  +243.87%
CRC32/poly=IEEE/size=4kB/align=0-32         676MB/s ± 0%  2352MB/s ± 0%  +248.02%
CRC32/poly=IEEE/size=4kB/align=1-32         672MB/s ± 0%  2352MB/s ± 0%  +250.15%
CRC32/poly=IEEE/size=32kB/align=0-32        678MB/s ± 0%  2387MB/s ± 0%  +252.17%
CRC32/poly=IEEE/size=32kB/align=1-32        678MB/s ± 0%  2388MB/s ± 0%  +252.11%
CRC32/poly=Castagnoli/size=15/align=0-32    129MB/s ± 0%   393MB/s ± 0%  +205.51%
CRC32/poly=Castagnoli/size=15/align=1-32    129MB/s ± 0%   390MB/s ± 0%  +203.41%
CRC32/poly=Castagnoli/size=40/align=0-32    314MB/s ± 0%   988MB/s ± 0%  +215.04%
CRC32/poly=Castagnoli/size=40/align=1-32    314MB/s ± 0%   987MB/s ± 0%  +214.68%
CRC32/poly=Castagnoli/size=512/align=0-32   618MB/s ± 0%  3860MB/s ± 0%  +524.32%
CRC32/poly=Castagnoli/size=512/align=1-32   619MB/s ± 0%  3859MB/s ± 0%  +523.66%
CRC32/poly=Castagnoli/size=1kB/align=0-32   645MB/s ± 0%  4568MB/s ± 0%  +608.56%
CRC32/poly=Castagnoli/size=1kB/align=1-32   650MB/s ± 0%  4567MB/s ± 0%  +602.94%
CRC32/poly=Castagnoli/size=4kB/align=0-32   667MB/s ± 0%  5297MB/s ± 0%  +693.81%
CRC32/poly=Castagnoli/size=4kB/align=1-32   676MB/s ± 0%  5297MB/s ± 0%  +684.00%
CRC32/poly=Castagnoli/size=32kB/align=0-32  678MB/s ± 0%  5519MB/s ± 0%  +713.83%
CRC32/poly=Castagnoli/size=32kB/align=1-32  677MB/s ± 0%  5497MB/s ± 0%  +712.04%
CRC32/poly=Koopman/size=15/align=0-32       143MB/s ± 0%   144MB/s ± 0%    +0.27%
CRC32/poly=Koopman/size=15/align=1-32       143MB/s ± 0%   144MB/s ± 0%    +0.33%
CRC32/poly=Koopman/size=40/align=0-32       169MB/s ± 0%   170MB/s ± 0%    +0.12%
CRC32/poly=Koopman/size=40/align=1-32       170MB/s ± 0%   170MB/s ± 0%    +0.08%
CRC32/poly=Koopman/size=512/align=0-32      189MB/s ± 0%   189MB/s ± 0%    +0.07%
CRC32/poly=Koopman/size=512/align=1-32      189MB/s ± 0%   189MB/s ± 0%    +0.04%
CRC32/poly=Koopman/size=1kB/align=0-32      190MB/s ± 0%   190MB/s ± 0%    +0.05%
CRC32/poly=Koopman/size=1kB/align=1-32      190MB/s ± 0%   190MB/s ± 0%    -0.01%
CRC32/poly=Koopman/size=4kB/align=0-32      190MB/s ± 0%   190MB/s ± 0%    +0.15%
CRC32/poly=Koopman/size=4kB/align=1-32      190MB/s ± 0%   191MB/s ± 0%    +0.05%
CRC32/poly=Koopman/size=32kB/align=0-32     191MB/s ± 0%   191MB/s ± 0%    +0.06%
CRC32/poly=Koopman/size=32kB/align=1-32     191MB/s ± 0%   191MB/s ± 0%    +0.02%

Also fix a bug of arm64 assembler

The optimization is mainly contributed by Fangming.Fang <fangming.fang@arm.com>

Change-Id: I900678c2e445d7e8ad9e2a9ab3305d649230905f
Reviewed-on: https://go-review.googlesource.com/40074
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-13 12:44:10 +00:00
Meir Fischer
aaf4682171 net/http/fcgi: expose cgi env vars in request context
The current interface can't access all environment
variables directly or via cgi.RequestFromMap, which
only reads variables on its "white list" to be set on
the http.Request it returns. If an fcgi variable is
not on the "white list" - e.g. REMOTE_USER - the old
code has no access to its value.

This passes variables in the Request context that aren't
used to add data to the Request itself and adds a method
that parses those env vars from the Request's context.

Fixes #16546

Change-Id: Ibf933a768b677ece1bb93d7bf99a14cef36ec671
Reviewed-on: https://go-review.googlesource.com/40012
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-13 04:38:23 +00:00
Mikio Hara
7c3fa418bf internal/poll: rename RecvFrom to ReadFrom for consistency
Also adds missing docs.

Change-Id: Ibd8dbe8441bc7a41f01ed2e2033db98e479a5176
Reviewed-on: https://go-review.googlesource.com/40412
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-13 03:26:58 +00:00
Josh Bleecher Snyder
0d36999a0f cmd/compile: make TestAssembly resilient to output ordering
To preserve reproducible builds, the text entries
during compilation will be sorted before being printed.
TestAssembly currently assumes that function init
comes after all user-defined functions.
Remove that assumption.
Instead of looking for "TEXT" to tell you where
a function ends--which may now yield lots of
non-function-code junk--look for a line beginning
with non-whitespace.

Updates #15756

Change-Id: Ibc82dba6143d769ef4c391afc360e523b1a51348
Reviewed-on: https://go-review.googlesource.com/39853
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-13 02:30:29 +00:00
Josh Bleecher Snyder
c18fd09840 cmd/internal/obj: build ctxt.Text during Sym init
Instead of constructing ctxt.Text in Flushplist,
which will be called concurrently,
do it in InitTextSym, which must be called serially.
This allows us to avoid a mutex for ctxt.Text,
and preserves the existing ordering of functions
for debug output.

Passes toolstash-check.

Updates #15756

Change-Id: I6322b4da24f9f0db7ba25e5b1b50e8d3be2deb37
Reviewed-on: https://go-review.googlesource.com/40502
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-13 02:29:05 +00:00
Brad Fitzpatrick
9dbba36a97 cmd/dist: don't compile unneeded GOARCH SSA rewrite rules during bootstrap
Speeds up build (the bootstrap phase) by ~6 seconds.

Bootstrap goes from ~18 seconds to ~12 seconds.

Change-Id: I7e2ec8f5fc668bf6168d90098eaf70390b16e479
Reviewed-on: https://go-review.googlesource.com/40503
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-13 02:03:10 +00:00
Lucas Clemente
e05de6a5be hash/fnv: add 128-bit FNV hash support
The 128bit FNV hash will be used e.g. in QUIC.

The algorithm is described at
https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function

Change-Id: I13f3ec39b0e12b7a5008824a6619dff2e708ee81
Reviewed-on: https://go-review.googlesource.com/38356
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-13 01:28:48 +00:00