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

52821 Commits

Author SHA1 Message Date
Cuong Manh Le
c50c6bbc03 [dev.unified] cmd/compile: set base.Pos when process assignDef in Unified IR
CL 410343 changes Unified IR to visit LHS before RHS/X in assign/for
statement. Thus, it needs to set base.Pos before processing assignee
expression, so invalid type can be reported with correct position.

Updates #53058

Change-Id: Ic9f60cbf35c8bd71cb391e806396572c37811af7
Reviewed-on: https://go-review.googlesource.com/c/go/+/410794
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-09 01:34:36 +00:00
Cuong Manh Le
d6df08693c [dev.unified] cmd/compile: fix unified IR don't report type size too large error
For error reported during type size calculation, base.Pos needs to be
set, otherwise, the compiler will treat them as the same error and only
report once. Old typechecker and irgen all set base.Pos before
processing types, this CL do the same thing for unified IR.

Updates #53058

Change-Id: I686984ffe4aca3e8b14d2103018c8d3c7d71fb02
Reviewed-on: https://go-review.googlesource.com/c/go/+/410345
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2022-06-09 01:34:20 +00:00
Cuong Manh Le
e7ef58542c [dev.unified] cmd/compile: restore Unified IR linkname pragma diagnostic
CL 333109 restore the diagnostic for irgen, now it's safe to restore for
Unified IR, too.

Updates #53058

Change-Id: I467902c0e9fa451aaa78cf0813231f14d9d7a3a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/410346
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2022-06-08 02:41:56 +00:00
Cuong Manh Le
9e5c968021 [dev.unified] cmd/compile: visit LHS before RHS/X in assign/for statement
Unified IR used to visit RHS/X before LHS in assign/for statements for
satisfying toolstash in quirksmode.

After CL 385998, unified IR quirks mode was gone, the constraint to
visit RHS/X first is no longer necessary.

Change-Id: I1c3825168b67fb094928f5aa21748a3c81b118ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/410343
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-07 00:08:30 +00:00
Cuong Manh Le
46ddf0873e [dev.unified] cmd/compile: export/import implicit attribute for conversion exprs
So they can be formatted more presicely, and make it easier in the
transition to Unified IR.

Updates #53058

Change-Id: I8b5a46db05a2e2822289458995b8653f0a3ffbbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/410594
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-06-06 19:21:04 +00:00
Cuong Manh Le
a8780f94c3 [dev.unified] cmd/compile: fix missing method value wrapper in unified IR
Unified IR uses to generate wrappers after the global inlining pass, so
it needs to apply inlining for the wrappers itself. However, inlining
may reveal new method value nodes which have not been seen yet, thus
unified IR never generates wrappers for them.

To fix it, just visiting the wrapper function body once more time after
inlining, and generate wrappers for any new method value nodes.

Fixes #52128

Change-Id: I78631c4faa0b00357d4f84704d3525fd38a52cd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/410344
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-06 19:20:41 +00:00
Cuong Manh Le
3a1f1e1575 [dev.unified] cmd/compile: remove package height
After CL 410654, symbols are now sorted by package path, package height
is not necessary anymore.

Updates #51734

Change-Id: I976edd2e574dda68eb5c76cf95645b9dce051393
Reviewed-on: https://go-review.googlesource.com/c/go/+/410342
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-06 19:19:59 +00:00
Cuong Manh Le
df7cb59de4 [dev.unified] cmd/compile: only sort symbols by name and package path
Since CL 393715, the path of package being compiled is now always known,
so symbols can be sorted by package path instead of package height.

Updates #51734

Change-Id: Ie543e2fdef4b93f3f0b97c6bcec0a4dcff788f2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/410654
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-06 19:19:30 +00:00
Matthew Dempsky
b39ac80871 [dev.unified] cmd/compile/internal/noder: push exprBlank up into assignment handling
Blanks can only appear on the LHS of an assignment. Instead of
handling them as an arbitrary expression, handle them as part of
assignee expression lists.

