1
0
mirror of https://github.com/golang/go synced 2024-11-06 04:26:11 -07:00
Commit Graph

42994 Commits

Author SHA1 Message Date
Michael Matloob
a737299f38 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>
2020-02-19 20:50:11 +00:00
Michael Matloob
b93ebcfe41 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>
2020-02-19 20:50:04 +00:00
Michael Matloob
d50429ab60 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>
2020-02-19 20:50:00 +00:00
Michael Matloob
b865bd1fb1 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>
2020-02-19 20:49:56 +00:00
Michael Matloob
8f41b1ff96 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>
2020-02-19 20:49:31 +00:00
Michael Matloob
ce7fc1788d 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>
2020-02-19 20:49:24 +00:00
Michael Matloob
fcfc16694f 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>
2020-02-19 20:48:19 +00:00
Michael Matloob
8538f5f08f 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>
2020-02-19 20:48:08 +00:00
Michael Matloob
f74e21c150 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>
2020-02-19 20:40:36 +00:00
Michael Matloob
2200b4fda2 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>
2020-02-19 20:40:29 +00:00
Michael Matloob
7b65f1d7bb 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>
2020-02-19 20:38:24 +00:00
Michael Matloob
8df6a5d9ad 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>
2020-02-19 20:38:20 +00:00
Michael Matloob
b15fd6b39e 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>
2020-02-19 20:37:54 +00:00
Michael Matloob
f81594e1e3 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>
2020-02-19 20:35:38 +00:00
Jeremy Faller
6a819b0062 [dev.link] cmd/internal: remove unneeded RefIdx field
Change-Id: Ic77e67b70b76dc958890e74b77c9691c30eb6ba1
Reviewed-on: https://go-review.googlesource.com/c/go/+/220060
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-02-19 16:57:57 +00:00
Dmitri Shuralyov
1cd724acb6 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>
2020-02-18 20:21:35 +00:00
Dmitri Shuralyov
a0cf2c872f 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>
2020-02-18 19:44:25 +00:00
Cherry Zhang
a9ea91d571 cmd/link, runtime: skip holes in func table
On PPC64 when external linking, for large binaries we split the
text section to multiple sections, so the external linking may
insert trampolines between sections. These trampolines are within
the address range covered by the func table, but not known by Go.
This causes runtime.findfunc to return a wrong function if the
given PC is from such trampolines.

In this CL, we generate a marker between text sections where
there could potentially be a hole in the func table. At run time,
we skip the hole if we see such a marker.

Fixes #37216.

Change-Id: I95ab3875a84b357dbaa65a4ed339a19282257ce0
Reviewed-on: https://go-review.googlesource.com/c/go/+/219717
Reviewed-by: David Chase <drchase@google.com>
2020-02-18 17:55:23 +00:00
Jeremy Faller
4b8715bd81 [dev.link] cmd/link: fix broken build
CL 219226 was submitted before syncing.

Change-Id: I5cb26b2fd06cbf3d3de69d6e1235efcff5ca089d
Reviewed-on: https://go-review.googlesource.com/c/go/+/219878
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-18 16:47:14 +00:00
Jeremy Faller
9d673bf1db [dev.link] cmd/link: use RO memory (when avail) in elf loader
Recreation of CL 206139 in the new symbol hierarchy.

Change-Id: Ic20c5c1b5db8f7eadf4c6ee4638e3c1a4e10ef3a
Reviewed-on: https://go-review.googlesource.com/c/go/+/219317
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-02-18 15:48:03 +00:00
Jeremy Faller
860f12a2fc [dev.link] cmd/link: dostrdata and fieldtrack with new syms
Move the wavefront past fieldtrack and dostrdata.

