]> Cypherpunks repositories - gostls13.git/log
gostls13.git
5 years agoruntime: mark testCallersEqual as a test helper
Ian Lance Taylor [Tue, 7 Jan 2020 18:55:35 +0000 (10:55 -0800)]
runtime: mark testCallersEqual as a test helper

Change-Id: I25e6fb733618b0a7af8adc69be85f3503810acf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/213658
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
5 years agotest: add test that gccgo fails to compile
Ian Lance Taylor [Thu, 9 Jan 2020 01:50:52 +0000 (17:50 -0800)]
test: add test that gccgo fails to compile

Change-Id: I14d31bb62fd0e26a84f8781644c40918404f5f3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/213899
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agotime: remove unnecessary trailing slash from "/etc/"
Ian Lance Taylor [Mon, 20 Jan 2020 20:05:08 +0000 (12:05 -0800)]
time: remove unnecessary trailing slash from "/etc/"

Fixes #36640

Change-Id: I2049b572347da1cb967f5a3f2bc342b310216435
Reviewed-on: https://go-review.googlesource.com/c/go/+/215519
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoruntime: really wait for goroutines in testSemaHandoff
Ian Lance Taylor [Thu, 13 Feb 2020 04:17:16 +0000 (20:17 -0800)]
runtime: really wait for goroutines in testSemaHandoff

The code has a comment saying that it waited for the goroutines,
but it didn't actually do so.

Change-Id: Icaeb40613711053a9f443cc34143835560427dda
Reviewed-on: https://go-review.googlesource.com/c/go/+/219277
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/compile: allow print/println(f()) where f() is multi-value
Cuong Manh Le [Thu, 14 Nov 2019 03:00:33 +0000 (10:00 +0700)]
cmd/compile: allow print/println(f()) where f() is multi-value

Fixes #35576

Change-Id: Ia128f412120069e9f8813e9e910e62644f950bfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/207118
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
5 years agocrypto/tls: update ExampleDial with a valid root
Johan Jansson [Wed, 1 Jan 2020 16:48:22 +0000 (18:48 +0200)]
crypto/tls: update ExampleDial with a valid root

When run as a separate program, the code in ExampleDial panicked due to
an expired certificate. Fixed this problem by replacing the expired
certificate with a valid one.

Also added a comment in the certificate to give a hint about why it
might fail in the future.

Fixes #35706

Change-Id: I3d300f7bccae050e4b73ded28b8029aa04b480bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/212601
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years agocrypto/tls: clarify TLS 1.0/1.1 CertificateRequestInfo.SignatureSchemes
Filippo Valsorda [Thu, 21 Nov 2019 18:48:38 +0000 (13:48 -0500)]
crypto/tls: clarify TLS 1.0/1.1 CertificateRequestInfo.SignatureSchemes

This CL should not change the logic at all, but it took me a while to
figure out why we use these specific SignatureSchemes, so reformulate
the comment.

Change-Id: If519a58264209e6575417be07668e92ead0e772f
Reviewed-on: https://go-review.googlesource.com/c/go/+/208225
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
5 years agocmd/dist: test cgo internal linking PIE
Cherry Zhang [Sun, 9 Feb 2020 22:01:53 +0000 (17:01 -0500)]
cmd/dist: test cgo internal linking PIE

On platforms where internal linking PIE is supported, run
misc/cgo/test with that configuration.

Change-Id: Ia09631b07cc469c85818e1494093d802ea9d69a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/218838
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile/internal/syntax: better error when an assignment is used in value context
Robert Griesemer [Thu, 6 Feb 2020 23:32:40 +0000 (15:32 -0800)]
cmd/compile/internal/syntax: better error when an assignment is used in value context

The error message is now positioned at the statement position (which is
an identifing token, such as the '=' for assignments); and in case of
assignments it emphasizes the assignment by putting the Lhs and Rhs
in parentheses. Finally, the wording is changed from "use of * as value"
to the stronger "cannot use * as value" (for which there is precedent
elsewhere in the parser).

Fixes #36858.

Change-Id: Ic3f101bba50f58e3a1d9b29645066634631f2d61
Reviewed-on: https://go-review.googlesource.com/c/go/+/218337
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
5 years agocmd/link: also apply R_ADDR relocation statically when internal linking PIE
Cherry Zhang [Tue, 11 Feb 2020 23:26:38 +0000 (18:26 -0500)]
cmd/link: also apply R_ADDR relocation statically when internal linking PIE

When internal linking PIE, R_ADDR relocations cannot be resolved
statically so we generate dynamic relocations for it. We don't
apply the relocations statically, so the bytes in the file are
left unset (likely zero). This makes some tool that examines the
file statically, e.g. go version, to fail to find the referenced
addresses.

This CL makes the linker also apply the relocations to the file
content, so it holds the correct offsets and so can be examined
statically.

Fixes #37173.

Change-Id: Ia5c6b661f1a91a232843ca4224264bfd7a5509eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/219199
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agotest: close file in goFiles
Dmitri Shuralyov [Sun, 9 Feb 2020 00:43:58 +0000 (19:43 -0500)]
test: close file in goFiles

Brad's battery died on a plane and the file stayed open for 8 years
without anyone noticing. 😄

Someone noticed in https://github.com/gopherjs/gopherjs/pull/950.

Updates #2833

Change-Id: I46b28ac014a8c355be94e026615f119f96e5d51a
Reviewed-on: https://go-review.googlesource.com/c/go/+/218700
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years agocmd/link: handle absolute address relocation in C objects for internal linking PIE
Cherry Zhang [Sun, 9 Feb 2020 22:00:27 +0000 (17:00 -0500)]
cmd/link: handle absolute address relocation in C objects for internal linking PIE

For an absolute address relocation in C objects (e.g.
R_X86_64_64), we turn it into an R_ADDR relocation and handle it
the same way. For internal linking PIE, this R_ADDR relocation
cannot be resolved statically. We need to generate a dynamic
relocation for it. This CL makes it so.

This fixes internal linking PIE on the dev.boringcrypto branch.
Test will be enabled in the next CL.

Change-Id: I9bdd6517ccd79cbbe9c64844a31536bf3da37616
Reviewed-on: https://go-review.googlesource.com/c/go/+/218837
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile: preserve shift boundedness information in dec64
Josh Bleecher Snyder [Fri, 24 Jan 2020 06:21:39 +0000 (22:21 -0800)]
cmd/compile: preserve shift boundedness information in dec64

For clarity. No differences to generated code.

Change-Id: Ie4360681caac091eb82c59fb06e35b725b1850dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/217003
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agocmd/link: generate relative relocs for PIE
Michael Pratt [Fri, 6 Dec 2019 22:25:51 +0000 (17:25 -0500)]
cmd/link: generate relative relocs for PIE

Go's PIE binaries have tons of relocations, all R_X86_64_64 [1] when
internally linked. R_X86_64_64 relocations require symbol lookup in the
dynamic linker, which can be quite slow. The simple Go HTTP server
in #36028 takes over 1s to complete dynamic linking!

The external linker generates R_X86_64_RELATIVE [2] relocations, which
are significantly more efficient. It turns out that generating these
relocations internally is quite simple, so lets do it.

Rather than referencing targ.Dynid in r_info and having the dynamic
linker do a symbol lookup and then add (final targ address) + r.Add, use
AddAddrPlus to generate another R_ADDR to have the linker compute (targ
address + r.Add). The dynamic linker is then only left with base address
+ r_addend.

Since we don't reference the symbol in the final relocation, Adddynsym
is no longer necessary, saving ~1MB (of ~9MB) from the binary size of
the example in #36028.

[1] R_AARCH64_ABS64 on arm64.
[2] R_AARCH64_RELATIVE on arm64.

Fixes #36028