Change-Id: Iaeb0a5c471ffa1abd2bbbd9c95f7876533e5a607
Reviewed-on: https://go-review.googlesource.com/c/go/+/410100
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-06-06 18:57:51 +00:00
Matthew Dempsky
55fc07e164 [dev.unified] cmd/compile/internal/noder: add optExpr for optional expressions
Previously, {writer,reader}.expr would allow for nil
expressions (i.e., no expression at all, not a "nil" identifier). But
only a few contexts allow this, and it simplifies some logic if we can
assume the expression is non-nil.

So this CL introduces optExpr as a wrapper method for handling nil
expressions specially.

Change-Id: I438bae7a3191126f7790ec0bf5b77320fe855514
Reviewed-on: https://go-review.googlesource.com/c/go/+/410099
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-06-06 18:57:34 +00:00
Matthew Dempsky
6c33f1d52e [dev.unified] cmd/compile/internal/noder: rename exprName to exprGlobal
More descriptive.

Change-Id: I70a07adbe1d395da797fe15b54d2a1106f5f36a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/410098
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2022-06-06 17:32:20 +00:00
Matthew Dempsky
4d28fcabb4 [dev.unified] all: update codereview.cfg for dev.unified branch
Change-Id: Ib16889540ef55e3817daddfd09737c857fb7f1e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/410097
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-06 16:16:12 +00:00
Michael Pratt
9d3dbd78c7 doc/go1.19: add TODOs for undocumented runtime features
As of this CL, release notes for all packages owned by @golang/runtime
on https://dev.golang.org/owners are either complete or have explicit
TODOs.

For #51400

Change-Id: I5b6affd43883991a3b8a065b4aa211efce7427f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/410118
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-06-03 20:54:52 +00:00
Michael Pratt
54a2f4b676 doc/go1.19: add release notes for runtime packages
This documents most of the changes in runtime packages, which the major
exception of GC changes, which will be documented in a future CL.

For #51400

Change-Id: Ibcf501e1b4f7caa3397db6b9136daec07aac5a65
Reviewed-on: https://go-review.googlesource.com/c/go/+/410117
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-06-03 20:54:45 +00:00
Michael Anthony Knyszek
54bd44e573 runtime: track total idle time for GC CPU limiter
Currently the GC CPU limiter only tracks idle GC work time. However, in
very undersubscribed situations, it's possible that all this extra idle
time prevents the enabling of the limiter, since it all gets account for
as mutator time. Fix this by tracking all idle time via pidleget and
pidleput. To support this, pidleget and pidleput also accept and return
"now" parameters like the timer code.

While we're here, let's clean up some incorrect assumptions that some of
the scheduling code makes about "now."

Fixes #52890.

Change-Id: I4a97893d2e5ad1e8c821f8773c2a1d449267c951
Reviewed-on: https://go-review.googlesource.com/c/go/+/410122
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-03 20:16:45 +00:00
Michael Anthony Knyszek
73587b71a6 runtime: avoid string allocation in printDebuglog
Either due to a new nowritebarrierrec annotation or a change in escape
analysis, printDebuglog can't be called from sighandler anymore.

Fix this by avoiding a string allocation that's the primary culprit.

Change-Id: Ic84873a453f45852b0443a46597ed3ab8c9443fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/410121
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-03 20:16:21 +00:00
Michael Anthony Knyszek
d7941030c9 runtime: only use CPU time from the current window in the GC CPU limiter
Currently the GC CPU limiter consumes CPU time from a few pools, but
because the events that flush to those pools may overlap, rather than be
strictly contained within, the update window for the GC CPU limiter, the
limiter's accounting is ultimately sloppy.

This sloppiness complicates accounting for idle time more completely,
and makes reasoning about the transient behavior of the GC CPU limiter
much more difficult.

To remedy this, this CL adds a field to the P struct that tracks the
start time of any in-flight event the limiter might care about, along
with information about the nature of that event. This timestamp is
managed atomically so that the GC CPU limiter can come in and perform a
read of the partial CPU time consumed by a given event. The limiter also
updates the timestamp so that only what's left over is flushed by the
event itself when it completes.