Change-Id: Ia327ece0202e24031fec7e1f70b40e15fbb4f728
Reviewed-on: https://go-review.googlesource.com/c/go/+/219226
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-02-18 15:29:12 +00:00
Alberto Donizetti
88e564edb1 doc/go1.14: add missing period at sentence end
Change-Id: I82050f16906e7d34555a592e96b7855515a1726a
Reviewed-on: https://go-review.googlesource.com/c/go/+/219641
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-02-17 10:30:03 +00:00
Ian Lance Taylor
6917529cc6 testing: remove obsolete comment in testing.(*T) docs
We now only accumulate logs when not using -v. Just drop the sentence
entirely rather than try to describe the current situation.

Updates #24929
Updates #37203

Change-Id: Ie3bf37894ab68b5b129eff54637893c7a129da03
Reviewed-on: https://go-review.googlesource.com/c/go/+/219540
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-02-15 16:40:12 +00:00
Cherry Zhang
3eab754cd0 runtime: correct caller PC/SP offsets in walltime1/nanotime1
In walltime1/nanotime1, we save the caller's PC and SP for stack
unwinding. The code does that assumed zero frame size. Now that
the frame size is not zero, correct the offset. Rewrite it in a
way that doesn't depend on hard-coded frame size.

May fix #37127.

Change-Id: I47d6d54fc3499d7d5946c3f6a2dbd24fbd679de1
Reviewed-on: https://go-review.googlesource.com/c/go/+/219118
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2020-02-13 19:49:45 +00:00
Cherry Zhang
123f7dd3e1 runtime: zero upper bit of Y registers in asyncPreempt on darwin/amd64
Apparently, the signal handling code path in darwin kernel leaves
the upper bits of Y registers in a dirty state, which causes many
SSE operations (128-bit and narrower) become much slower. Clear
the upper bits to get to a clean state.

We do it at the entry of asyncPreempt, which is immediately
following exiting from the kernel's signal handling code, if we
actually injected a call. It does not cover other exits where we
don't inject a call, e.g. failed preemption, profiling signal, or
other async signals. But it does cover an important use case of
async signals, preempting a tight numerical loop, which we
introduced in this cycle.

Running the benchmark in issue #37174:

name    old time/op  new time/op  delta
Fast-8  90.0ns ± 1%  46.8ns ± 3%  -47.97%  (p=0.000 n=10+10)
Slow-8   188ns ± 5%    49ns ± 1%  -73.82%  (p=0.000 n=10+9)

There is no more slowdown due to preemption signals.

For #37174.

Change-Id: I8b83d083fade1cabbda09b4bc25ccbadafaf7605
Reviewed-on: https://go-review.googlesource.com/c/go/+/219131
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2020-02-13 19:41:53 +00:00
Keith Randall
a0c9fb6bd3 hash/maphash: mention the results are 64-bit integers
Change-Id: I0d2ba52d79c34d77d475ec8d673286d0e56b826b
Reviewed-on: https://go-review.googlesource.com/c/go/+/219340
Reviewed-by: Alan Donovan <adonovan@google.com>
2020-02-13 18:32:48 +00:00
Cherry Zhang
112a7cb82c [dev.link] cmd/link: remove the second result of MakeSymbolUpdater
With unique global indices, MakeSymbolUpdater will not change the
symbol's index. So no need to return a new index.

Change-Id: I5b4fd6a0167cc74476880bbf4382c524ecde7721
Reviewed-on: https://go-review.googlesource.com/c/go/+/219227
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-02-13 16:56:56 +00:00
Keith Randall
e237df5b53 runtime: fix fallback logic for aeshash on 32/64 bit
We were using the fallback hash unconditionally.  Oops.

Fixes #37212

Change-Id: Id37d4f5c08806fdda12a3148ba4dbc46676eeb54
Reviewed-on: https://go-review.googlesource.com/c/go/+/219337
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-02-13 16:25:03 +00:00
Cherry Zhang
5a8b1509dd [dev.link] cmd/link: clean up unused function and arguments
Change-Id: Idacb027c5ae11e029ee4ab10f6c9a76ff435e5b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/219228
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-02-13 15:47:21 +00:00
Cherry Zhang
b0275bfbf4 [dev.link] cmd/link: add defined package symbols first, before any non-package symbols
Currently, the loader adds defined package symbols and
non-package symbols to the global index space object by object.
This CL changes it to add all the defined package symbols first,
then all the non-package symbols. The advantage of doing this is
that when adding package symbols, by definition they cannot be
dup to each other, so we don't need to do a name lookup when
adding them.