Change-Id: Ie0f4bb1d911f2e05ab46a0a0454c0f46ac01b43b
Reviewed-on: https://go-review.googlesource.com/c/go/+/210181
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: print a "found" line for each package found instead of each module added
Bryan C. Mills [Fri, 14 Feb 2020 15:23:44 +0000 (10:23 -0500)]
cmd/go: print a "found" line for each package found instead of each module added

We currently print a "go: finding" line for each missing package
during import resolution. However, we are only printing a "go: found"
line for each module: if a given module provides multiple packages, we
don't indicate the module that we found for the second and later
packages.

Before this change:

$ GO111MODULE=on go get golang.org/x/tools/cmd/html2article@78f9822548c13e2c41cc8039d1492a111240db07
go: found golang.org/x/tools/cmd/html2article in golang.org/x/tools v0.0.0-20190214195451-78f9822548c1
go: finding module for package golang.org/x/net/html
go: finding module for package golang.org/x/net/html/atom
go: downloading golang.org/x/net v0.0.0-20200202094626-16171245cfb2
go: found golang.org/x/net/html in golang.org/x/net v0.0.0-20200202094626-16171245cfb2

After:

$ GO111MODULE=on go get golang.org/x/tools/cmd/html2article@78f9822548c13e2c41cc8039d1492a111240db07
go: found golang.org/x/tools/cmd/html2article in golang.org/x/tools v0.0.0-20190214195451-78f9822548c1
go: finding module for package golang.org/x/net/html/atom
go: finding module for package golang.org/x/net/html
go: found golang.org/x/net/html in golang.org/x/net v0.0.0-20200202094626-16171245cfb2
go: found golang.org/x/net/html/atom in golang.org/x/net v0.0.0-20200202094626-16171245cfb2

Updates #26152
Updates #33284

Change-Id: I221548749e36bfd6a79efe5edc3645dc5319fd6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/219437
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
5 years agocmd/compile: use shift boundedness when lowering shifts on 386
Josh Bleecher Snyder [Fri, 24 Jan 2020 05:47:42 +0000 (21:47 -0800)]
cmd/compile: use shift boundedness when lowering shifts on 386

Minor improvements to generated code.

file                                          before   after    Δ       %
runtime.s                                     451117   450977   -140    -0.031%
compress/bzip2.s                              10202    10194    -8      -0.078%
compress/lzw.s                                5924     5904     -20     -0.338%
compress/flate.s                              45053    45032    -21     -0.047%
net.s                                         236980   236970   -10     -0.004%
vendor/golang.org/x/crypto/cryptobyte.s       29450    29439    -11     -0.037%
crypto/x509.s                                 107854   107840   -14     -0.013%
cmd/vendor/golang.org/x/arch/arm64/arm64asm.s 102448   102434   -14     -0.014%
cmd/internal/obj/arm.s                        60536    60528    -8      -0.013%
cmd/vendor/golang.org/x/mod/sumdb/tlog.s      38273    38276    +3      +0.008%
net/http.s                                    462215   462201   -14     -0.003%
cmd/compile/internal/ssa.s                    3951732  3954683  +2951   +0.075%
total                                         16946051 16948745 +2694   +0.016%

Change-Id: I9f6df1a90a295dce6fe86c8eb7576a8c96f8bb0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/217000
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agoCONTRIBUTORS: second round of updates for Go 1.14
Dmitri Shuralyov [Fri, 21 Feb 2020 19:24:31 +0000 (14:24 -0500)]
CONTRIBUTORS: second round of updates for Go 1.14

This update was automatically generated using the updatecontrib command:

cd gotip
go run golang.org/x/build/cmd/updatecontrib

With minor manual changes based on publicly available information
to canonicalize letter case and formatting for a few names.

Actions taken (relative to CONTRIBUTORS at origin/master):

Added Aaron Bieber <deftly@gmail.com>
Added Adam Williams <pwnfactory@gmail.com>
Added Ayke van Laethem <aykevanlaethem@gmail.com>
Added Bradford Lamson-Scribner <brad.lamson@gmail.com>
Added Brian Falk <falk@logicparty.org>
Added Chen Zhihan <energiehund@gmail.com>
Added Christopher Loessl <cloessl+github@gmail.com>
Added Frederik Zipp <fzipp@gmx.de>
Added Fujimoto Kyosuke <kyoro.f@gmail.com>
Added GitHub User jopbrown (6345470) <msshane2008@gmail.com>
Added GitHub User yah01 (12216890) <kagaminehuan@gmail.com>
Added Hiromichi Ema <ema.hiro@gmail.com>
Added Jamal Carvalho <jamal.a.carvalho@gmail.com>
Added Jason Baker <jason-baker@users.noreply.github.com>
Added Kanta Ebihara <kantaebihara@gmail.com>
Added Kirill Tatchihin <kirabsuir@gmail.com>
Added Kévin Dunglas <dunglas@gmail.com>
Added Mariano Cano <mariano@smallstep.com>
Added Sergey Ivanov <ser1325@gmail.com>
Added Thomas Symborski <thomas.symborski@gmail.com>
Added Tomohiro Kusumoto <zabio1192@gmail.com>
Added Xingqang Bai <bxq2011hust@qq.com>
Used GitHub User jopbrown (6345470) form for jopbrown <msshane2008@gmail.com> https://github.com/golang/exp/commit/0405dc7 [exp]
Used GitHub User yah01 (12216890) form for yah01 <kagaminehuan@gmail.com> https://github.com/golang/go/commit/ee55dd6b64 [go]
Used GitHub name "Hiromichi Ema" for emahiro <ema.hiro@gmail.com> https://github.com/golang/tools/commit/b6336cbc [tools]
Used GitHub name "Jamal Carvalho" for Gopher <jamal.a.carvalho@gmail.com> https://github.com/golang/gddo/commit/31dd61d [gddo]
Used GitHub name "Xingqang Bai" for bxq2011hust <bxq2011hust@qq.com> https://github.com/golang/go/commit/79ccbe1b67 [go]

Updates #12042

Change-Id: I13f8ab37f8b38f8f5d0ff71c939ad39d0bc4f985
Reviewed-on: https://go-review.googlesource.com/c/go/+/220363
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: add a regression test for package import cycles guarded by build tags
Bryan C. Mills [Mon, 3 Feb 2020 18:40:14 +0000 (13:40 -0500)]
cmd/go: add a regression test for package import cycles guarded by build tags

I've been thinking about the relationship between the package import
graph and the module import graph, and realized that the package
import graph is not always acyclic. (The package import graph must be
acyclic given a specific set of build tags, but the 'mod' subcommands
intentionally ignore build tags.)

I'm not sure whether we have any existing regression tests that cover
this sort of cycle, so I'm adding one now. Thankfully, it passes!

Updates #36460

Change-Id: I7679320994ee169855241efa51cd45f71315f7f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/217557
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocrypto/ecdsa: add SignASN1, VerifyASN1
Katie Hockman [Wed, 5 Feb 2020 20:19:41 +0000 (15:19 -0500)]
crypto/ecdsa: add SignASN1, VerifyASN1

Update the Example in the crypto/ecdsa package for signing
and verifying signatures to use these new functions.

This also changes (*PrivateKey).Sign to use
x/crypto/cryptobyte/asn1 instead of encoding/asn1
to marshal the signature.

Fixes #20544

Change-Id: I3423cfc4d7f9e1748fbed5a631438c8a3b280df4
Reviewed-on: https://go-review.googlesource.com/c/go/+/217940
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years agonet/http/pprof: set content type for /debug/pprof
Hana (Hyang-Ah) Kim [Thu, 20 Feb 2020 22:25:33 +0000 (17:25 -0500)]
net/http/pprof: set content type for /debug/pprof

Fixes #37311

Change-Id: I9e1f37e991e5c203fe72061692f47584fbadfc58
Reviewed-on: https://go-review.googlesource.com/c/go/+/220324
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years agodatabase/sql: add SetConnMaxIdleTime
Daniel Theophanes [Mon, 29 Oct 2018 16:09:21 +0000 (09:09 -0700)]
database/sql: add SetConnMaxIdleTime