The end result of this change is that, since the GC CPU limiter is aware
of all past completed events, and all in-flight events, it can much more
accurately collect the CPU time of events since the last update. There's
still the possibility for skew, but any leftover time will be captured
in the following update, and the magnitude of this leftover time is
effectively bounded by the update period of the GC CPU limiter, which is
much easier to consider.

One caveat of managing this timestamp-type combo atomically is that they
need to be packed in 64 bits. So, this CL gives up the top 3 bits of the
timestamp and places the type information there. What this means is we
effectively have only a 61-bit resolution timestamp. This is fine when
the top 3 bits are the same between calls to nanotime, but becomes a
problem on boundaries when those 3 bits change. These cases may cause
hiccups in the GC CPU limiter by not accounting for some source of CPU
time correctly, but with 61 bits of resolution this should be extremely
rare. The rate of update is on the order of milliseconds, so at worst
the runtime will be off of any given measurement by only a few
CPU-milliseconds (and this is directly bounded by the rate of update).
We're probably more inaccurate from the fact that we don't measure real
CPU time but only approximate it.

For #52890.

Change-Id: I347f30ac9e2ba6061806c21dfe0193ef2ab3bbe9
Reviewed-on: https://go-review.googlesource.com/c/go/+/410120
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-03 20:16:15 +00:00
Michael Anthony Knyszek
162b88265e cmd/compile/internal/escape: escape values with >PtrSize alignment
After CL 381317 there exist values that may have an alignment greater
than the pointer size for that platform. Specifically, atomic.{Ui|I}nt64
may be aligned to 8 bytes on a 32-bit platform. If such a value, or
a container for the value, gets stack-allocated, it's possible that it
won't be aligned correctly, because the maximum alignment we enforce on
stacks is governed by the pointer size. Changing that would be a
significant undertaking, so just escape these values to the heap
instead, where we're sure they'll actually be aligned correctly.

Change is by rsc@, I'm just shepherding it through code review.

For #50860.

Change-Id: I51669561c0a13ecb84f821020e144c58cb528418
Reviewed-on: https://go-review.googlesource.com/c/go/+/410131
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-06-03 20:15:20 +00:00
Michael Matloob
ee87cd1dd9 cmd/go: changes to use modindex
This CL makes the changes to actually use the module index when loading
packages and instead of scanning their directories to see if they
contain go files or to extract imports.

Change-Id: I70106181cf64d6fd5a416644ba518b6b90030e0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/403778
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
2022-06-03 20:05:38 +00:00
Michael Matloob
06261062e9 cmd/go: add functions to read index file
The data read is used for three primary functions: ImportPackage,
IsDirWithGoFiles and ScanDir. Functions are also provided to get this
information from the intermediate package representation to cache
the information from reads for non-indexed packages.

Change-Id: I5eed629bb0d6ee5b88ab706d06b074475004c081
Reviewed-on: https://go-review.googlesource.com/c/go/+/403975
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-06-03 19:59:31 +00:00
Michael Pratt
0eb7051aad sync/atomic: note that alignment responsibility doesn't apply to types
For #50860.

Change-Id: I8e117f00c5da230d0dc398aaed417fe5e64a5b22
Reviewed-on: https://go-review.googlesource.com/c/go/+/410127
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-06-03 19:58:02 +00:00
Michael Pratt
e1036a741c doc/go1.19: add release notes for syscall
For #51400

Change-Id: If5fc131df254d47a989ff61c8e584cb8149cbd09
Reviewed-on: https://go-review.googlesource.com/c/go/+/410116
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-06-03 19:57:46 +00:00
Michael Pratt
559b17fe34 doc/go1.19: add release notes for sync/atomic
For #51400

Change-Id: I32a3aedf1e8a52148a9d78c4f7dae1ea59c810b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/410115
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-06-03 19:57:35 +00:00
eric fang
7846e25418 cmd/link: fix TestLargeText
Do not need to add single quotes '' when passing the parameter value of
 the -ldflags option, otherwise the following error will be reported:
invalid value "'-linkmode=external'" for flag -ldflags: parameter may
not start with quote character.

