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

42669 Commits

Author SHA1 Message Date
Michael Matloob
635f4b903a 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>
2020-02-19 21:58:05 +00:00
Bryan C. Mills
8a8adc23d4 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>
2020-02-19 21:53:23 +00:00
Michael Matloob
2cdb2ecacc 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>
2020-02-19 21:53:11 +00:00
Michael Matloob
3791594e36 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>
2020-02-19 21:36:41 +00:00
Michael Matloob
1e43298df8 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>
2020-02-19 21:34:59 +00:00
Michael Matloob
9c68d85db5 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>
2020-02-19 21:32:45 +00:00
Bryan C. Mills
7299308690 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>
2020-02-19 21:26:10 +00:00
Michael Matloob
2f2e97c00c 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>
2020-02-19 21:18:17 +00:00
Than McIntosh
25f1b093fe [dev.link] cmd/link: convert DWARF type generation to use loader
Converts the portion of DWARF generation that deals with creation of
type DIEs and constant DIEs to use the new loader interfaces. Creation
of subprogram DIE and compilation unit DIE content still operates on
sym.Symbols at the moment, and happens much later in the linker.

The new code for type DIE generation is gated/guarded by the linker
flag "-newdw", which currently defaults to true. At some point in the
near future this flag should be removed, but it is handy for triage at
the moment.

This patch also includes shim code designed to run after loadlibfull()
that walks through the DIE chains and to converts loader.Sym
references back into sym.Symbol references for the remainder of the
compilation, since the second phase of DWARF has not yet been
converted.

Change-Id: I681a00fb8a1f3c37884a79b373d86411332e07c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/208230
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-02-19 21:15:12 +00:00
Michael Matloob
ea38df0436 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>
2020-02-19 21:12:36 +00:00
Michael Matloob
7e368b3f5a 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>
2020-02-19 21:08:26 +00:00
Michael Matloob
99c78b7fc1 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>
2020-02-19 21:03:30 +00:00
Michael Matloob
b44008fec7 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>
2020-02-19 21:03:13 +00:00
Michael Matloob
1331113405 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>
2020-02-19 21:00:15 +00:00
Michael Matloob
1bf9d3cc5b 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>
2020-02-19 21:00:02 +00:00
Michael Matloob
250c06f54e 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>
2020-02-19 20:59:42 +00:00
Michael Matloob
68fab3e93f 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>
2020-02-19 20:59:01 +00:00
Michael Matloob
a9d344dac0 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>
2020-02-19 20:58:22 +00:00
Michael Matloob
f08734dd72 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>
2020-02-19 20:58:16 +00:00
Michael Matloob
1ee337e9b1 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>
2020-02-19 20:58:13 +00:00
Michael Matloob
3c630bb400 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>
2020-02-19 20:57:49 +00:00
Michael Matloob
d52d5f186c 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>
2020-02-19 20:50:47 +00:00
Michael Matloob
b6ac393d1d 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>
2020-02-19 20:50:20 +00:00
Michael Matloob
acfab6870d 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>
2020-02-19 20:50:17 +00:00
Michael Matloob
0119933477 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>
2020-02-19 20:50:14 +00:00
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