Allow removing a connection from the connection pool after
it has been idle for a period of time, without regard to the
total lifespan of the connection.

Fixes #25232

Change-Id: Icff157b906769a2d2d45c67525e04a72feb8d832
Reviewed-on: https://go-review.googlesource.com/c/go/+/145758
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agoio: check n in testReadAtLeast
Davor Kapsa [Sat, 25 Jan 2020 13:40:10 +0000 (14:40 +0100)]
io: check n in testReadAtLeast

Change-Id: I53859d4d3c729cce9f73b14dc2dd8571f7e7ffb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/216457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agogo/constant: remove redundant octal & separator literals parsing
vovapi [Fri, 17 Jan 2020 16:38:39 +0000 (16:38 +0000)]
go/constant: remove redundant octal & separator literals parsing

Octal literals parsing was implemented in strconv in golang.org/cl/160244
and in math/big in golang.org/cl/165898.
Underscore separator parsing was implemented in strconv in golang.org/cl/160243
and in math/big golang.org/cl/166157.
Thus octal & underscore literal parsing in go/constant is removed as redundant.

This CL resolves TODO left by gri in golang.org/cl/160239 .

Change-Id: I311872dac49b1a13063e0abc1794001956620c5a
GitHub-Last-Rev: 264caf574e8dee8f1e36d9e62edb0ee3ff60d2d1
GitHub-Pull-Request: golang/go#36630
Reviewed-on: https://go-review.googlesource.com/c/go/+/215277
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agocontainer/list: remove temporary variable `n`
Joe Kyo [Wed, 13 Nov 2019 06:47:41 +0000 (00:47 -0600)]
container/list: remove temporary variable `n`

The variable `n` for saving the pointer of the next
element when insert new element into the list turns
out to be unnecessary.

Change-Id: I17b85fd8350738815c320a83945525b60c2f04c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/207037
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agocmd/compile: add a script to measure ssa/gen's coverage
Daniel Martí [Sat, 4 Jan 2020 10:45:38 +0000 (19:45 +0900)]
cmd/compile: add a script to measure ssa/gen's coverage

Since rulegen is only tested by inspecting and running its output code,
we have no good way to see if any chunks of its source are actually
being unused.

Code coverage only works as part of 'go test', since it needs to
instrument our code. Add a script that sets up a tiny test for that
purpose, with a quick example on how to use it.

We need to use a script, because there's no other way to make this work
without breaking 'go run *.go'. It's far more common to run the
generator than to obtain a coverage profile, so this solution seems like
the right tradeoff, and we don't break existing users.

The script isn't terribly portable, but that's okay for now.

At the time of wriging, coverage sits at 89.7%. I've manually skimmed
main.go and rulegen.go, and practically all unused code is either error
handling, or optional code like *genLog and "if false". A couple of
small exceptions stand out, though I'm not paying attention to them in
this CL.

While at it, inline a couple of tiny unusedInspector methods that were
only needed once or twice.

Change-Id: I78c5fb47c8536d70e546a437637d4428ec7adfaa
Reviewed-on: https://go-review.googlesource.com/c/go/+/212760
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocrypto/x509: correct error message for trailing issuer data
Alexander Rakoczy [Tue, 26 Nov 2019 18:45:15 +0000 (13:45 -0500)]
crypto/x509: correct error message for trailing issuer data

The error message for trailing data after the X.509 issuer should
correctly state "issuer" instead of "subject", which appears just above
this code.

Fixes #35841

Change-Id: Iea2605ce97f2b084eb78e88f2c27d7d43749d022
Reviewed-on: https://go-review.googlesource.com/c/go/+/208978
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
5 years agodoc/go1.14: document the change to json.Number decoding
Daniel Martí [Thu, 20 Feb 2020 20:44:18 +0000 (20:44 +0000)]
doc/go1.14: document the change to json.Number decoding

It might break a program if it was depending on undocumented behavior.
Give a proper heads up.

Fixes #37308.

Change-Id: Id65bc70def1138d5506b694329c52250b417ec6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/220418
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agonet/mail: skip empty entries in parseAddressList
Timmy Douglas [Sat, 1 Feb 2020 22:14:30 +0000 (22:14 +0000)]
net/mail: skip empty entries in parseAddressList

RFC 5322 has a section 4.4 where it says that address-list could
have "null" members: "That is, there could be two or more commas in
such a list with nothing in between them, or commas at the beginning
or end of the list." This change handles such a case so that mail
clients using this method on actual email messages get a reasonable
return value when they parse email.

Fixes #36959

Change-Id: I3ca240969935067262e3d751d376a06db1fef2a2
GitHub-Last-Rev: b96a9f2c075dfd67c3ff7b8ae0c12e12035f0da0
GitHub-Pull-Request: golang/go#36966
Reviewed-on: https://go-review.googlesource.com/c/go/+/217377
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agotesting: testing: add (*T).Deadline method for test timeout
Bryan C. Mills [Wed, 23 Oct 2019 14:54:09 +0000 (10:54 -0400)]
testing: testing: add (*T).Deadline method for test timeout

Fixes #28135

Change-Id: I62818595eaf4a59d8b5c26cd6848c08fec795ad1
Reviewed-on: https://go-review.googlesource.com/c/go/+/202758
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/compile: clarify division bounds check optimization
Josh Bleecher Snyder [Fri, 24 Jan 2020 06:18:30 +0000 (22:18 -0800)]
cmd/compile: clarify division bounds check optimization

The name of the function should mention division.
Eliminate double negatives from the comment describing it.

Change-Id: Icef1a5139b3a91b86acb930af97938f5160f7342
Reviewed-on: https://go-review.googlesource.com/c/go/+/217001
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agocmd/compile: coalesce some 386 shift lowering rules
Josh Bleecher Snyder [Fri, 24 Jan 2020 05:45:11 +0000 (21:45 -0800)]
cmd/compile: coalesce some 386 shift lowering rules

No changes to generated rule matching code.

Change-Id: I0009146a6be30e151a403c4801c03abf0646703d
Reviewed-on: https://go-review.googlesource.com/c/go/+/216999
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agocmd/compile: preserve shift boundness during wasm rewrite rules
Josh Bleecher Snyder [Fri, 24 Jan 2020 01:45:54 +0000 (17:45 -0800)]
cmd/compile: preserve shift boundness during wasm rewrite rules

Mostly for clarity. There are nominal improvements to the generated code:

file      before    after     Δ       %
addr2line 4742769   4742639   -130    -0.003%
api       6973284   6973209   -75     -0.001%
asm       5922230   5922127   -103    -0.002%
buildid   3117327   3117252   -75     -0.002%
cgo       5539274   5539199   -75     -0.001%
compile   27423605  27424940  +1335   +0.005%
cover     6096973   6096898   -75     -0.001%
dist      4121655   4121580   -75     -0.002%
doc       5386254   5386179   -75     -0.001%
fix       3755243   3755168   -75     -0.002%
link      7602682   7602607   -75     -0.001%
nm        4687186   4687056   -130    -0.003%
objdump   5184883   5184753   -130    -0.003%
pack      2511360   2511285   -75     -0.003%
pprof     16872050  16871832  -218    -0.001%
test2json 3060633   3060558   -75     -0.002%
trace     13170181  13170018  -163    -0.001%
vet       9865995   9865920   -75     -0.001%
total     151188868 151188504 -364    -0.000%

Change-Id: If765e3661549d183a2dbb44e83521c4a3f61d175
Reviewed-on: https://go-review.googlesource.com/c/go/+/216998
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agocmd/compile: add rule location to some rulegen logging
Josh Bleecher Snyder [Wed, 22 Jan 2020 17:59:24 +0000 (09:59 -0800)]
cmd/compile: add rule location to some rulegen logging