Change-Id: I322fa7079ac24c8a68d9cb0872b0a20dbc4893d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/410074
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
2022-06-03 00:13:09 +00:00
Bryan C. Mills
74dc84a0e5 doc/go1.19: add a release note for CL 404134
For #51473.

Change-Id: I01a35e5ebc83b8b72e414ed1730e9147ea590959
Reviewed-on: https://go-review.googlesource.com/c/go/+/409176
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-06-02 20:39:24 +00:00
Bryan C. Mills
3b6b9a7ef0 doc/go1.19: add release note for CL 398058
Change-Id: I483de9a6a2016432df13e030c675d42470db9ed1
Reviewed-on: https://go-review.googlesource.com/c/go/+/409175
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-06-02 20:39:23 +00:00
Ian Lance Taylor
aae0bef72f archive/zip: use bufio.Reset rather than NewReader
A clean up for CL 408734, suggested by Joe Tsai.

Change-Id: Ida9db0b8d31785d5640938c286c9c6c82c27f457
Reviewed-on: https://go-review.googlesource.com/c/go/+/410154
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
2022-06-02 17:17:19 +00:00
Christian Stewart
b3b8d2bfeb cmd/dist: use gohostarch for ssa rewrite check
Fix a build failure when bootstrapping the Go compiler with go-bootstrap 1.4
while the environment contains GOARCH=riscv64.

Building Go toolchain1 using go-1.4-bootstrap-20171003.
src/cmd/compile/internal/ssa/rewriteRISCV64.go:4814
invalid operation: y << x (shift count type int64, must be unsigned integer)

This is because:

 - buildtool.go:198: calls bootstrapRewriteFile(src)
 - bootstrapRewriteFile: buildtool.go:283 calls:
 - isUnneededSSARewriteFile: checks os.Getenv("GOARCH")
 - isUnneededSSARewriteFile: returns "", false
 - bootstrapRewriteFile: calls bootstrapFixImports
 - boostrapFixImports: generates code go1.4 cannot compile

Instead of checking "GOARCH" in the environment, use the gohostarch variable.

Change-Id: Ie9c190498555c4068461fead6278a62e924062c6
GitHub-Last-Rev: 300d7a7fea
GitHub-Pull-Request: golang/go#52362
Reviewed-on: https://go-review.googlesource.com/c/go/+/400376
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
2022-06-02 17:15:54 +00:00
Ian Lance Taylor
f70b93a6e9 archive/zip: if non-zero base offset fails, fall back to zero
This permits us to read files that earlier Go releases could read.
It is also compatible with other zip programs.

Change-Id: I7e2999f1073c4db5ba3f51f92681e0b149d55b3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/408734
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-02 16:25:34 +00:00
Lukas Joisten
46ab7a5c4f encoding/json: mention SyntaxError in Unmarshal doc comment
Change-Id: I71c9d9ef9d21a7ae9466d8c7b283fdfbba01f5a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/390734
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-01 22:59:44 +00:00
Michael Matloob
293d43e17e cmd/go: add index creation methods
This change functions to scan modules and packages into an intermediate
RawPackage struct and also functions to write them out to and index.

Change-Id: Ia1a3b58b992e9be52c5d1397e85c642f902011cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/398415
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-06-01 20:20:50 +00:00
Bryan C. Mills
8a56c7742d cmd/go: set GIT_TRACE_CURL for tests on builders
We have noticed a pattern of connection timeouts connecting to
github.com on the builders. Adding tracing may shed some light on the
underlying cause.

For #52545.

Change-Id: Ic73b494be9a3ea8ce3c7631ee8f62bd3d0d8e7bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/409575
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-01 02:37:46 +00:00
Cuong Manh Le
085529bd5f cmd/compile: fix wrong unsafe.Offsetof evaluation inside generic function
For instantiated generic functions, all implicit dot operations are
resolved. Thus unsafe.Offsetof may calculating the offset against the
wrong base selector.

To fix it, we must remove any implicit dot operations to find the first
non-implicit one, which is the right base selector for calculating the
offset.

Fixes #53137