We still add them to the lookup table (for now), since they may
still be referenced by name (e.g. through linkname). This CL is
also a prerequisite if we want to move to not adding package
symbols to the lookup table entirely (e.g. by using
pre-generated in-file lookup table).

Also update some comments to reflect the current state.

Change-Id: Ib757e070b48a9ef6215e47dc3421fc5c055b746c
Reviewed-on: https://go-review.googlesource.com/c/go/+/219078
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-02-12 22:07:52 +00:00
Bryan C. Mills
363bcd0068 cmd/go: eliminate empty '()' when passing -mod=readonly explicitly to 'go list'
Discovered while investigating #37197.

Updates #33326
Updates #34822

Change-Id: I38b136a4ee762a580a554125066b9778491295f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/219237
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-12 18:22:50 +00:00
Jay Conrod
7385947825 cmd/go/internal/modcmd: remove dead function addModFlag
This function is never called and should have been removed
earlier. work.AddModCommonFlags defines the -modfile flag instead.

Fixes #37189

Change-Id: I73ad2a727013a849cba44bf70de04160f37c97dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/219197
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-02-12 17:32:01 +00:00
Kanta Ebihara
5ce8005990 cmd/go/internal/web: fix a typo
dependenicies -> dependencies

Change-Id: I0b8f06c04cf397c6330ffb43ac3ae5c2f7cf3138
Reviewed-on: https://go-review.googlesource.com/c/go/+/219157
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-02-12 04:06:30 +00:00
Dmitri Shuralyov
d0050e2871 go/build: populate partial package information in importGo
This is a followup to CL 199840 and CL 203820. Cumulatively, they caused
a previously known bug to trigger more often while also nearly fixing it.

This change is a small fixup to CL 199840 that resolves the known bug
and prevents it from causing an additional regression in Go 1.14.

Part 1

The intention in CL 199840 was to return the same error that 'go list'
reported when the package wasn't located, so an early return was added.
However, to determine whether the package was located or not, p.Dir was
unintentionally checked instead of dir.

p is initialized to &Package{ImportPath: path} at top of Context.Import,
and its Dir field is never set before that line in importGo is reached.
So return errors.New(errStr) was always executed whenever errStr != "".

Originally, in CL 125296, the "go list" invocation did not include an
'-e' flag, so it would return a non-zero exit code on packages where
build constraints exclude all Go files, and importGo would return an
error like "go/build: importGo import/path: unexpected output: ...".

CL 199840 added an '-e' flag to the "go list" invocation, but checking
the wrong dir variable caused partial package information to never get
populated, and thus issue #31603 continued to occur, although with a
different error message (which ironically included the location of the
package that was supposedly "not found").

Now that the right dir is checked, issue #31603 is fixed.

Part 2

importGo checks whether it can use the go command to find the directory
of a package. In Go 1.13.x and earlier, one of the conditions to use the
go command was that the source directory must be provided.

CL 203820 made a change such that knowing the source directory was
no longer required:

	 // To invoke the go command,
	-// we must know the source directory,
	 // ...

That meant build.Import invocations where srcDir is the empty string:

	build.Import(path, "", build.FindOnly)

Started using the go command to find the directory of the package, and
started to run into issue #31603 as well. That's the #37153 regression.

Since this change fixes issue #31603, it also fixes issue #37153.

Part 3

There is one more thing. Delete the debugImportGo constant, it's unused.

Updates #26504 (CL 125296)
Updates #34752 (CL 199840)
Updates #34860 (CL 203820)
Fixes #31603
Fixes #37153