This requires threading location information through varCount.

This provides much more useful error messages.

Change-Id: If5ff942cbbbf386724eda15a523c181c137fac20
Reviewed-on: https://go-review.googlesource.com/c/go/+/216221
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agocmd/compile: remove chunking of rewrite rules
Josh Bleecher Snyder [Wed, 22 Jan 2020 04:53:30 +0000 (20:53 -0800)]
cmd/compile: remove chunking of rewrite rules

We added chunking of rewrite rules to speed up compiling package SSA.
This series of changes has significantly shrunk the number of
rewrite rules, and they are no longer being added nearly as fast.
Now that we are sharing v.Args across multiple rewrite rules,
there is additional benefit to having more rules in a single function.
Removing chunking now has an incidental impact on compiling package SSA,
marginally speeds up other compilation, shrinks the cmd/compile binary,
and simplifies the code.

name        old time/op       new time/op       delta
Template          211ms ± 2%        210ms ± 2%  -0.50%  (p=0.000 n=91+97)
Unicode          81.9ms ± 3%       81.8ms ± 3%    ~     (p=0.179 n=96+91)
GoTypes           731ms ± 2%        731ms ± 1%    ~     (p=0.442 n=94+96)
Compiler          3.43s ± 2%        3.41s ± 2%  -0.36%  (p=0.001 n=98+94)
SSA               8.30s ± 2%        8.32s ± 2%  +0.19%  (p=0.034 n=94+95)
Flate             135ms ± 2%        134ms ± 1%  -0.30%  (p=0.006 n=98+94)
GoParser          167ms ± 1%        167ms ± 1%  -0.22%  (p=0.001 n=92+94)
Reflect           453ms ± 2%        453ms ± 3%    ~     (p=0.306 n=98+97)
Tar               184ms ± 2%        183ms ± 2%  -0.31%  (p=0.012 n=94+94)
XML               249ms ± 2%        248ms ± 1%  -0.26%  (p=0.002 n=96+92)
[Geo mean]        419ms             418ms       -0.21%

name        old user-time/op  new user-time/op  delta
Template          273ms ± 2%        272ms ± 2%  -0.46%  (p=0.000 n=93+96)
Unicode           116ms ± 4%        117ms ± 4%    ~     (p=0.433 n=98+98)
GoTypes           977ms ± 2%        977ms ± 1%    ~     (p=0.971 n=92+99)
Compiler          4.56s ± 6%        4.53s ± 6%    ~     (p=0.081 n=100+100)
SSA               11.1s ± 2%        11.1s ± 2%    ~     (p=0.064 n=99+96)
Flate             167ms ± 2%        167ms ± 1%  -0.24%  (p=0.004 n=95+96)
GoParser          203ms ± 1%        203ms ± 2%  -0.14%  (p=0.049 n=96+97)
Reflect           595ms ± 2%        595ms ± 2%    ~     (p=0.544 n=95+92)
Tar               225ms ± 2%        224ms ± 2%    ~     (p=0.562 n=99+99)
XML               312ms ± 2%        311ms ± 1%    ~     (p=0.050 n=97+93)
[Geo mean]        543ms             542ms       -0.13%

Change-Id: I8d34ab59f154b28f20c6f9e416b976bfce339baa
Reviewed-on: https://go-review.googlesource.com/c/go/+/216220
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: extract function for splitting up x:(Foo) in rewrite rule fragments
Josh Bleecher Snyder [Wed, 22 Jan 2020 05:44:54 +0000 (21:44 -0800)]
cmd/compile: extract function for splitting up x:(Foo) in rewrite rule fragments

We had three implementations.

Refactor, and document the shared implementation.

While we're here, improve the docs for func unbalanced.

Change-Id: I612cce79de15a864247afe377d3739d04a56b9bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/216219
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agocmd/compile: reduce bounds checks in generated rewrite rules
Josh Bleecher Snyder [Tue, 21 Jan 2020 04:09:41 +0000 (20:09 -0800)]
cmd/compile: reduce bounds checks in generated rewrite rules

CL 213703 converted generated rewrite rules for commutative ops
to use loops instead of duplicated code.

However, it loaded args using expressions like
v.Args[i] and v.Args[i^1], which the compiler could
not eliminate bounds for (including with all outstanding
prove CLs).

Also, given a series of separate rewrite rules for the same op,
we generated bounds checks for every rewrite rule, even though
we were repeatedly loading the same set of args.

This change reduces both sets of bounds checks.

Instead of loading v.Args[i] and v.Args[i^1] for commutative loops,
we now preload v.Args[0] and v.Args[1] into local variables,
and then swap them (as needed) in the commutative loop post statement.

And we now load all top level v.Args into local variables
at the beginning of every rewrite rule function.

The second optimization is the more significant,
but the first helps a little, and they play together
nicely from the perspective of generating the code.

This does increase register pressure, but the reduced bounds
checks more than compensate.

Note that the vast majority of rewrite rules evaluated
are not applied, so the prologue is the most important
part of the rewrite rules.

There is one subtle aspect to the new generated code.
Because the top level v.Args are shared across rewrite rules,
and rule evaluation can swap v_0 and v_1, v_0 and v_1
can end up being swapped from one rule to the next.
That is OK, because any time a rule does not get applied,
they will have been swapped exactly twice.

Passes toolstash-check -all.

name        old time/op       new time/op       delta
Template          213ms ± 2%        211ms ± 2%  -0.85%  (p=0.000 n=92+96)
Unicode          83.5ms ± 2%       83.2ms ± 2%  -0.41%  (p=0.004 n=95+90)
GoTypes           737ms ± 2%        733ms ± 2%  -0.51%  (p=0.000 n=91+94)
Compiler          3.45s ± 2%        3.43s ± 2%  -0.44%  (p=0.000 n=99+100)
SSA               8.54s ± 1%        8.32s ± 2%  -2.56%  (p=0.000 n=96+99)
Flate             136ms ± 2%        135ms ± 1%  -0.47%  (p=0.000 n=96+96)
GoParser          169ms ± 1%        168ms ± 1%  -0.33%  (p=0.000 n=96+93)
Reflect           456ms ± 3%        455ms ± 3%    ~     (p=0.261 n=95+94)
Tar               186ms ± 2%        185ms ± 2%  -0.48%  (p=0.000 n=94+95)
XML               251ms ± 1%        250ms ± 1%  -0.51%  (p=0.000 n=91+94)
[Geo mean]        424ms             421ms       -0.68%

name        old user-time/op  new user-time/op  delta
Template          275ms ± 1%        274ms ± 2%  -0.55%  (p=0.000 n=95+98)
Unicode           118ms ± 4%        118ms ± 4%    ~     (p=0.642 n=98+90)
GoTypes           983ms ± 1%        980ms ± 1%  -0.30%  (p=0.000 n=93+93)
Compiler          4.56s ± 6%        4.52s ± 6%  -0.72%  (p=0.003 n=100+100)
SSA               11.4s ± 1%        11.1s ± 1%  -2.50%  (p=0.000 n=96+97)
Flate             168ms ± 1%        167ms ± 1%  -0.49%  (p=0.000 n=92+92)
GoParser          204ms ± 1%        204ms ± 2%  -0.27%  (p=0.003 n=99+96)
Reflect           599ms ± 2%        598ms ± 2%    ~     (p=0.116 n=95+92)
Tar               227ms ± 2%        225ms ± 2%  -0.57%  (p=0.000 n=95+98)
XML               313ms ± 2%        312ms ± 1%  -0.37%  (p=0.000 n=89+95)
[Geo mean]        547ms             544ms       -0.61%

file    before    after     Δ       %
compile 21113112  21109016  -4096   -0.019%
total   131704940 131700844 -4096   -0.003%