Change-Id: I38504067ce0f274615b306edc8f7d7933bdb631a
Reviewed-on: https://go-review.googlesource.com/c/go/+/409355
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2022-05-31 14:58:09 +00:00
Than McIntosh
cfd202c701 cmd/link: call syscall.FlushFileBuffers on outbuf Unmap
In the windows version of OutBuf.munmap, call syscall.FlushFileBuffers
after the call to syscall.FlushViewOfFile, on the theory that this
will help flush all associated meta-data for the file the linker is
writing.

Updates #44817.

Change-Id: Ibff7d05008a91eeed7634d2760153851e15e1c18
Reviewed-on: https://go-review.googlesource.com/c/go/+/406814
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-05-31 11:37:38 +00:00
Dmitri Shuralyov
db19b42ca8 lib/time, time/tzdata: update to 2022a
Version 2022a was released on 2022-03-15 and we can start using it for
Go 1.19. Its release announcement was:

	https://mm.icann.org/pipermail/tz-announce/2022-March/000070.html

For #22487.

Change-Id: Ie89b90927a251413e4f67c9e0ed3a67d4161529b
Reviewed-on: https://go-review.googlesource.com/c/go/+/409374
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-05-31 08:53:53 +00:00
Brad Fitzpatrick
af88fb6502 net: permit use of Resolver.PreferGo, netgo on Windows and Plan 9
This reverts commit CL 401754 (440c9312c8) which reverted CL 400654,
thus reapplying CL 400654, re-adding the func init() { netGo = true }
to cgo_stub.go CL 400654 had originally removed (mistakenly during
development?) that had broken the darwin nocgo builder.

Fixes #33097

Change-Id: I90f59746d2ceb6b5d2bd832c9fc90068f8ff7417
Reviewed-on: https://go-review.googlesource.com/c/go/+/409234
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
2022-05-30 21:23:29 +00:00
Keith Randall
a21cf916f4 doc: add release note for reflect.Value.{Bytes,Len,Cap}
Update #47066
Update #52411

Change-Id: I85139d774c16c9e6d1a2592a5abba58a49338674
Reviewed-on: https://go-review.googlesource.com/c/go/+/408874
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
2022-05-30 15:47:08 +00:00
Ian Lance Taylor
52f68efa45 mime: ignore .js => text/plain in Windows registry
This seems to be a common registry misconfiguration on Windows.

Fixes #32350

Change-Id: I68c617c42a6e72948e2acdf335ff8e7df569432d
Reviewed-on: https://go-review.googlesource.com/c/go/+/406894
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2022-05-28 20:07:28 +00:00
Rhys Hiltner
1247354a08 doc/go1.19: mention runtime/trace's CPU samples
Change-Id: Ia8becc3e28523e9b1da4f7a274c800309add331a
Reviewed-on: https://go-review.googlesource.com/c/go/+/408994
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
2022-05-28 00:28:55 +00:00
Michael Anthony Knyszek
70d499cd89 test/heapsampling.go: slow down allocation rate and reduce iterations
As far as I can tell, this test suffers from #52433. For some reason,
this seems to become more of a problem on the windows/386 than anywhere
else. This CL is an attempt at a mitigation by slowing down the
allocation rate by inserting runtime.Gosched call in the inner loop. It
also cuts the iteration count which should help too (as less memory is
allocated in total), but the main motivation is to make sure the test
doesn't take too long to run.

Fixes #49564.

Change-Id: I8cc622b06a69cdfa66f680a30e1ccf334eea2164
Reviewed-on: https://go-review.googlesource.com/c/go/+/408825
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-27 21:36:06 +00:00
Michael Anthony Knyszek
1f0ef6bec7 runtime: cancel mark and scavenge assists if the limiter is enabled
This change forces mark and scavenge assists to be cancelled early if
the limiter is enabled. This avoids goroutines getting stuck in really
long assists if the limiter happens to be disabled when they first come
into the assist. This can get especially bad for mark assists, which, in
dire situations, can end up "owing" the GC a really significant debt.

For #52890.