Change-Id: Iaa7dcc45ba0f708a978950c75fa4c836b87006f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/218817
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-02-12 00:56:20 +00:00
Ian Lance Taylor
1c241d2879 hash/maphash: mention that hash values do not persist in package docs
Updates #36878
Fixes #37040

Change-Id: Ib0bd21481e5d9c3b3966c116966ecfe071243a24
Reviewed-on: https://go-review.googlesource.com/c/go/+/218297
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-02-11 05:55:11 +00:00
Filippo Valsorda
25da21ddc9 crypto/elliptic: document the Name and names of each curve
See https://tools.ietf.org/html/rfc8422#appendix-A for a helpful table.

Also, commit to keeping them singletons, as that assumption is already
made all over the place in the ecosystem.

Fixes #34193

Change-Id: I2ec50fa18bb80e11d6101f2562df60b5e27d4f66
Reviewed-on: https://go-review.googlesource.com/c/go/+/218921
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-02-11 00:59:47 +00:00
Filippo Valsorda
ab5d9f5831 doc/go1.14: add a couple minor crypto release notes
These were left out of CL 216759 because they are trivial, but I was
advised to be thorough.

Updates #36878

Change-Id: Id4fd3a84866a82265e3f89abfdad6e3d231b507c
Reviewed-on: https://go-review.googlesource.com/c/go/+/218918
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-02-10 20:34:23 +00:00
Dmitri Shuralyov
6a8164a254 go/doc: clarify that NewFromFiles caller must filter by GOOS/GOARCH
The most well known and important build constraints to take into
account when rendering package documentation are the GOOS/GOARCH
values. Make it more clear in the NewFromFiles documentation that
they are a part of all build constraints that the caller is
responsible for filtering out.

Also suggest the "go/build".Context.MatchFile method for performing
file matching. The logic to perform build context file matching is
subtle and has many rules that aren't well known (for example,
taking the gc or gccgo compiler into account). It is currently the
only exported API in the standard library that implements this logic,
and it would be unfortunate if people attempt to re-create it because
they don't realize it is already available.

Updates #23864

Change-Id: I3c5901e7081acf79125b2d429ec3aa3b58416ed7
Reviewed-on: https://go-review.googlesource.com/c/go/+/218477
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-02-10 19:49:03 +00:00
Jay Conrod
dff55c1f76 doc: move doc/modules.md to x/website
Moved /doc/modules.md from GOROOT to x/website. The corresponding
change in x/website is CL 218239. See explanation there.

Updates #33637

Change-Id: I329935624e6e264873bc68b6487405a63d3e7030
Reviewed-on: https://go-review.googlesource.com/c/go/+/218240
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-02-10 16:29:43 +00:00
Toshihiro Shiino
cfe2ab42e7 doc/go1.14: rearrange in alphabetical order
"Minor changes to the library" are basically arranged in alphabetical
order, but there are some mistakes so we will correct them.

Updates #36878

Change-Id: I8498563b739eff9f1b0a76ead3cf290191e0ce36
Reviewed-on: https://go-review.googlesource.com/c/go/+/218638
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-02-08 22:24:33 +00:00
Toshihiro Shiino
ca8bf63809 doc/go1.14: add link to TempFile in io/ioutil
For convenience, TempFile in io/ioutil now has a link to the document.

Updates #36878

Change-Id: I5c22f57c886badd8ca423e34527c4b4bb029847b
Reviewed-on: https://go-review.googlesource.com/c/go/+/218637
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-02-08 16:15:48 +00:00
Toshihiro Shiino
a528215693 doc/go1.14: fix inconsistent markup
Unlike the others, the dt tag of reflect is not next to the dl tag.
The dd's closing tags may or may not have been omitted. They were unified without omission.

Updates #36878