Change-Id: Id6c39e0367e597c0c75b8a4b1eb14cc3cbd11956
Reviewed-on: https://go-review.googlesource.com/c/go/+/216218
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: use ellipses in AMD64 rules
Josh Bleecher Snyder [Thu, 20 Feb 2020 21:52:02 +0000 (13:52 -0800)]
cmd/compile: use ellipses in AMD64 rules

file    before    after     Δ       %
compile 20801800  20743944  -57856  -0.278%
total   131542652 131484796 -57856  -0.044%

file                       before    after     Δ       %
cmd/compile/internal/ssa.a 23321562  23177930  -143632 -0.616%
total                      125602774 125459142 -143632 -0.114%

Change-Id: I3bdcff87e76d95a4367738a55316bd561c719c5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/220349
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/compile: add ellipsis syntax for op-only rewrite rules
Josh Bleecher Snyder [Wed, 8 Jan 2020 01:18:33 +0000 (17:18 -0800)]
cmd/compile: add ellipsis syntax for op-only rewrite rules

This change introduces a new syntax for rewrite rules
that only change a Value's Op. See #36380 for more discussion.

Updating rewrite rules to use ellipses will happen
in follow-up CLs.

Change-Id: I8c56e85de24607579d79729575c89ca80805ba5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/213898
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: dump contents when rulegen generates invalid code
Josh Bleecher Snyder [Tue, 21 Jan 2020 20:23:20 +0000 (12:23 -0800)]
cmd/compile: dump contents when rulegen generates invalid code

It's much easier to debug when you can see
the contents in order to interpret the error message.

Change-Id: I03bbb9dd3071aeca9577cc725a60d43f78118cf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/215717
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
5 years agocmd/compile: document non-commutative rule detection
Josh Bleecher Snyder [Tue, 21 Jan 2020 03:42:11 +0000 (19:42 -0800)]
cmd/compile: document non-commutative rule detection

This documentation was lost in CL 213703.
This change restores it.

Change-Id: I544f15771d8a7390893efbda93478b46095ccf3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/215541
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/go: convert TestExecutableGOROOT to the script framework
Michael Matloob [Thu, 20 Feb 2020 20:49:25 +0000 (15:49 -0500)]
cmd/go: convert TestExecutableGOROOT to the script framework

Part of converting all tests to the script framework, but also
just working around flakiness when adding t.Parallel to
TestExecutableGOROOT.

Also, undo the changes to copyFile in golang.org/cl/220317 because
they didn't help.

Fixes #37306

Change-Id: I3348fa1d8f2589febe89604ac19a21df20075c4c
Reviewed-on: https://go-review.googlesource.com/c/go/+/220319
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/go: in tests, add sync before closing file in copyFile helper
Michael Matloob [Thu, 20 Feb 2020 17:53:32 +0000 (12:53 -0500)]
cmd/go: in tests, add sync before closing file in copyFile helper

An experiment to see if this helps flakiness go away in
TestExecutableGOROOT.

Updates #37306

Change-Id: I2f4f63bdb507359ca07267d86cdb41fe4968f151
Reviewed-on: https://go-review.googlesource.com/c/go/+/220317
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/trace: update to use WebComponents V0 polyfill
Hana (Hyang-Ah) Kim [Wed, 19 Feb 2020 03:41:20 +0000 (22:41 -0500)]
cmd/trace: update to use WebComponents V0 polyfill

