]>
Cypherpunks repositories - gostls13.git/log
Brad Fitzpatrick [Sun, 10 Apr 2016 14:51:07 +0000 (14:51 +0000)]
html: fix typo in UnescapeString string docs
Fixes #15221
Change-Id: I9e927a2f604213338b4572f1a32d0247c58bdc60
Reviewed-on: https://go-review.googlesource.com/21798
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Klaus Post [Sun, 10 Apr 2016 15:16:07 +0000 (17:16 +0200)]
compress/flate: improve short writer error test
This improves the short version of the writer test.
First of all, it has a much quicker setup. Previously that
could take up towards 0.5 second.
Secondly, it will test all compression levels in short mode as well.
Execution time is 1.7s/0.03s for normal/short mode.
Change-Id: I275a21f712daff6f7125cc6a493415e86439cb19
Reviewed-on: https://go-review.googlesource.com/21800
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Klaus Post [Sun, 10 Apr 2016 11:43:24 +0000 (13:43 +0200)]
compress/flate: eliminate most common bounds checks
This uses the SSA compiler to eliminate various unneeded bounds
checks in loops and various lookups.
This fixes the low hanging fruit, without any major code changes.
name old time/op new time/op delta
EncodeDigitsHuffman1e4-8 49.9µs ± 1% 48.1µs ± 1% -3.74% (p=0.000 n=10+9)
EncodeDigitsHuffman1e5-8 476µs ± 1% 458µs ± 1% -3.58% (p=0.000 n=10+10)
EncodeDigitsHuffman1e6-8 4.80ms ± 2% 4.56ms ± 1% -5.07% (p=0.000 n=10+9)
EncodeDigitsSpeed1e4-8 305µs ± 3% 290µs ± 2% -5.03% (p=0.000 n=10+9)
EncodeDigitsSpeed1e5-8 3.67ms ± 2% 3.49ms ± 2% -4.78% (p=0.000 n=9+10)
EncodeDigitsSpeed1e6-8 38.3ms ± 2% 35.8ms ± 1% -6.58% (p=0.000 n=9+10)
EncodeDigitsDefault1e4-8 361µs ± 2% 346µs ± 3% -4.12% (p=0.000 n=10+9)
EncodeDigitsDefault1e5-8 5.24ms ± 2% 4.96ms ± 3% -5.38% (p=0.000 n=10+10)
EncodeDigitsDefault1e6-8 56.5ms ± 3% 52.2ms ± 2% -7.68% (p=0.000 n=10+10)
EncodeDigitsCompress1e4-8 362µs ± 2% 343µs ± 1% -5.20% (p=0.000 n=10+9)
EncodeDigitsCompress1e5-8 5.26ms ± 3% 4.98ms ± 2% -5.48% (p=0.000 n=10+10)
EncodeDigitsCompress1e6-8 56.0ms ± 4% 52.1ms ± 1% -7.01% (p=0.000 n=10+10)
EncodeTwainHuffman1e4-8 70.9µs ± 3% 64.7µs ± 1% -8.68% (p=0.000 n=10+9)
EncodeTwainHuffman1e5-8 556µs ± 2% 524µs ± 2% -5.84% (p=0.000 n=10+10)
EncodeTwainHuffman1e6-8 5.54ms ± 3% 5.22ms ± 2% -5.70% (p=0.000 n=10+10)
EncodeTwainSpeed1e4-8 294µs ± 3% 284µs ± 1% -3.71% (p=0.000 n=10+10)
EncodeTwainSpeed1e5-8 2.59ms ± 2% 2.48ms ± 1% -4.14% (p=0.000 n=10+9)
EncodeTwainSpeed1e6-8 25.6ms ± 1% 24.3ms ± 1% -5.28% (p=0.000 n=9+10)
EncodeTwainDefault1e4-8 419µs ± 2% 396µs ± 1% -5.59% (p=0.000 n=10+9)
EncodeTwainDefault1e5-8 6.23ms ± 4% 5.75ms ± 1% -7.83% (p=0.000 n=10+9)
EncodeTwainDefault1e6-8 66.2ms ± 2% 61.4ms ± 1% -7.22% (p=0.000 n=10+10)
EncodeTwainCompress1e4-8 426µs ± 1% 405µs ± 1% -4.97% (p=0.000 n=9+10)
EncodeTwainCompress1e5-8 6.80ms ± 1% 6.32ms ± 1% -6.97% (p=0.000 n=9+10)
EncodeTwainCompress1e6-8 74.6ms ± 3% 68.7ms ± 1% -7.90% (p=0.000 n=10+9)
name old speed new speed delta
EncodeDigitsHuffman1e4-8 200MB/s ± 1% 208MB/s ± 1% +3.88% (p=0.000 n=10+9)
EncodeDigitsHuffman1e5-8 210MB/s ± 1% 218MB/s ± 1% +3.71% (p=0.000 n=10+10)
EncodeDigitsHuffman1e6-8 208MB/s ± 2% 219MB/s ± 1% +5.32% (p=0.000 n=10+9)
EncodeDigitsSpeed1e4-8 32.8MB/s ± 3% 34.5MB/s ± 2% +5.29% (p=0.000 n=10+9)
EncodeDigitsSpeed1e5-8 27.2MB/s ± 2% 28.6MB/s ± 2% +5.29% (p=0.000 n=10+10)
EncodeDigitsSpeed1e6-8 26.1MB/s ± 2% 27.9MB/s ± 1% +7.02% (p=0.000 n=9+10)
EncodeDigitsDefault1e4-8 27.7MB/s ± 2% 28.9MB/s ± 3% +4.30% (p=0.000 n=10+9)
EncodeDigitsDefault1e5-8 19.1MB/s ± 2% 20.2MB/s ± 3% +5.69% (p=0.000 n=10+10)
EncodeDigitsDefault1e6-8 17.7MB/s ± 3% 19.2MB/s ± 2% +8.31% (p=0.000 n=10+10)
EncodeDigitsCompress1e4-8 27.6MB/s ± 2% 29.1MB/s ± 1% +5.47% (p=0.000 n=10+9)
EncodeDigitsCompress1e5-8 19.0MB/s ± 3% 20.1MB/s ± 2% +5.78% (p=0.000 n=10+10)
EncodeDigitsCompress1e6-8 17.9MB/s ± 4% 19.2MB/s ± 1% +7.50% (p=0.000 n=10+10)
EncodeTwainHuffman1e4-8 141MB/s ± 3% 154MB/s ± 1% +9.46% (p=0.000 n=10+9)
EncodeTwainHuffman1e5-8 180MB/s ± 2% 191MB/s ± 2% +6.19% (p=0.000 n=10+10)
EncodeTwainHuffman1e6-8 181MB/s ± 3% 192MB/s ± 2% +6.02% (p=0.000 n=10+10)
EncodeTwainSpeed1e4-8 34.0MB/s ± 3% 35.3MB/s ± 1% +3.84% (p=0.000 n=10+10)
EncodeTwainSpeed1e5-8 38.7MB/s ± 2% 40.3MB/s ± 1% +4.30% (p=0.000 n=10+9)
EncodeTwainSpeed1e6-8 39.1MB/s ± 1% 41.2MB/s ± 1% +5.57% (p=0.000 n=9+10)
EncodeTwainDefault1e4-8 23.9MB/s ± 2% 25.3MB/s ± 1% +5.91% (p=0.000 n=10+9)
EncodeTwainDefault1e5-8 16.0MB/s ± 4% 17.4MB/s ± 1% +8.47% (p=0.000 n=10+9)
EncodeTwainDefault1e6-8 15.1MB/s ± 2% 16.3MB/s ± 1% +7.76% (p=0.000 n=10+10)
EncodeTwainCompress1e4-8 23.5MB/s ± 1% 24.7MB/s ± 1% +5.24% (p=0.000 n=9+10)
EncodeTwainCompress1e5-8 14.7MB/s ± 1% 15.8MB/s ± 1% +7.50% (p=0.000 n=9+10)
EncodeTwainCompress1e6-8 13.4MB/s ± 3% 14.6MB/s ± 1% +8.57% (p=0.000 n=10+9)
Change-Id: I5c7e84c2f9ea4d38a2115995705eebb93387e22f
Reviewed-on: https://go-review.googlesource.com/21759
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Martin Möhrmann [Sun, 10 Apr 2016 06:48:55 +0000 (08:48 +0200)]
all: replace magic 0x80 with named constant utf8.RuneSelf
Change-Id: Id1c2e8e9d60588de866e8b6ca59cc83dd28f848f
Reviewed-on: https://go-review.googlesource.com/21756
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Dmitry Vyukov [Sun, 10 Apr 2016 10:49:40 +0000 (12:49 +0200)]
internal/trace: fix a typo in error message
Change-Id: Id79eaa6d49dae80c334c7243b0a5bbcdcb9397d3
Reviewed-on: https://go-review.googlesource.com/21758
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Marvin Stenger [Fri, 8 Apr 2016 16:19:10 +0000 (18:19 +0200)]
cmd: remove bio.Bread
Replace calls to bio.Bread with calls to io.ReadFull.
Change-Id: I2ee8739d01e04a4da9c20b6ce7d1d5b89914b8ad
Reviewed-on: https://go-review.googlesource.com/21750
Reviewed-by: Dave Cheney <dave@cheney.net>
Emmanuel Odeke [Mon, 28 Mar 2016 00:29:53 +0000 (17:29 -0700)]
runtime: make execution error panic values implement the Error interface
Make execution panics implement Error as
mandated by https://golang.org/ref/spec#Run_time_panics,
instead of panics with strings.
Fixes #14965
Change-Id: I7827f898b9b9c08af541db922cc24fa0800ff18a
Reviewed-on: https://go-review.googlesource.com/21214
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Wisdom Omuya [Sat, 9 Apr 2016 23:23:01 +0000 (19:23 -0400)]
cmd/go: fix typo in findInternal documentation
Fixes #15217
Change-Id: Ib8f7af714197fd209e743f61f28a5b07c04a7f5c
Reviewed-on: https://go-review.googlesource.com/21793
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Emmanuel Odeke [Sat, 9 Apr 2016 07:34:18 +0000 (00:34 -0700)]
net/http/httputil: DumpRequest dumps Content-Length if set in header
Fixes #7215
Change-Id: I108171ef18cac66d0dc11ce3553c26fc49529807
Reviewed-on: https://go-review.googlesource.com/21790
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Brad Fitzpatrick [Sat, 9 Apr 2016 22:54:26 +0000 (22:54 +0000)]
cmd/go: fix typo in comment
Thanks to deafgoat.
Fixes #15215
Change-Id: I9fababc7ecd201ce86020a438e4faee95e7623a8
Reviewed-on: https://go-review.googlesource.com/21792
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Dmitry Vyukov [Fri, 18 Mar 2016 09:56:23 +0000 (10:56 +0100)]
runtime: revert "do not call timeBeginPeriod on windows"
This reverts commit
ab4c9298b8185a056ff1152f2c7bd9b38d3d06f3 .
Sysmon critically depends on system timer resolution for retaking
of Ps blocked in system calls. See #14790 for an example
of a program where execution time goes from 2ms to 30ms if
timeBeginPeriod(1) is not used.
We can remove timeBeginPeriod(1) when we support UMS (#7876).
Update #14790
Change-Id: I362b56154359b2c52d47f9f2468fe012b481cf6d
Reviewed-on: https://go-review.googlesource.com/20834
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Dave Cheney [Fri, 8 Apr 2016 10:44:56 +0000 (20:44 +1000)]
cmd/internal/bio: move Bgetc to link/internal/ld
Also, remove bio.Brdline.
Change-Id: I3e0caed27a373fd71737cf6892de5e8fc208b776
Reviewed-on: https://go-review.googlesource.com/21783
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
Dave Cheney [Sat, 9 Apr 2016 05:04:45 +0000 (15:04 +1000)]
cmd: remove unused code
Generated with honnef.co/go/unused
There is a large amount of unused code in cmd/internal/obj/s390x but
that can wait til the s390x port is merged.
There is some unused code in
cmd/internal/unvendor/golang.org/x/arch/arm/armasm but that should be
addressed upstream and a new revision imported.
Change-Id: I252c0f9ea8c5bb1a0b530a374ef13a0a20ea56aa
Reviewed-on: https://go-review.googlesource.com/21782
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
Dave Cheney [Fri, 8 Apr 2016 10:37:54 +0000 (20:37 +1000)]
cmd/internal/bio: embed bufio.{Reader,Writer} in bio.{Reader,Writer}
Change-Id: Ie95b0b0d4f724f4769cf2d4f8063cb5019fa9bc9
Reviewed-on: https://go-review.googlesource.com/21781
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Dave Cheney [Fri, 8 Apr 2016 09:30:41 +0000 (19:30 +1000)]
cmd: remove bio.BufReader and bio.BufWriter
bio.BufReader was never used.
bio.BufWriter was used to wrap an existing io.Writer, but the
bio.Writer returned would not be seekable, so replace all occurences
with bufio.Reader instead.
Change-Id: I9c6779e35c63178aa4e104c17bb5bb8b52de0359
Reviewed-on: https://go-review.googlesource.com/21722
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Dave Cheney [Sat, 9 Apr 2016 02:54:45 +0000 (12:54 +1000)]
cmd/link/internal: make ld.Bso a *bio.Writer
This is a pre requesite of CL 21722 and removes a lot of unidiomatic
boilerplate in the linker.
Change-Id: If7491b88212b2be7b0c8c588e9c196839131f8ad
Reviewed-on: https://go-review.googlesource.com/21780
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Hudson-Doyle [Fri, 8 Apr 2016 02:27:35 +0000 (14:27 +1200)]
cmd/cgo: fix cgo with gccgo
Change-Id: I1780899255e22c16d7f8e9947609a1c284d7c42e
Reviewed-on: https://go-review.googlesource.com/21690
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
David Chase [Fri, 8 Apr 2016 17:33:43 +0000 (13:33 -0400)]
cmd/compile: insert instrumentation more carefully in racewalk
Be more careful about inserting instrumentation in racewalk.
If the node being instrumented is an OAS, and it has a non-
empty Ninit, then append instrumentation to the Ninit list
rather than letting it be inserted before the OAS (and the
compilation of its init list). This deals with the case that
the Ninit list defines a variable used in the RHS of the OAS.
Fixes #15091.
Change-Id: Iac91696d9104d07f0bf1bd3499bbf56b2e1ef073
Reviewed-on: https://go-review.googlesource.com/21771
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: David Chase <drchase@google.com>
Dmitry Vyukov [Fri, 8 Apr 2016 13:14:37 +0000 (15:14 +0200)]
runtime: emit file:line info into traces
This makes traces self-contained and simplifies trace workflow
in modern cloud environments where it is simpler to reach
a service via HTTP than to obtain the binary.
Change-Id: I6ff3ca694dc698270f1e29da37d5efaf4e843a0d
Reviewed-on: https://go-review.googlesource.com/21732
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Michael Munday [Fri, 8 Apr 2016 17:02:49 +0000 (13:02 -0400)]
cmd/cgo: increase s390x int type size to 8 bytes
The size of the int type in Go on s390x is 8 bytes, not 4.
Change-Id: I1a71ce8c9925f3499abb61c1aa4f6fa2d2ec0d7e
Reviewed-on: https://go-review.googlesource.com/21760
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Emmanuel Odeke [Fri, 8 Apr 2016 06:22:30 +0000 (23:22 -0700)]
bytes: add ContainsRune
Make package bytes consistent with strings
by adding missing function ContainsRune.
Fixes #15189
Change-Id: Ie09080b389e55bbe070c57aa3bd134053a805423
Reviewed-on: https://go-review.googlesource.com/21710
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Michael Munday [Fri, 8 Apr 2016 15:40:51 +0000 (11:40 -0400)]
syscall: add assembly for Linux on s390x
Change-Id: I42ade65a91f3effc03dd663ee449410baa9f8ca8
Reviewed-on: https://go-review.googlesource.com/21740
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick [Fri, 8 Apr 2016 17:50:03 +0000 (17:50 +0000)]
context: disable more flaky tests on openbsd
Updates #15158
Change-Id: Icb3788152a7a5a9b0d56ea38da46d770ffdce413
Reviewed-on: https://go-review.googlesource.com/21763
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Michael Munday [Sun, 20 Mar 2016 23:35:59 +0000 (19:35 -0400)]
test: skip nilptr3 test on s390x
Fails for the same reason as ppc64 and mips64 (incomplete
optimization).
Change-Id: Ieb4d997fc27d4f2b756e63dd7f588abe10c0213a
Reviewed-on: https://go-review.googlesource.com/20963
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Michael Munday [Fri, 8 Apr 2016 15:55:05 +0000 (11:55 -0400)]
cmd/link: add s390x to link tool main function
Change-Id: I83bc2b4a00216b069f133113e4ae9ad76c98a708
Reviewed-on: https://go-review.googlesource.com/21741
Run-TryBot: Michael Munday <munday@ca.ibm.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Rob Pike [Thu, 7 Apr 2016 03:19:47 +0000 (20:19 -0700)]
io: change the name of ReadAtSizer to SizedReaderAt
This is a proposal. The old name is pretty poor. The new one describes
it better and may be easier to remember. It does not start with Read,
though I think that inconsistency is worthwhile.
Reworded the comment a bit for clarity.
Change-Id: Icb4f9c663cc68958e0363d7ff78a0b29cc521f98
Reviewed-on: https://go-review.googlesource.com/21629
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Dave Cheney [Fri, 8 Apr 2016 09:14:03 +0000 (19:14 +1000)]
cmd: replace bio.Buf with bio.Reader and bio.Writer
Replace the bidirectional bio.Buf type with a pair of unidirectional
buffered seekable Reader and Writers.
Change-Id: I86664a06f93c94595dc67c2cbd21356feb6680ef
Reviewed-on: https://go-review.googlesource.com/21720
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Munday [Thu, 7 Apr 2016 19:31:49 +0000 (15:31 -0400)]
cmd/compile: cleanup -dynlink/-shared support check
Moves the list of architectures that support shared libraries into
a function. Also adds s390x to that list.
Change-Id: I99c8a9f6cd4816ce3d53abaabaf8d002e25e6b28
Reviewed-on: https://go-review.googlesource.com/21661
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
Dave Cheney [Fri, 8 Apr 2016 10:09:10 +0000 (20:09 +1000)]
cmd/compile/internal/gc: unexport Export
Export does not need to be exported.
Change-Id: I252f0c024732f1d056817cab13e8e3c589b54d13
Reviewed-on: https://go-review.googlesource.com/21721
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Andrew Gerrand [Fri, 8 Apr 2016 05:09:45 +0000 (15:09 +1000)]
cmd/go: fix failing tests since vet was moved from x/tools
Change-Id: I3276a118ced78f3efd8f1bc5fb8b8fa2fde52496
Reviewed-on: https://go-review.googlesource.com/21704
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Emmanuel Odeke [Fri, 8 Apr 2016 02:59:59 +0000 (19:59 -0700)]
net/http: fixed trivial go vet warnings
Updates #15177
Change-Id: I748f025461f313b5b426821ead695f90d3011a6b
Reviewed-on: https://go-review.googlesource.com/21677
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Keith Randall [Thu, 7 Apr 2016 17:21:35 +0000 (10:21 -0700)]
cmd/compile: Fix constant-folding of unsigned shifts
Make sure the results of unsigned constant-folded
shifts are sign-extended into the AuxInt field.
Fixes #15175
Change-Id: I3490d1bc3d9b2e1578ed30964645508577894f58
Reviewed-on: https://go-review.googlesource.com/21586
Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Cheng-Lung Sung [Wed, 6 Apr 2016 15:05:20 +0000 (23:05 +0800)]
cmd/go: revise importPath when ImportPath is 'command-line-arguments'
Fixes #14613
Change-Id: I40d9696db3879549e78373ef17f6c92bd4b3470b
Reviewed-on: https://go-review.googlesource.com/21596
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Joe Tsai [Thu, 31 Mar 2016 23:05:23 +0000 (16:05 -0700)]
bytes, string: add Reset method to Reader
Currently, there is no easy allocation-free way to turn a
[]byte or string into an io.Reader. Thus, we add a Reset method
to bytes.Reader and strings.Reader to allow the reuse of these
Readers with another []byte or string.
This is consistent with the fact that many standard library io.Readers
already support a Reset method of some type:
bufio.Reader
flate.Reader
gzip.Reader
zlib.Reader
debug/dwarf.LineReader
bytes.Buffer
crypto/rc4.Cipher
Fixes #15033
Change-Id: I456fd1af77af6ef0b4ac6228b058ac1458ff3d19
Reviewed-on: https://go-review.googlesource.com/21386
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Munday [Fri, 18 Mar 2016 23:09:39 +0000 (19:09 -0400)]
runtime: add s390x support (new files and lfstack_64bit.go modifications)
Change-Id: I51c0a332e3cbdab348564e5dcd27583e75e4b881
Reviewed-on: https://go-review.googlesource.com/20946
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
David Crawshaw [Thu, 7 Apr 2016 18:27:15 +0000 (14:27 -0400)]
cmd/link: hide go.dwarf symbols
Fixes #15179
Change-Id: I0f70b7ae1682eafaece7f22d8e76f0aa806f3ec9
Reviewed-on: https://go-review.googlesource.com/21589
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
David Crawshaw [Thu, 7 Apr 2016 18:00:00 +0000 (14:00 -0400)]
cmd/link: disable DWARF when not generating symtab
Fixes #15166
Change-Id: I30284e3c0fb2c80b26a2572e2fb249b8018e85f9
Reviewed-on: https://go-review.googlesource.com/21587
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Burcu Dogan [Thu, 7 Apr 2016 17:50:47 +0000 (10:50 -0700)]
C: fix jbd's identity
Change-Id: Ib4353710a742b1067723c7c6186e8639559668a3
Reviewed-on: https://go-review.googlesource.com/21655
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Brad Fitzpatrick [Thu, 7 Apr 2016 16:00:32 +0000 (09:00 -0700)]
context: mark more tests as flaky on OpenBSD
Updates #15158
Change-Id: I53e9e68d36efbf52736822e6caa047cfff501283
Reviewed-on: https://go-review.googlesource.com/21653
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Aliaksandr Valialkin [Mon, 4 Apr 2016 16:28:15 +0000 (19:28 +0300)]
math/big: re-use memory in Int.GCD
This improves TLS handshake performance.
benchmark old ns/op new ns/op delta
BenchmarkGCD10x10/WithoutXY-4 965 968 +0.31%
BenchmarkGCD10x10/WithXY-4 1813 1391 -23.28%
BenchmarkGCD10x100/WithoutXY-4 1093 1075 -1.65%
BenchmarkGCD10x100/WithXY-4 2348 1676 -28.62%
BenchmarkGCD10x1000/WithoutXY-4 1569 1565 -0.25%
BenchmarkGCD10x1000/WithXY-4 4262 3242 -23.93%
BenchmarkGCD10x10000/WithoutXY-4 6069 6066 -0.05%
BenchmarkGCD10x10000/WithXY-4 12123 11331 -6.53%
BenchmarkGCD10x100000/WithoutXY-4 52664 52610 -0.10%
BenchmarkGCD10x100000/WithXY-4 97494 95649 -1.89%
BenchmarkGCD100x100/WithoutXY-4 5244 5228 -0.31%
BenchmarkGCD100x100/WithXY-4 22572 18630 -17.46%
BenchmarkGCD100x1000/WithoutXY-4 6143 6233 +1.47%
BenchmarkGCD100x1000/WithXY-4 24652 19357 -21.48%
BenchmarkGCD100x10000/WithoutXY-4 15725 15804 +0.50%
BenchmarkGCD100x10000/WithXY-4 60552 55973 -7.56%
BenchmarkGCD100x100000/WithoutXY-4 107008 107853 +0.79%
BenchmarkGCD100x100000/WithXY-4 349597 340994 -2.46%
BenchmarkGCD1000x1000/WithoutXY-4 63785 64434 +1.02%
BenchmarkGCD1000x1000/WithXY-4 373186 334035 -10.49%
BenchmarkGCD1000x10000/WithoutXY-4 78038 78241 +0.26%
BenchmarkGCD1000x10000/WithXY-4 543692 507034 -6.74%
BenchmarkGCD1000x100000/WithoutXY-4 205607 207727 +1.03%
BenchmarkGCD1000x100000/WithXY-4
2488113 2415323 -2.93%
BenchmarkGCD10000x10000/WithoutXY-4
1731340 1714992 -0.94%
BenchmarkGCD10000x10000/WithXY-4
10601046 7111329 -32.92%
BenchmarkGCD10000x100000/WithoutXY-4
2239155 2212173 -1.21%
BenchmarkGCD10000x100000/WithXY-4
30097040 26538887 -11.82%
BenchmarkGCD100000x100000/WithoutXY-4
119845326 119863916 +0.02%
BenchmarkGCD100000x100000/WithXY-4
768006543 426795966 -44.43%
benchmark old allocs new allocs delta
BenchmarkGCD10x10/WithoutXY-4 5 5 +0.00%
BenchmarkGCD10x10/WithXY-4 17 9 -47.06%
BenchmarkGCD10x100/WithoutXY-4 6 6 +0.00%
BenchmarkGCD10x100/WithXY-4 21 9 -57.14%
BenchmarkGCD10x1000/WithoutXY-4 6 6 +0.00%
BenchmarkGCD10x1000/WithXY-4 30 12 -60.00%
BenchmarkGCD10x10000/WithoutXY-4 6 6 +0.00%
BenchmarkGCD10x10000/WithXY-4 26 12 -53.85%
BenchmarkGCD10x100000/WithoutXY-4 6 6 +0.00%
BenchmarkGCD10x100000/WithXY-4 28 12 -57.14%
BenchmarkGCD100x100/WithoutXY-4 5 5 +0.00%
BenchmarkGCD100x100/WithXY-4 183 61 -66.67%
BenchmarkGCD100x1000/WithoutXY-4 8 8 +0.00%
BenchmarkGCD100x1000/WithXY-4 170 47 -72.35%
BenchmarkGCD100x10000/WithoutXY-4 8 8 +0.00%
BenchmarkGCD100x10000/WithXY-4 200 67 -66.50%
BenchmarkGCD100x100000/WithoutXY-4 8 8 +0.00%
BenchmarkGCD100x100000/WithXY-4 188 65 -65.43%
BenchmarkGCD1000x1000/WithoutXY-4 5 5 +0.00%
BenchmarkGCD1000x1000/WithXY-4 2435 1193 -51.01%
BenchmarkGCD1000x10000/WithoutXY-4 8 8 +0.00%
BenchmarkGCD1000x10000/WithXY-4 2211 1076 -51.33%
BenchmarkGCD1000x100000/WithoutXY-4 8 8 +0.00%
BenchmarkGCD1000x100000/WithXY-4 2271 1108 -51.21%
BenchmarkGCD10000x10000/WithoutXY-4 5 5 +0.00%
BenchmarkGCD10000x10000/WithXY-4 23183 11605 -49.94%
BenchmarkGCD10000x100000/WithoutXY-4 8 8 +0.00%
BenchmarkGCD10000x100000/WithXY-4 23421 11717 -49.97%
BenchmarkGCD100000x100000/WithoutXY-4 5 5 +0.00%
BenchmarkGCD100000x100000/WithXY-4 232976 116815 -49.86%
benchmark old bytes new bytes delta
BenchmarkGCD10x10/WithoutXY-4 208 208 +0.00%
BenchmarkGCD10x10/WithXY-4 736 432 -41.30%
BenchmarkGCD10x100/WithoutXY-4 256 256 +0.00%
BenchmarkGCD10x100/WithXY-4 896 432 -51.79%
BenchmarkGCD10x1000/WithoutXY-4 368 368 +0.00%
BenchmarkGCD10x1000/WithXY-4 1856 1152 -37.93%
BenchmarkGCD10x10000/WithoutXY-4 1616 1616 +0.00%
BenchmarkGCD10x10000/WithXY-4 7920 7376 -6.87%
BenchmarkGCD10x100000/WithoutXY-4 13776 13776 +0.00%
BenchmarkGCD10x100000/WithXY-4 68800 68176 -0.91%
BenchmarkGCD100x100/WithoutXY-4 208 208 +0.00%
BenchmarkGCD100x100/WithXY-4 6960 2112 -69.66%
BenchmarkGCD100x1000/WithoutXY-4 544 560 +2.94%
BenchmarkGCD100x1000/WithXY-4 7280 2400 -67.03%
BenchmarkGCD100x10000/WithoutXY-4 2896 2912 +0.55%
BenchmarkGCD100x10000/WithXY-4 15280 10002 -34.54%
BenchmarkGCD100x100000/WithoutXY-4 27344 27365 +0.08%
BenchmarkGCD100x100000/WithXY-4 88288 83427 -5.51%
BenchmarkGCD1000x1000/WithoutXY-4 544 544 +0.00%
BenchmarkGCD1000x1000/WithXY-4 178288 40043 -77.54%
BenchmarkGCD1000x10000/WithoutXY-4 3344 3136 -6.22%
BenchmarkGCD1000x10000/WithXY-4 188720 54432 -71.16%
BenchmarkGCD1000x100000/WithoutXY-4 27792 27592 -0.72%
BenchmarkGCD1000x100000/WithXY-4 373872 239447 -35.95%
BenchmarkGCD10000x10000/WithoutXY-4 4288 4288 +0.00%
BenchmarkGCD10000x10000/WithXY-4
11935584 481875 -95.96%
BenchmarkGCD10000x100000/WithoutXY-4 31296 28834 -7.87%
BenchmarkGCD10000x100000/WithXY-4
13237088 1662620 -87.44%
BenchmarkGCD100000x100000/WithoutXY-4 40768 40768 +0.00%
BenchmarkGCD100000x100000/WithXY-4
1165518864 14256010 -98.78%
Change-Id: I652b3244bd074a03f3bc9a87c282330f9e5f1507
Reviewed-on: https://go-review.googlesource.com/21506
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Munday [Mon, 21 Mar 2016 01:49:52 +0000 (21:49 -0400)]
math/big: add s390x function implementations
Change-Id: I2aadc885d6330460e494c687757f07c5e006f3b0
Reviewed-on: https://go-review.googlesource.com/20937
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Munday [Mon, 21 Mar 2016 01:34:48 +0000 (21:34 -0400)]
sync/atomic: add s390x implementations of atomic functions
Load and store instructions are atomic on s390x.
Change-Id: I33c641a75954f4fbd301b11a467cb57872038880
Reviewed-on: https://go-review.googlesource.com/20947
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Alan Donovan [Thu, 7 Apr 2016 14:07:10 +0000 (10:07 -0400)]
go/types: make Identical(nil, T) == Identical(T, nil)
Fixes #15173
Change-Id: I353756f7bc36db0d2b24d40c80771481b7b18f6b
Reviewed-on: https://go-review.googlesource.com/21585
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Dave Cheney [Thu, 7 Apr 2016 14:05:06 +0000 (14:05 +0000)]
Revert "runtime: merge lfstack{Pack,Unpack} into one file"
This broke solaris, which apparently does use the upper 17 bits of the address space.
This reverts commit
3b02c5b1b66df9cdb23d5a3243bb37b2c312ea1b .
Change-Id: Iedfe54abd0384960845468205f20191a97751c0b
Reviewed-on: https://go-review.googlesource.com/21652
Reviewed-by: Dave Cheney <dave@cheney.net>
Alexandru Moșoi [Tue, 5 Apr 2016 21:32:49 +0000 (23:32 +0200)]
cmd/compile: fold CMPconst and SHR
Fold the comparison when the SHR result is small.
Useful for:
- murmur mix like hashing where higher bits are desirable, i.e. hash = uint32(i * C) >> 18
- integer log2 via DeBruijn sequence: http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn
Change-Id: If70ae18cb86f4cc83ab6213f88ced03cc4986156
Reviewed-on: https://go-review.googlesource.com/21514
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Richard Miller [Wed, 6 Apr 2016 17:58:22 +0000 (18:58 +0100)]
runtime/pprof: make TestBlockProfile less timing dependent
The test for profiling of channel blocking is timing dependent,
and in particular the blockSelectRecvAsync case can fail on a
slow builder (plan9_arm) when many tests are run in parallel.
The child goroutine sleeps for a fixed period so the parent
can be observed to block in a select call reading from the
child; but if the OS process running the parent goroutine is
delayed long enough, the child may wake again before the
parent has reached the blocking point. By repeating the test
three times, the likelihood of a blocking event is increased.
Fixes #15096
Change-Id: I2ddb9576a83408d06b51ded682bf8e71e53ce59e
Reviewed-on: https://go-review.googlesource.com/21604
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Dave Cheney [Wed, 6 Apr 2016 21:29:22 +0000 (07:29 +1000)]
runtime: merge lfstack{Pack,Unpack} into one file
Merge the remaining lfstack{Pack,Unpack} implemetations into one file.
unsafe.Sizeof(uintptr(0)) == 4 is a constant comparison so this branch
folds away at compile time.
Dmitry confirmed that the upper 17 bits of an address will be zero for a
user mode pointer, so there is no need to sign extend on amd64 during
unpack, so we can reuse the same implementation as all othe 64 bit
archs.
Change-Id: I99f589416d8b181ccde5364c9c2e78e4a5efc7f1
Reviewed-on: https://go-review.googlesource.com/21597
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Matthew Dempsky [Thu, 7 Apr 2016 06:34:32 +0000 (23:34 -0700)]
cmd/link/internal/amd64: remove empty source file
Change-Id: I2da012ed996c669db513a462f014c6f3ffa396ee
Reviewed-on: https://go-review.googlesource.com/21646
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Matthew Dempsky [Thu, 7 Apr 2016 04:45:29 +0000 (21:45 -0700)]
cmd: extract obj's Biobuf code into new bio package
API could still be made more Go-ey.
Updates #15165.
Change-Id: I514ffceffa43c293ae5d7e5f1e9193fda0098865
Reviewed-on: https://go-review.googlesource.com/21644
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Matthew Dempsky [Thu, 7 Apr 2016 03:06:41 +0000 (20:06 -0700)]
cmd/internal/sys: change ArchFamily constants to iotas
RIP architecture characters.
Change-Id: I36f53afdc311b14b9459ff3821bd6df54a057ded
Reviewed-on: https://go-review.googlesource.com/21628
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Matthew Dempsky [Thu, 7 Apr 2016 03:06:12 +0000 (20:06 -0700)]
cmd/link: remove dependency on sys.ArchFamily values
Change-Id: I858054b72847f4f27a1ebbdaff82820a28c03743
Reviewed-on: https://go-review.googlesource.com/21627
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Matthew Dempsky [Thu, 7 Apr 2016 01:54:17 +0000 (18:54 -0700)]
cmd/compile, cmd/link: eliminate uses of ArchFamily in error messages
Two of these error messages are already dead code: cmd/compile.main
and cmd/link.main already switch on $GOARCH, ensuring it must be a
prefix of the sys.Arch.Family.
The error message about uncompiled Go source files can be just be
simplified: anyone who's manually constructing Go object file archives
probably knows what tool to use to compile Go source files.
Change-Id: Ia4a67c0a1d1158379c127c91e909226d3367f3c2
Reviewed-on: https://go-review.googlesource.com/21626
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Matthew Dempsky [Wed, 6 Apr 2016 19:01:40 +0000 (12:01 -0700)]
cmd: add new common architecture representation
Information about CPU architectures (e.g., name, family, byte
ordering, pointer and register size) is currently redundantly
scattered around the source tree. Instead consolidate the basic
information into a single new package cmd/internal/sys.
Also, introduce new sys.I386, sys.AMD64, etc. names for the constants
'8', '6', etc. and replace most uses of the latter. The notable
exceptions are a couple of error messages that still refer to the old
char-based toolchain names and function reltype in cmd/link.
Passes toolstash/buildall.
Change-Id: I8a6f0cbd49577ec1672a98addebc45f767e36461
Reviewed-on: https://go-review.googlesource.com/21623
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Hudson-Doyle [Wed, 6 Apr 2016 23:47:32 +0000 (11:47 +1200)]
runtime: clamp OS-reported number of processors to _MaxGomaxprocs
So that all Go processes do not die on startup on a system with >256 CPUs.
I tested this by hacking osinit to set ncpu to 1000.
Updates #15131
Change-Id: I52e061a0de97be41d684dd8b748fa9087d6f1aef
Reviewed-on: https://go-review.googlesource.com/21599
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Ryan Brown [Mon, 14 Mar 2016 16:23:04 +0000 (09:23 -0700)]
cmd/link: generate DWARF info using symbols
This updates dwarf.go to generate debug information as symbols
instead of directly writing to the output file. This should make
it easier to move generation of some of the debug info into the compiler.
Change-Id: Id2358988bfb689865ab4d68f82716f0676336df4
Reviewed-on: https://go-review.googlesource.com/20679
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Michael Munday [Mon, 21 Mar 2016 01:44:31 +0000 (21:44 -0400)]
math: add functions and stubs for s390x
Includes assembly implementations of Sqrt and Dim.
Change-Id: I57472e8d31e2ee74bcebf9f8e818f765eb9b8abf
Reviewed-on: https://go-review.googlesource.com/20936
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Robert Griesemer [Wed, 6 Apr 2016 22:27:30 +0000 (15:27 -0700)]
cmd/compile, go/importer: minor cleanups
Change-Id: I4ffb79d8cb08b0b44f59757fb7f0ec3ed1e4479f
Reviewed-on: https://go-review.googlesource.com/21624
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Josh Bleecher Snyder [Wed, 6 Apr 2016 21:12:48 +0000 (14:12 -0700)]
cmd/compile: move Type.Maplineno to separate data structure
Relatively few types are ever used as map keys,
so tracking this separately is a net win.
Passes toolstash -cmp.
name old alloc/op new alloc/op delta
Template 55.9MB ± 0% 55.5MB ± 0% -0.71% (p=0.000 n=10+10)
Unicode 37.8MB ± 0% 37.7MB ± 0% -0.27% (p=0.000 n=10+10)
GoTypes 180MB ± 0% 179MB ± 0% -0.52% (p=0.000 n=7+10)
Compiler 806MB ± 0% 803MB ± 0% -0.41% (p=0.000 n=10+10)
CPU and number of allocs are unchanged.
Change-Id: I6d60d74a4866995a231dfed3dd5792d75d904292
Reviewed-on: https://go-review.googlesource.com/21622
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Rob Pike [Tue, 5 Apr 2016 22:43:07 +0000 (15:43 -0700)]
bytes: add ContainsAny
This function is present in the strings package but missing from bytes,
and we would like to keep the two packages consistent.
Add it to bytes, and copy the test over as well.
Fixes #15140
Change-Id: I5dbd28da83a9fe741885794ed15f2af2f826cb3c
Reviewed-on: https://go-review.googlesource.com/21562
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Dave Cheney [Wed, 6 Apr 2016 08:43:23 +0000 (18:43 +1000)]
runtime: remove unused return value from lfstackUnpack
None of the two places that call lfstackUnpack use the second argument.
This simplifies a followup CL that merges the lfstack{Pack,Unpack}
implementations.
Change-Id: I3c93f6259da99e113d94f8c8027584da79c1ac2c
Reviewed-on: https://go-review.googlesource.com/21595
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Alexandru Moșoi [Mon, 4 Apr 2016 17:23:41 +0000 (19:23 +0200)]
cmd/compile: replaces ANDQ with MOV?ZX
Where possible replace ANDQ with MOV?ZX.
Takes care that we don't regress wrt bounds checking,
for example [1000]int{}[i&255].
According to "Intel 64 and IA-32 Architectures Optimization Reference
Manual" Section: "3.5.1.13 Zero-Latency MOV Instructions"
MOV?ZX instructions have zero latency on newer processors.
Updates #15105
Change-Id: I63539fdbc5812d5563aa1ebc49eca035bd307997
Reviewed-on: https://go-review.googlesource.com/21508
Reviewed-by: Айнар Гарипов <gugl.zadolbal@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Håvard Haugen [Wed, 3 Feb 2016 22:41:55 +0000 (23:41 +0100)]
encoding/json: respect json.Marshaler when encoding byte kind slices
Fixes #13783.
Change-Id: I0122c1f0cf4075acabf5f58241bded1835699dc1
Reviewed-on: https://go-review.googlesource.com/19725
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick [Wed, 6 Apr 2016 19:02:27 +0000 (19:02 +0000)]
net, runtime: skip flaky tests on OpenBSD
Flaky tests are a distraction and cover up real problems.
File bugs instead and mark them as flaky.
This moves the net/http flaky test flagging mechanism to internal/testenv.
Updates #15156
Updates #15157
Updates #15158
Change-Id: I0e561cd2a09c0dec369cd4ed93bc5a2b40233dfe
Reviewed-on: https://go-review.googlesource.com/21614
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Josh Bleecher Snyder [Sat, 2 Apr 2016 03:11:30 +0000 (20:11 -0700)]
cmd/compile: shrink gc.Type in half
Many of Type's fields are etype-specific.
This CL organizes them into their own auxiliary types,
duplicating a few fields as necessary,
and adds an Extra field to hold them.
It also sorts the remaining fields for better struct packing.
It also improves documentation for most fields.
This reduces the size of Type at the cost of some extra allocations.
There's no CPU impact; memory impact below.
It also makes the natural structure of Type clearer.
Passes toolstash -cmp on all architectures.
Ideas for future work in this vein:
(1) Width and Align probably only need to be
stored for Struct and Array types.
The refactoring to accomplish this would hopefully
also eliminate TFUNCARGS and TCHANARGS entirely.
(2) Maplineno is sparsely used and could probably better be
stored in a separate map[*Type]int32, with mapqueue updated
to store both a Node and a line number.
(3) The Printed field may be removable once the old (non-binary)
importer/exported has been removed.
(4) StructType's fields field could be changed from *[]*Field to []*Field,
which would remove a common allocation.
(5) I believe that Type.Nod can be moved to ForwardType. Separate CL.
name old alloc/op new alloc/op delta
Template 57.9MB ± 0% 55.9MB ± 0% -3.43% (p=0.000 n=50+50)
Unicode 38.3MB ± 0% 37.8MB ± 0% -1.39% (p=0.000 n=50+50)
GoTypes 185MB ± 0% 180MB ± 0% -2.56% (p=0.000 n=50+50)
Compiler 824MB ± 0% 806MB ± 0% -2.19% (p=0.000 n=50+50)
name old allocs/op new allocs/op delta
Template 486k ± 0% 497k ± 0% +2.25% (p=0.000 n=50+50)
Unicode 377k ± 0% 379k ± 0% +0.55% (p=0.000 n=50+50)
GoTypes 1.39M ± 0% 1.42M ± 0% +1.63% (p=0.000 n=50+50)
Compiler 5.52M ± 0% 5.57M ± 0% +0.84% (p=0.000 n=47+50)
Change-Id: I828488eeb74902b013d5ae4cf844de0b6c0dfc87
Reviewed-on: https://go-review.googlesource.com/21611
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Richard Miller [Wed, 6 Apr 2016 17:42:14 +0000 (18:42 +0100)]
test: make goprint.go wait for goroutine termination
Test goprint.go sometimes failed on a slow builder (plan9_arm)
because of timing dependency. Instead of sleeping for a fixed
time to allow the child goroutine to finish, wait explicitly for
child termination by calling runtime.NumGoroutine until the
returned value is 1.
Fixes #15097
Change-Id: Ib3ef5ec3c8277083c774542f48bcd4ff2f79efde
Reviewed-on: https://go-review.googlesource.com/21603
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Marcel van Lohuizen [Wed, 6 Apr 2016 13:01:50 +0000 (15:01 +0200)]
testing: fix flakey test on plan9
allow for more than 0.00s.
Fixes #15149
Change-Id: I1d428a9b3c9bb3d1db8682c53b86e44cecc1dde1
Reviewed-on: https://go-review.googlesource.com/21602
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Robert Griesemer [Wed, 6 Apr 2016 17:49:12 +0000 (10:49 -0700)]
cmd/gofmt: make gofmt -s simplify slices in presence of dot-imports
A dot-import cannot possibly introduce a `len` function since that
function would not be exported (it's lowercase). Furthermore, the
existing code already (incorrectly) assumed that there was no other
`len` function in another file of the package. Since this has been
an ok assumption for years, let's leave it, but remove the dot-import
restriction.
Fixes #15153.
Change-Id: I18fbb27acc5a5668833b4b4aead0cca540862b52
Reviewed-on: https://go-review.googlesource.com/21613
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Aliaksandr Valialkin [Tue, 5 Apr 2016 15:42:07 +0000 (18:42 +0300)]
icmd/vet: improved checking for variadic Println-like functions
- Automatically determine the first argument to check.
- Skip checking matching non-variadic functions.
- Skip checking matching functions accepting non-interface{}
variadic arguments.
- Removed fragile 'magic' code for special cases such as math.Log
and error interface.
Fixes #15067
Fixes #15099
Change-Id: Ib313557f18b12b36daa493f4b02c598b9503b55b
Reviewed-on: https://go-review.googlesource.com/21513
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Matthew Dempsky [Wed, 6 Apr 2016 06:01:10 +0000 (23:01 -0700)]
cmd/link: eliminate a bunch of open coded elf64/rela switches
We already have variables to track whether the target platform is
64-bit vs 32-bit or RELA vs REL, so no point in repeating the list of
obscure architecture characters everywhere.
Passes toolstash/buildall.
Change-Id: I6a07f74188ac592ef229a7c65848a9ba93013cdb
Reviewed-on: https://go-review.googlesource.com/21569
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Marcel van Lohuizen [Wed, 6 Apr 2016 07:59:32 +0000 (09:59 +0200)]
testing: fixed bug introduced by CL 21504
This broke T.Run
Change-Id: I12c8fe3612f3fa2caa83049c1c7003056daf2b0c
Reviewed-on: https://go-review.googlesource.com/21600
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Alex Brainman [Wed, 6 Apr 2016 06:11:22 +0000 (16:11 +1000)]
runtime: use windows.NewLazySystemDLL in mksyscall_windows.go
Change-Id: Ie4c4ff4167ee45ae93a8b764fb6197f402e7994d
Reviewed-on: https://go-review.googlesource.com/21593
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Konstantin Shaposhnikov [Tue, 5 Apr 2016 15:54:50 +0000 (23:54 +0800)]
cmd/vet: do not treat declaration as asignment in atomic check
Fixes #15118
Change-Id: Iad56ed412535c8ac0a01c4bd7769fd3d37688ac9
Reviewed-on: https://go-review.googlesource.com/21526
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Ross Light [Thu, 31 Mar 2016 21:57:49 +0000 (14:57 -0700)]
os/user: wrap getgrnam_r to fix type issues
Even with -D_POSIX_PTHREAD_SEMANTICS, Solaris seems to not define
getgrnam_r in a POSIX compatible way.
Fixes #14967
Change-Id: I78cb7e5b30b2d8b860e336060a0a06f4720c0475
Reviewed-on: https://go-review.googlesource.com/21385
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Dan Peterson [Wed, 6 Apr 2016 14:18:55 +0000 (11:18 -0300)]
net/http/pprof: note calling runtime.SetBlockProfileRate is required for block profile
Fixes #15076
Change-Id: I5ce8f6253245d8cc1f862a1bf618775f557f955d
Reviewed-on: https://go-review.googlesource.com/21610
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Keith Randall [Fri, 1 Apr 2016 18:05:30 +0000 (11:05 -0700)]
cmd/compile: fix x=x assignments
No point in doing anything for x=x assignments.
In addition, skipping these assignments prevents generating:
VARDEF x
COPY x -> x
which is bad because x is incorrectly considered
dead before the vardef.
Fixes #14904
Change-Id: I6817055ec20bcc34a9648617e0439505ee355f82
Reviewed-on: https://go-review.googlesource.com/21470
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Dave Cheney [Wed, 6 Apr 2016 05:19:12 +0000 (15:19 +1000)]
runtime: merge 64bit lfstack impls
Merge all the 64bit lfstack impls into one file, adjust build tags to
match.
Merge all the comments on the various lfstack implementations for
posterity.
lfstack_amd64.go can probably be merged, but it is slightly different so
that will happen in a followup.
Change-Id: I5362d5e127daa81c9cb9d4fa8a0cc5c5e5c2707c
Reviewed-on: https://go-review.googlesource.com/21591
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Brad Fitzpatrick [Wed, 6 Apr 2016 04:38:00 +0000 (04:38 +0000)]
os: consolidate os{1,2}_*.go files
Change-Id: I463ca59f486b2842f67f151a55f530ee10663830
Reviewed-on: https://go-review.googlesource.com/21568
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick [Wed, 6 Apr 2016 02:39:47 +0000 (02:39 +0000)]
runtime: rename os1_windows.go to os_windows.go
Change-Id: I11172f3d0e28f17b812e67a4db9cfe513b8e1974
Reviewed-on: https://go-review.googlesource.com/21565
Reviewed-by: Minux Ma <minux@golang.org>
Brad Fitzpatrick [Wed, 6 Apr 2016 02:38:45 +0000 (02:38 +0000)]
runtime: merge os{,2}_windows.go into os1_windows.go.
A future CL will rename os1_windows.go to os_windows.go.
Change-Id: I223e76002dd1e9c9d1798fb0beac02c7d3bf4812
Reviewed-on: https://go-review.googlesource.com/21564
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Michael Munday [Fri, 18 Mar 2016 23:02:52 +0000 (19:02 -0400)]
runtime: add s390x support (modified files only)
Change-Id: Ib79ad4a890994ad64edb1feb79bd242d26b5b08a
Reviewed-on: https://go-review.googlesource.com/20945
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Shenghou Ma [Wed, 6 Apr 2016 03:09:39 +0000 (23:09 -0400)]
runtime: get randomness from AT_RANDOM AUXV on linux/arm64
Fixes #15147.
Change-Id: Ibfe46c747dea987787a51eb0c95ccd8c5f24f366
Reviewed-on: https://go-review.googlesource.com/21580
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Michael Munday [Mon, 21 Mar 2016 01:41:07 +0000 (21:41 -0400)]
reflect: add s390x support
Change-Id: I1f975130179cf26af67e82664310b93d43e87a75
Reviewed-on: https://go-review.googlesource.com/20944
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick [Mon, 4 Apr 2016 16:54:54 +0000 (16:54 +0000)]
io: add ReadAtSizer interface
ReadAtSizer is a common abstraction for a stateless,
concurrently-readable fixed number of bytes.
This interface has existed in various codebases for over 3 years (previously
usually named SizeReaderAt). It is used inside Google in dl.google.com
(mentioned in https://talks.golang.org/2013/oscon-dl.slide) and other
packages. It is used in Camlistore, in Juju, in the Google API Go client, in
github.com/nightlyone/views, and 33 other pages of Github search results.
It is implemented by io.SectionReader, bytes.Reader, strings.Reader, etc.
Time to finally promote this interface to the standard library and give it a
standard name, blessing it as best practice.
Updates #7263
Updates #14889
Change-Id: Id28c0cafa7d2d37e8887c54708b5daf1b11c83ea
Reviewed-on: https://go-review.googlesource.com/21492
Reviewed-by: Rob Pike <r@golang.org>
Brad Fitzpatrick [Wed, 6 Apr 2016 02:52:17 +0000 (02:52 +0000)]
runtime: rename os1_linux.go to os_linux.go
Change-Id: I938f61763c3256a876d62aeb54ef8c25cc4fc90e
Reviewed-on: https://go-review.googlesource.com/21567
Reviewed-by: Minux Ma <minux@golang.org>
Brad Fitzpatrick [Wed, 6 Apr 2016 02:51:55 +0000 (02:51 +0000)]
runtime: merge os_linux.go into os1_linux.go
Change-Id: I791c47014fe69e8529c7b2f0b9a554e47902d46c
Reviewed-on: https://go-review.googlesource.com/21566
Reviewed-by: Minux Ma <minux@golang.org>
David Symonds [Wed, 6 Apr 2016 01:53:26 +0000 (11:53 +1000)]
expvar: Ensure strings are written as valid JSON.
Change-Id: I5147dbf4e85cf42cd1f32c57861e4c16d9dbd049
Reviewed-on: https://go-review.googlesource.com/21529
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Brad Fitzpatrick [Tue, 5 Apr 2016 17:24:23 +0000 (17:24 +0000)]
net/http: keep request context during Client redirects
Change-Id: I25c51280ba55120ffeaf08222f5ac5d471632d89
Reviewed-on: https://go-review.googlesource.com/21535
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Josh Bleecher Snyder [Tue, 5 Apr 2016 23:44:07 +0000 (16:44 -0700)]
cmd/compile: encapsulate reads of gc.Type.Funarg
Changes generated with eg and then manually
checked and in some cases simplified.
Passes toolstash -cmp.
Change-Id: I2119f37f003368ce1884d2863b406d6ffbfe38c7
Reviewed-on: https://go-review.googlesource.com/21563
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Brad Fitzpatrick [Tue, 5 Apr 2016 15:59:55 +0000 (15:59 +0000)]
net/http: document that Handlers shouldn't mutate Request
Also, don't read from the Request.Headers in the http Server code once
ServeHTTP has started. This is partially redundant with documenting
that handlers shouldn't mutate request, but: the space is free due to
bool packing, it's faster to do the checks once instead of N times in
writeChunk, and it's a little nicer to code which previously didn't
play by the unwritten rules. But I'm not going to fix all the cases.
Fixes #14940
Change-Id: I612a8826b41c8682b59515081c590c512ee6949e
Reviewed-on: https://go-review.googlesource.com/21530
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Brad Fitzpatrick [Tue, 5 Apr 2016 18:22:23 +0000 (18:22 +0000)]
runtime: minor Windows cleanup
Change-Id: I9a8081ef1109469e9577c642156aa635188d8954
Reviewed-on: https://go-review.googlesource.com/21538
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Brad Fitzpatrick [Tue, 5 Apr 2016 20:01:50 +0000 (20:01 +0000)]
net/http, net/http/httputil: start with capitals in deprecation sentences
Fixes #15139
Change-Id: I73111137907e612af871b77ccf166572bf78c840
Reviewed-on: https://go-review.googlesource.com/21544
Reviewed-by: Andrew Gerrand <adg@golang.org>
Matthew Dempsky [Tue, 5 Apr 2016 21:20:04 +0000 (14:20 -0700)]
cmd/compile: move a lot of declarations outside of go.go
go.go is currently a grab bag of various unrelated type and variable
declarations. Move a bunch of them into other more relevant source
files.
There are still more that can be moved, but these were the low hanging
fruit with obvious homes.
No code/comment changes. Just shuffling stuff around.
Change-Id: I43dbe1a5b8b707709c1a3a034c693d38b8465063
Reviewed-on: https://go-review.googlesource.com/21561
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Matthew Dempsky [Tue, 5 Apr 2016 19:48:49 +0000 (12:48 -0700)]
cmd/compile: add comments explaining how declarations/scopes work
Change-Id: I301760b015eb69ff12eee53473fdbf5e9f168413
Reviewed-on: https://go-review.googlesource.com/21542
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Brad Fitzpatrick [Tue, 5 Apr 2016 20:40:40 +0000 (20:40 +0000)]
crypto/rsa, crypto/ecdsa: fail earlier on zero parameters
Change-Id: Ia6ed49d5ef3a256a55e6d4eaa1b4d9f0fc447013
Reviewed-on: https://go-review.googlesource.com/21560
Reviewed-by: Robert Griesemer <gri@golang.org>
Marcel van Lohuizen [Mon, 4 Apr 2016 16:22:29 +0000 (18:22 +0200)]
testing: improve output
This introduces a few changes
- Skipped benchmarks now print a SKIP line, also if there was
no output
- The benchmark name is only printed if there the benchmark
was not skipped or did not fail in the probe phase.
It also fixes a bug of doubling a skip message in chatty mode in
absense of a failure.
The chatty flag is now passed in the common struct to allow
for testing of the printed messages.
Fixes #14799
Change-Id: Ia8eb140c2e5bb467e66b8ef20a2f98f5d95415d5
Reviewed-on: https://go-review.googlesource.com/21504
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Josh Bleecher Snyder [Mon, 4 Apr 2016 17:58:21 +0000 (10:58 -0700)]
cmd/compile: pull ssa OAPPEND expression handing into its own function
Pure code movement.
Change-Id: Ia07ee0b0041c931b08adf090f262a6f74a6fdb01
Reviewed-on: https://go-review.googlesource.com/21546
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Josh Bleecher Snyder [Mon, 4 Apr 2016 17:49:55 +0000 (10:49 -0700)]
cmd/compile: give TLS relocations a name when dumping assembly
Before:
...
0x00d0 ff ff ff e8 00 00 00 00 e9 23 ff ff ff cc cc cc .........#......
rel 5+4 t=14 +0
rel 82+4 t=13 runtime.writeBarrier+0
...
After:
...
0x00d0 ff ff ff e8 00 00 00 00 e9 23 ff ff ff cc cc cc .........#......
rel 5+4 t=14 TLS+0
rel 82+4 t=13 runtime.writeBarrier+0
...
Change-Id: Ibdaf694581b5fd5fb87fa8ce6a792f3eb4493622
Reviewed-on: https://go-review.googlesource.com/21545
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Joe Tsai [Tue, 5 Apr 2016 18:29:15 +0000 (11:29 -0700)]
os: deprecate os.SEEK_SET, os.SEEK_CUR, and os.SEEK_END
CL/19862 introduced the same set of constants to the io package.
We should steer users away from the os.SEEK* versions and towards
the io.Seek* versions.
Updates #6885
Change-Id: I96ec5be3ec3439e1295c937159dadaf1ebfb2737
Reviewed-on: https://go-review.googlesource.com/21540
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Robert Griesemer [Tue, 5 Apr 2016 18:17:57 +0000 (11:17 -0700)]
go/importer: match predeclared type list with gc's list in binary exporter
I think we had this code before but it may have gone lost somehow.
Change-Id: Ifde490e686de0d2bfe907cbe19c9197f24f5fa8e
Reviewed-on: https://go-review.googlesource.com/21537
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
David Chase [Tue, 1 Mar 2016 21:53:37 +0000 (16:53 -0500)]
cmd/compile: note escape of parts of closured-capture vars
Missed a case for closure calls (OCALLFUNC && indirect) in
esc.go:esccall.
Cleanup to runtime code for windows to more thoroughly hide
a technical escape. Also made code pickier about failing
to late non-optional kernel32.dll.
Fixes #14409.
Change-Id: Ie75486a2c8626c4583224e02e4872c2875f7bca5
Reviewed-on: https://go-review.googlesource.com/20102
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>