Change-Id: I4bfaa76b8de3e167d49d2ffd8bc2127b87ea566a
Reviewed-on: https://go-review.googlesource.com/c/go/+/408816
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-27 17:30:15 +00:00
Bryan C. Mills
0f57c88bce misc/cgo/testsanitizers: buffer the signal channel in TestTSAN/tsan11
This fix is analogous to the one in CL 407888.

'go vet' catches the error, but it is not run on this file because the
file is (only) compiled when running testsanitizers/TestTSAN.

Fixes #53113.

Change-Id: I74f7b7390a9775ff00a06214c1019ba28846dd11
Reviewed-on: https://go-review.googlesource.com/c/go/+/409094
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-05-27 15:58:52 +00:00
Keith Randall
42f1b37b7b doc: fix up race detector release note
It's already mentioned under runtime/race, we don't need it
also mentioned under runtime.

Change-Id: I538322b32d75b9642f3ead03539fccb95988ef8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/408875
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Rhys Hiltner <rhys@justin.tv>
2022-05-27 15:13:07 +00:00
John Bampton
524210bbb2 doc: lint Markdown for trailing spaces and code blocks
MD009 Trailing spaces.
MD031 Fenced code blocks should be surrounded by blank lines.

https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md

Change-Id: I6a2fff4afa8224442d90b30f84444b4a888fcef2
GitHub-Last-Rev: 67cf146b85
GitHub-Pull-Request: golang/go#44285
Reviewed-on: https://go-review.googlesource.com/c/go/+/292409
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alex Rakoczy <alex@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-27 15:07:38 +00:00
Rhys Hiltner
f5b5273190 doc/go1.19: don't mention golang.org/x/crypto/ssh
CL 392134 appears to have been marked for the release notes by accident.
Remove mention of this package.

Change-Id: I62ae30512512ef8e20e9040b71e613be5ee5ee26
Reviewed-on: https://go-review.googlesource.com/c/go/+/408819
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Auto-Submit: Alex Rakoczy <alex@golang.org>
2022-05-27 15:07:03 +00:00
George Looshch
fd0ffedae2 doc: replace tabs with spaces for alignment in code snippets
Fixes #52255

Change-Id: Ibb518cf2f6bac9e1ffc426a014afe80cc4c0df5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/399394
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-05-26 23:22:37 +00:00
Koichi Shiraishi
55c42c2892 doc/go1.19: fix strconv.Quote pkg link
For #51400.

Change-Id: I122b3a58e5fbaaa8ceb5b013e8e392f4bcbbd2e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/408495
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-05-26 22:25:23 +00:00
Cherry Mui
d29d0314c1 runtime: don't inspect the stack for delayed signals from TSAN
Cgo TSAN (not the Go race detector) intercepts signals and calls
the signal handler at a later time. When the signal handler is
called, the memory may have changed, but the signal context
remains old. As the signal context and the memory don't match, it
is unsafe to unwind the stack from the signal PC and SP. We have
to ignore the signal.

It is probably also not safe to do async preemption, which relies
on the signal PC, and inspects and even writes to the stack (for
call injection).

We also inspect the stack for fatal signals (e.g. SIGSEGV), but I
think they are not delayed. For other signals we don't inspect
the stack, so they are probably fine.

Fixes #27540.

Change-Id: I5c80a7512265b8ea4a91422954dbff32c6c3a0d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/408218
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-05-26 22:21:35 +00:00
Keith Randall
dbf5220475 cmd/compile: mark closures made for generic function expressions as wrappers
Fixes #52237

Change-Id: I7488020c8d157e069202017a293d18230e3aef0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/408876
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2022-05-26 21:06:31 +00:00
Guoqi Chen
ec9258029e internal/cpu: fix cpu cacheLineSize for loong64
We choose 64 because the L1 Dcache of Loongson 3A5000 CPU is
4-way 256-line 64-byte-per-line.

Change-Id: Ifb9a9f993dd6f75b5adb4ff6e4d93e945b1b2a98
Reviewed-on: https://go-review.googlesource.com/c/go/+/408854
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-26 20:17:08 +00:00