Old trace viewer stopped working with Chrome M80+ because the
old trace viewer heavily depended on WebComponents V0 which are deprecated.
Trace viewer recently migrated to use WebComponents V0 polyfill
(crbug.com/1036492). This CL brings in the newly updated trace_viewer_full.html
(sync'd @ 9508452e)
and updates the javascript snippet included in the /trace endpoint
to use the polyfill.

This brings in webcomponents.min.js copied from
https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962/third_party/polymer/components/webcomponentsjs/webcomponents.min.js

That is necessary because the /trace endpoint needs to import
the vulcanized trace_viewer_full.html.

It's possible that some features are not working correctly with
this polyfill. In that case, report the issue to crbug.com/1036492.
There will be a warning message in the UI (yellow banner above the timeline)
which can be hidden by clicking the 'hide' button.

This allows to render the trace in browsers other than chrome in theory,
but I observed some buttons and functions still don't work outside
chrome.

Fixes #34374.

Change-Id: Ib575f756f5e6b22ad904ede6e4d224a995ebe259
Reviewed-on: https://go-review.googlesource.com/c/go/+/219997
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agocmd/compile: normalize whitespace around square brackets
Josh Bleecher Snyder [Tue, 7 Jan 2020 22:30:17 +0000 (14:30 -0800)]
cmd/compile: normalize whitespace around square brackets

I noticed some instances of "[ " and " ]" in the rewrite rules.
Normalizing them helps catch possible future duplicate rules.

Change-Id: I892fd7e9b4019ed304f0a61fa2bb7f7e47ef8f38
Reviewed-on: https://go-review.googlesource.com/c/go/+/213682
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/compile: merge more shifts into stores
Josh Bleecher Snyder [Tue, 7 Jan 2020 21:41:02 +0000 (13:41 -0800)]
cmd/compile: merge more shifts into stores

Updates #36223

(Might fix #36223. I'm not sure whether there are more outstanding.)

This helps a bit, but not as much as I'd expected/hoped.

file                                      before  after   Δ       %
runtime.s                                 477286  477256  -30     -0.006%
bytes.s                                   31089   31085   -4      -0.013%
time.s                                    83561   83547   -14     -0.017%
strings.s                                 43284   43280   -4      -0.009%
compress/flate.s                          51374   51295   -79     -0.154%
math/big.s                                184283  184256  -27     -0.015%
crypto/elliptic.s                         51649   51577   -72     -0.139%
crypto/sha512.s                           8661    8644    -17     -0.196%
crypto/sha1.s                             6975    6959    -16     -0.229%
crypto/sha256.s                           6412    6393    -19     -0.296%
vendor/golang.org/x/text/unicode/bidi.s   27158   27146   -12     -0.044%
vendor/golang.org/x/text/unicode/norm.s   66802   66788   -14     -0.021%
net/http.s                                560936  560929  -7      -0.001%
text/template.s                           96475   96467   -8      -0.008%
go/parser.s                               80284   80280   -4      -0.005%
text/tabwriter.s                          9618    9611    -7      -0.073%
go/printer.s                              78502   78499   -3      -0.004%
go/types.s                                321815  321807  -8      -0.002%
internal/xcoff.s                          23175   23171   -4      -0.017%
image/jpeg.s                              36609   36587   -22     -0.060%
cmd/vendor/golang.org/x/arch/x86/x86asm.s 81274   81001   -273    -0.336%
cmd/internal/obj.s                        115184  115126  -58     -0.050%
cmd/internal/obj/arm64.s                  151502  151487  -15     -0.010%
cmd/internal/obj/s390x.s                  128054  128046  -8      -0.006%
cmd/internal/obj/wasm.s                   44295   44291   -4      -0.009%
cmd/compile/internal/ssa.s                4201992 4209504 +7512   +0.179%
cmd/compile/internal/gc.s                 1555029 1555011 -18     -0.001%
total                                     9792875 9799640 +6765   +0.069%

Change-Id: If4a857c0953a766578e68aa299b112a20d9b2b86
Reviewed-on: https://go-review.googlesource.com/c/go/+/213704
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: use loops to handle commutative ops in rules
Josh Bleecher Snyder [Tue, 7 Jan 2020 06:24:02 +0000 (22:24 -0800)]
cmd/compile: use loops to handle commutative ops in rules

Prior to this change, we generated additional rules at rulegen time
for all possible combinations of args to commutative ops.
This is simple and works well, but leads to lots of generated rules.
This in turn has increased the size of the compiler,
made it hard to compile package ssa on small machines,
and provided a disincentive to mark some ops as commutative.

This change reworks how we handle commutative ops.
Instead of generating a rule per argument permutation,
we generate a series of nested loops, one for each commutative op.
Each loop tries both possible argument orderings.

I also considered attempting to canonicalize the inputs to the
rewrite rules. However, because either or both arguments might be
nothing more than an identifier, and because there can be arbitrary
conditions to evaluate during matching, I did not see how to proceed.

The duplicate rule detection now sorts arguments to commutative ops,
so that it can detect commutative-only duplicates.

There may be further optimizations to the new generated code.
In particular, we may not be removing as many bounds checks as before;
I have not investigated deeply. If more work here is needed,
we could do it with more hints or with improvements to the prove pass.

This change has almost no impact on the generated code.
It does not pass toolstash-check, however. In a handful of functions,
for reasons I do not understand, there are minor position changes.

For the entire series ending at this change,
there is negligible compiler performance impact.

The compiler binary shrinks by about 15%,
and package ssa shrinks by about 25%.
Package ssa also compiles ~25% faster with ~25% less memory.

Change-Id: Ia2ee9ceae7be08a17342319d4e31b0bb238a2ee4
Reviewed-on: https://go-review.googlesource.com/c/go/+/213703
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agogo/internal/gcimporter: rename file to better reflect new meaning
Robert Griesemer [Thu, 18 Oct 2018 00:20:26 +0000 (17:20 -0700)]
go/internal/gcimporter: rename file to better reflect new meaning

Also: Removed unused deref function.

Follow-up on https://golang.org/cl/143023.

Updates #27999.

Change-Id: I088265f0e3ce52029679407f0b84b734191d4d3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/143024
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.15: create go1.15.html
Bryan C. Mills [Thu, 20 Feb 2020 14:31:04 +0000 (09:31 -0500)]
doc/go1.15: create go1.15.html

Copied from go1.14.html, with changes redacted back to TODOs following
the model of CL 195058.

'relnote -html' does not report any changes at this time.

Updates #33738

Change-Id: I580232805ab7db35935f3e1ba03b720be4796a7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/220278
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/compile: generate commutative rules when a condition is present
Josh Bleecher Snyder [Tue, 7 Jan 2020 07:45:57 +0000 (23:45 -0800)]
cmd/compile: generate commutative rules when a condition is present

The commutative rule generator has an optimization
where given (Add x y) with no other uses of x and y in the matching rule,
it doesn't generate the commutative match (Add y x).

However, if there is also a condition referring to x or y,
such as (Add x y) && isFoo(x), then we should generate the commutative rule.
This change parses the condition, extracts all idents, and takes them
into consideration.

This doesn't yield any new optimizations now.
However, it is the right thing to do;
otherwise we'll have to track it down and fix it again later.

It is also expensive now, in terms of additional generated code.
However, it will be much, much less expensive soon,
once our generated code for commutative ops gets smaller.

Change-Id: I52c2016c884bbc7789bf8dfe9b9c56061bc028ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/213702
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: mark amd64 HMUL ops as not commutative
Josh Bleecher Snyder [Tue, 7 Jan 2020 17:27:18 +0000 (09:27 -0800)]
cmd/compile: mark amd64 HMUL ops as not commutative

HMUL is commutative. However, it has asymmetric register requirements.
There are existing rewrite rules to place arguments in preferable slots.

Due to a bug, the existing rulegen commutativity engine doesn't generate
the commuted form of the HMUL rules.
The commuted form of those rewrite rules cause infinite loops.
In order to fix the rulegen commutativity bug,
we need to choose between eliminating
those rewrite rules and marking HMUL ops as not commutative.

This change chooses the latter, since doing so yields better
optimization results on std+cmd.

Removing the rewrite rules yields only text size regressions:

file                                before  after   Δ       %
runtime.s                           477257  477269  +12     +0.003%
time.s                              83552   83612   +60     +0.072%
encoding/asn1.s                     57378   57382   +4      +0.007%
cmd/go/internal/modfetch/codehost.s 89822   89829   +7      +0.008%
cmd/internal/test2json.s            9459    9466    +7      +0.074%
cmd/go/internal/test.s              57665   57678   +13     +0.023%

Marking HMUL as not commutative actually yields (mostly) improvements:

file                               before   after    Δ       %
runtime.s                          477257   477247   -10     -0.002%
math.s                             35985    35992    +7      +0.019%
strconv.s                          53486    53462    -24     -0.045%
syscall.s                          82483    82446    -37     -0.045%
time.s                             83552    83561    +9      +0.011%
os.s                               52691    52684    -7      -0.013%
archive/zip.s                      42285    42272    -13     -0.031%
encoding/asn1.s                    57378    57329    -49     -0.085%
encoding/base64.s                  12156    12094    -62     -0.510%
net.s                              296286   296276   -10     -0.003%
encoding/base32.s                  9720     9658     -62     -0.638%
net/http.s                         560931   560907   -24     -0.004%
net/smtp.s                         14421    14411    -10     -0.069%
cmd/vendor/golang.org/x/sys/unix.s 74307    74266    -41     -0.055%

The regressions are minor, and are in functions math.cbrt,
time.Time.String, and time.Date.

Change-Id: I9f6d9ee71654e5b70381cac77b0ac26011f4ea12
Reviewed-on: https://go-review.googlesource.com/c/go/+/213701
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: add a flag to print the source line for generated rules
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:43:51 +0000 (13:43 -0800)]
cmd/compile: add a flag to print the source line for generated rules

When working on rulegen, I often find myself
searching the rules files to find the source of
generated code. Add a flag to make that easier.

The flag needs to be off by default,
so that adding a single rule doesn't cause a massive diff.

Change-Id: I5a6f09129dc6fceef7c9cd1ad7eee24f3880ba91
Reviewed-on: https://go-review.googlesource.com/c/go/+/213700
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: delete duplicate rules
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:42:35 +0000 (13:42 -0800)]
cmd/compile: delete duplicate rules

Add logic during rulegen to detect exact duplicates
(after applying commutativity),
and clean up existing duplicates.

Change-Id: I7179f40fc48e236c74b74f429ec9f0f100026530
Reviewed-on: https://go-review.googlesource.com/c/go/+/213699
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: don't generate commutative rules for (Op x x)
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:15:49 +0000 (13:15 -0800)]
cmd/compile: don't generate commutative rules for (Op x x)

If the two commutative arguments are perfectly identical,
then swapping them will never have an effect.

Passes toolstash-check for the relevant architectures,
that is, linux-386, linux-386-387, linux-amd64, linux-s390x.

Change-Id: I19f91644867d8d174bd01f872abe4809013872ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/213698
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agocmd/compile: factor out opIsCommutative from commute1
Josh Bleecher Snyder [Mon, 6 Jan 2020 21:14:03 +0000 (13:14 -0800)]
cmd/compile: factor out opIsCommutative from commute1

Change-Id: I989a66c98dcca8168e35dd9834fc1365e0a1d881
Reviewed-on: https://go-review.googlesource.com/c/go/+/213697
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
5 years agoRevert "cmd/go: convert TestShadowingLogic to the script framework"
Michael Matloob [Thu, 20 Feb 2020 00:30:48 +0000 (00:30 +0000)]
Revert "cmd/go: convert TestShadowingLogic to the script framework"

This reverts commit 8fa2b6dcde6008c107c097e44eb0ee94a2a8af3d.

Reason for revert: broke the build

Change-Id: Iae703b1b3dad6b363f57541641357eabca45e9e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/220217
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years agocmd/go: convert TestShadowingLogic to the script framework
Michael Matloob [Mon, 13 Jan 2020 18:14:49 +0000 (13:14 -0500)]
cmd/go: convert TestShadowingLogic to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I6db652a4a515daf6e87645d34191dc9a441f5720
Reviewed-on: https://go-review.googlesource.com/c/go/+/214431
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agogo/importer: remove support for defunct binary export format
Robert Griesemer [Wed, 17 Oct 2018 23:53:37 +0000 (16:53 -0700)]
go/importer: remove support for defunct binary export format