Change-Id: I4e24f93fe8763ae8a1e4392db72e0b4818884f44
Reviewed-on: https://go-review.googlesource.com/c/go/+/217701
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-02-08 14:59:33 +00:00
Ian Lance Taylor
a6b03c64b2 runtime/race: update reference to compiler-rt sources
Change-Id: Iabe46677f24fef6e482a4beca774dbfc553026a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/217778
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2020-02-07 23:44:32 +00:00
Ian Lance Taylor
60d437f994 runtime: avoid double notewakeup in netpoll stub code
Otherwise we can see
- goroutine 1 calls netpollBreak, the atomic.Cas succeeds, then suspends
- goroutine 2 calls noteclear, sets netpollBroken to 0
- goroutine 3 calls netpollBreak, the atomic.Cas succeeds, calls notewakeup
- goroutine 1 wakes up calls notewakeup, crashes due to double wakeup

This doesn't happen on Plan 9 because it only runs one thread at a time.
But Fuschia wants to use this code too.

Change-Id: Ib636e4f327bb15e44a2c40fd681aae9a91073a30
Reviewed-on: https://go-review.googlesource.com/c/go/+/218537
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2020-02-07 23:43:36 +00:00
Cherry Zhang
ab1253b59a [dev.link] cmd/link: don't read symbol name if not needed
Most of the time of goobj2.Sym.Read is spent in reading the
symbol name. Sometimes the name is not needed, so don't read
it.

This brings the linking time pretty much back to the old linker.
On my Mac,

$ time go build cmd/compile     # (new)

real	0m1.016s
user	0m1.164s
sys	0m0.297s

$ time go-tip build cmd/compile # (old)

real	0m0.980s
user	0m1.229s
sys	0m0.309s

Again, this is a bit ugly. Maybe we want to consider moving
symbol names out of Sym, to a separate section of the object
file?

Change-Id: Ia9085c15aa4d614b7eae126e71a79d6806c75055
Reviewed-on: https://go-review.googlesource.com/c/go/+/218480
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-02-07 20:50:06 +00:00
Cherry Zhang
38437ce118 [dev.link] cmd/link: only read necessary fields in deadcode pass
Reading unnecessary fields from object file take time, even from
memory mapping. In deadcode, we do this a alot, so only read
necessary ones. In particular, for relocations, for non-type
symbols, we only need their target symbols and reloc types to
build the dependency graph, so don't read other fields. This
should speed up the deadcode pass.

Also cache an object's number of defined package symbols, as it
is accessed a lot in resolve.

This is a bit ugly from an API point of view. It would be nice if
the compiler could figure out some fields are not used so don't
fill them.

Change-Id: I5c4e9526b8a3b0aead9fa71901a51fb214f013a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/218479
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-02-07 20:39:23 +00:00
Cherry Zhang
06e2339dfe [dev.link] cmd/link: clean up some fields
With the new index mapping , we can clean up some fields.
Loader.max should always be equal to len(loader.objSyms) now. And
for external symbols we now give its "local index" as its index
in the payload array, so Relocs.extIdx is no longer useful.
Delete those fields.

Change-Id: If387ff9201ea0d347b954f651f5d4b4ae74937aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/218478
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-02-07 18:33:37 +00:00
Jay Conrod
b8061825e5 doc: fill in 'go mod init' section of module documentation
Updates #33637

Change-Id: I9c1345d0fa7a1b6c98c33b8b0837706e5261d5b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/214381
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
2020-02-07 18:08:01 +00:00
Jay Conrod
cb16d26bd6 doc: fill in 'go mod download' section of module documentation
Updates #33637

Change-Id: I963c04639201b32e0513a235306a03eae51222b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/214380
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
2020-02-07 18:07:47 +00:00
Jay Conrod
08d41dbb10 doc: fill in 'go list -m' section in module documentation
Updates #33637

Change-Id: I14ba3198375b98a270bbce2cd60234b071a6b974
Reviewed-on: https://go-review.googlesource.com/c/go/+/214379
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
2020-02-07 18:07:16 +00:00