Fixes #27999.

Change-Id: I488681eff4fb8e2580cf97a2d7631110d66ab19e
Reviewed-on: https://go-review.googlesource.com/c/go/+/143023
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
5 years agocmd/go: convert TestRelativeGOBINFail to script framework
Michael Matloob [Mon, 13 Jan 2020 16:24:06 +0000 (11:24 -0500)]
cmd/go: convert TestRelativeGOBINFail to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1cb3e2e28700b05b08933f4e24cd996268c1f163
Reviewed-on: https://go-review.googlesource.com/c/go/+/214428
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBuildDryRunWithCgo to the script framework
Michael Matloob [Mon, 13 Jan 2020 16:14:23 +0000 (11:14 -0500)]
cmd/go: convert TestBuildDryRunWithCgo to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2d14c07c590cc618c66f27fdc3a2bb8120c6d646
Reviewed-on: https://go-review.googlesource.com/c/go/+/214427
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestIssue11709 to the script framework
Michael Matloob [Mon, 13 Jan 2020 15:51:28 +0000 (10:51 -0500)]
cmd/go: convert TestIssue11709 to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I16fb0910196c96caef6ed380f96010a548407f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/214424
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/go: add a few more calls to t.Parallel
Michael Matloob [Mon, 13 Jan 2020 20:53:03 +0000 (15:53 -0500)]
cmd/go: add a few more calls to t.Parallel

Change-Id: If8fe5be9d2cd174862c09bb4ce079f524eb33ff3
Reviewed-on: https://go-review.googlesource.com/c/go/+/214580
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agocmd/internal/moddeps: check for consistent versioning among all modules in GOROOT
Bryan C. Mills [Thu, 30 Jan 2020 22:13:01 +0000 (17:13 -0500)]
cmd/internal/moddeps: check for consistent versioning among all modules in GOROOT

Updates #36851
Fixes #36907

Change-Id: I29627729d916e3b8132d46cf458ba856ffb0beeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/217218
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestDotDotDotOutsideGOPATH to script framework
Michael Matloob [Fri, 10 Jan 2020 22:58:20 +0000 (17:58 -0500)]
cmd/go: convert TestDotDotDotOutsideGOPATH to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2170f427c238e9fe8c029b43b346621d82c5e8fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/214388
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBuildIDContainsArchModeEnv to the script framework
Michael Matloob [Fri, 10 Jan 2020 22:53:05 +0000 (17:53 -0500)]
cmd/go: convert TestBuildIDContainsArchModeEnv to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I69c69809fb1698c8198ef3ea00103a9acb7b6ce7
Reviewed-on: https://go-review.googlesource.com/c/go/+/214387
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert remaining non-parallel tooSlow tests to script framework
Michael Matloob [Fri, 10 Jan 2020 21:59:02 +0000 (16:59 -0500)]
cmd/go: convert remaining non-parallel tooSlow tests to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ib1c55a48fafb5ce040ac70707bbc2a3ee5e2ddd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214382
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go/testdata/script: fix typo in get_domain_root.txt
Michael Matloob [Wed, 19 Feb 2020 21:28:26 +0000 (16:28 -0500)]
cmd/go/testdata/script: fix typo in get_domain_root.txt

golang.org/cl/214141 introduced the typo 'skup' for 'skip', which
broke tests. This change fixes it.

Change-Id: I1b3c230b545f1c093d3e0feedc3b41f3f0b41bec
Reviewed-on: https://go-review.googlesource.com/c/go/+/220157
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agoall: update module dependencies
Bryan C. Mills [Mon, 3 Feb 2020 16:38:49 +0000 (11:38 -0500)]
all: update module dependencies

Updates #36905
Updates #36907

Change-Id: I293dcef67800d5c81ff3a254bbd49309c5880710
Reviewed-on: https://go-review.googlesource.com/c/go/+/217517
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agocmd/go: convert TestIssue12096 to the script framework
Michael Matloob [Fri, 10 Jan 2020 23:04:08 +0000 (18:04 -0500)]
cmd/go: convert TestIssue12096 to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I27e52c4eabfcd1782965f17c098719dd0ea7e3ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/214390
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBadCgoDirectives to the script framework
Michael Matloob [Fri, 10 Jan 2020 21:15:19 +0000 (16:15 -0500)]
cmd/go: convert TestBadCgoDirectives to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1328a87e2481b4555b01df5c898f1a8015412adc
Reviewed-on: https://go-review.googlesource.com/c/go/+/214296
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoBuildOutput to the script framework
Michael Matloob [Fri, 10 Jan 2020 19:48:49 +0000 (14:48 -0500)]
cmd/go: convert TestGoBuildOutput to the script framework

Adds a in-script go binary called inarchive to check that an
archive is produced. A weaker could be done faster using grep,
but this is more faithful to the original test.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I001fa0698063be80fe3da947c81d4eb0829be47f
Reviewed-on: https://go-review.googlesource.com/c/go/+/214295
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestIssue6480 to the script framework
Michael Matloob [Fri, 10 Jan 2020 19:23:27 +0000 (14:23 -0500)]
cmd/go: convert TestIssue6480 to the script framework

This one's a bit complex and required writing support go programs
within the test script.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I9e91225b20b1b043f032b77a55c5825cb9d9a4b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/214292
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestCoverageRuns to the script framework
Michael Matloob [Fri, 10 Jan 2020 18:43:21 +0000 (13:43 -0500)]
cmd/go: convert TestCoverageRuns to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie46118eddbd7c3ed0bb9ecee4bdc1cb6fdaf06a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/214291
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestSymlink* to the script framework
Michael Matloob [Fri, 10 Jan 2020 17:57:19 +0000 (12:57 -0500)]
cmd/go: convert TestSymlink* to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I0696fa54184514d69c0763ac772d99b12e133eb0
Reviewed-on: https://go-review.googlesource.com/c/go/+/214288
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoTest(Cpu|Mutex)profile.* to script framework
Michael Matloob [Fri, 10 Jan 2020 16:27:08 +0000 (11:27 -0500)]
cmd/go: convert TestGoTest(Cpu|Mutex)profile.* to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie8b54b272e8a04720e437a37a5e5b0afd73481b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214285
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/src/(xtestonly|cgotest) to script framework
Michael Matloob [Fri, 10 Jan 2020 16:15:41 +0000 (11:15 -0500)]
cmd/go: convert tests using testdata/src/(xtestonly|cgotest) to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I3465cad1b0ba0d912067429146f1cb0668d5aa6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/214284
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some vet tests to the script framework
Michael Matloob [Thu, 9 Jan 2020 22:18:12 +0000 (17:18 -0500)]
cmd/go: convert some vet tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1f49a84f91735f39d5922c1347e79298780149c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/214218
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some go get tests to the script framework
Michael Matloob [Thu, 9 Jan 2020 21:34:29 +0000 (16:34 -0500)]
cmd/go: convert some go get tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1de2b428ea7dac5429020742bf12bea910a02079
Reviewed-on: https://go-review.googlesource.com/c/go/+/214141
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/src/(exclude|empty) to script framework
Michael Matloob [Thu, 9 Jan 2020 20:22:10 +0000 (15:22 -0500)]
cmd/go: convert tests using testdata/src/(exclude|empty) to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Icc14d4188574badf3da71d34857616f2a2ad5862
Reviewed-on: https://go-review.googlesource.com/c/go/+/214138
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoTestJSON to the script framework
Michael Matloob [Thu, 9 Jan 2020 19:28:26 +0000 (14:28 -0500)]
cmd/go: convert TestGoTestJSON to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I72bbba0a20a8731a89e1b4f4c9ac13b21c080cd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214119
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert two go get tests to the script framework
Michael Matloob [Thu, 9 Jan 2020 17:41:16 +0000 (12:41 -0500)]
cmd/go: convert two go get tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ib1ccc72fc717df79214480b48dd98188d6061b46
Reviewed-on: https://go-review.googlesource.com/c/go/+/214117
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoGetUpdateInsecure to the script framework
Michael Matloob [Wed, 8 Jan 2020 21:44:50 +0000 (16:44 -0500)]
cmd/go: convert TestGoGetUpdateInsecure to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1aa423a919e76de5b021d74d6df981d2f7fd43b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/213877
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoGetInsecure to the script framework
Michael Matloob [Wed, 8 Jan 2020 20:21:39 +0000 (15:21 -0500)]
cmd/go: convert TestGoGetInsecure to the script framework

Part of converting all tests to script framework to improve
test parallelism

Updates #36320
Updates #17751

Change-Id: Ic323b643d7149df4fd63b222e820e2dff50686fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/213829
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestBenchTimeout to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:55:08 +0000 (14:55 -0500)]
cmd/go: convert TestBenchTimeout to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I5dc403726f4960482ed7c267d1a333bbcc260087
Reviewed-on: https://go-review.googlesource.com/c/go/+/213828
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoGetNonPkg to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:45:04 +0000 (14:45 -0500)]
cmd/go: convert TestGoGetNonPkg to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ieaddc20aebd0b71189f2ebc8f8e2758f1117bbed
Reviewed-on: https://go-review.googlesource.com/c/go/+/213826
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoBuildDashODevNull to script framework
Michael Matloob [Wed, 8 Jan 2020 19:36:20 +0000 (14:36 -0500)]
cmd/go: convert TestGoBuildDashODevNull to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I85e0d168d4e9862a718872427f56213ddc21fa32
Reviewed-on: https://go-review.googlesource.com/c/go/+/213825
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestFailFast to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:21:15 +0000 (14:21 -0500)]
cmd/go: convert TestFailFast to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ibe1b09490bea72d9143324eae7443e0cf5afe85d
Reviewed-on: https://go-review.googlesource.com/c/go/+/213823
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestGoBuildTestOnly to the script framework
Michael Matloob [Wed, 8 Jan 2020 19:05:02 +0000 (14:05 -0500)]
cmd/go: convert TestGoBuildTestOnly to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1832e15e6a15301e075d2ec9d5169a77f11328fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/213822
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: delete testdata/testonly dir: it isn't being used anywhere
Michael Matloob [Wed, 8 Jan 2020 19:01:27 +0000 (14:01 -0500)]
cmd/go: delete testdata/testonly dir: it isn't being used anywhere

The TestGoBuildTestOnly test seems to be using files in testonly,
but it's actually creating different files in a tempdir GOPATH
that are completely unrelated.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie2c6d477bbb2eac7c013ee8dea9330a367b4f663
Reviewed-on: https://go-review.googlesource.com/c/go/+/213821
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/testinternal* to script framework
Michael Matloob [Wed, 8 Jan 2020 18:49:25 +0000 (13:49 -0500)]
cmd/go: convert tests using testdata/testinternal* to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I94a99c339f527da8ffacc73f1b36a7ac860522ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/213819
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert tests using testdata/testimport dir to script framework
Michael Matloob [Wed, 8 Jan 2020 18:25:08 +0000 (13:25 -0500)]
cmd/go: convert tests using testdata/testimport dir to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I3773508310865b198bc5f06dfc5ee7e34e92cdd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/213818
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestCoverageNoStatements to the script framework.
Michael Matloob [Tue, 7 Jan 2020 21:41:26 +0000 (16:41 -0500)]
cmd/go: convert TestCoverageNoStatements to the script framework.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie2c60ec0654ef605439beeed92cf5f1c2c8a1dd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/213681
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert all tests using testdata/standalone_* to script framework
Michael Matloob [Tue, 7 Jan 2020 21:07:20 +0000 (16:07 -0500)]
cmd/go: convert all tests using testdata/standalone_* to script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Iea6ba91d37c6f0d4994ae64e629c349c4eae511a
Reviewed-on: https://go-review.googlesource.com/c/go/+/213678
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some generate tests to the script framework
Michael Matloob [Mon, 6 Jan 2020 18:30:37 +0000 (13:30 -0500)]
cmd/go: convert some generate tests to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I7110e460e18542aff90a7ae078b996ec45816d81
Reviewed-on: https://go-review.googlesource.com/c/go/+/213424
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: rewrite tests using testdata/example[12]_test.go to scripts
Michael Matloob [Fri, 3 Jan 2020 21:35:19 +0000 (16:35 -0500)]
cmd/go: rewrite tests using testdata/example[12]_test.go to scripts

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I81476ae6716903135781e5da135345456a36b026
Reviewed-on: https://go-review.googlesource.com/c/go/+/213219
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestListTests to the script framework
Michael Matloob [Thu, 2 Jan 2020 20:24:21 +0000 (15:24 -0500)]
cmd/go: convert TestListTests to the script framework

The original test has four subtests. I think it's okay to just have
one corresponding script test instead of having four different
tests.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I97bc2cbb3ad5a297d7457476b8c831ee6e0f49b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/213126
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert some coverage tests to the script framework
Michael Matloob [Fri, 27 Dec 2019 00:24:41 +0000 (19:24 -0500)]
cmd/go: convert some coverage tests to the script framework

This change converts TestCoverageFunc, TestCoverageDashC,
TestCoverageSyncAtomicImport, TestCoverageErrorLine,
TestCoverageDepLoop, TestCoverageDotImport, and
TestTestBuildFailureOutput to the script framework.

It adds a -exec modifier to the script framework's [exists] check
to check that a file is executable.

Updates #17751

Change-Id: Idc1e36c3702c94918631936f637510a6679d18a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/212624
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go: convert TestCgoConsistentResults to the script framework
Michael Matloob [Thu, 26 Dec 2019 23:19:58 +0000 (18:19 -0500)]
cmd/go: convert TestCgoConsistentResults to the script framework

The call to tooSlow is rewritten into a check for [short].

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I1f3e7664d575219b6fc525bd88babed15d1bd3b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/212622
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/go/testdata/script: skip cover_cgo.* tests in short mode
Michael Matloob [Tue, 14 Jan 2020 18:58:50 +0000 (13:58 -0500)]
cmd/go/testdata/script: skip cover_cgo.* tests in short mode

The original tests called tooSlow, but I neglected to skip in short
mode on golang.org/cl/212621

Change-Id: Ifb5b8a405094b2ba53419184fa358b1e51e7b123
Reviewed-on: https://go-review.googlesource.com/c/go/+/214698
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agodoc/go1.14: highlight the addition of hash/maphash package
Dmitri Shuralyov [Tue, 18 Feb 2020 15:03:22 +0000 (10:03 -0500)]
doc/go1.14: highlight the addition of hash/maphash package

Given that it's a package that did not exist before, was a proposal
in issue #28322, got accepted and implemented for 1.14, it seems to
be more than a minor change to the library. Highlight it accordingly.

Also specify the results are 64-bit integers, as done in CL 219340.

Updates #36878
Updates #28322

Change-Id: Idefe63d4c47a02cdcf8be8ab08c40cdb94ff2098
Reviewed-on: https://go-review.googlesource.com/c/go/+/219877
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc/go1.14: remove TODO comment for CL 200439
Dmitri Shuralyov [Tue, 18 Feb 2020 18:28:35 +0000 (18:28 +0000)]
doc/go1.14: remove TODO comment for CL 200439

Based on https://golang.org/issue/36878#issuecomment-587533153
and https://golang.org/issue/36878#issuecomment-587549692,
this is not a CL that needs to be mentioned in the release notes.

Updates #36878

Change-Id: Icaa9153da7481a1d3ebabc237411539dd770cef2
Reviewed-on: https://go-review.googlesource.com/c/go/+/219898
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>