1
0
mirror of https://github.com/golang/go synced 2024-09-29 13:24:28 -06:00
Commit Graph

53349 Commits

Author SHA1 Message Date
Cuong Manh Le
964f0c7a30 context: use CompareAndSwap in cancelCtx.Done
So it is not necessary to use a mutex, speedup the code a bit:

name                                         old time/op    new time/op    delta
CommonParentCancel-8                            756ns ± 1%     760ns ± 1%    ~     (p=0.184 n=10+10)
WithTimeout/concurrency=40-8                   1.36µs ± 6%    1.38µs ± 5%    ~     (p=0.367 n=10+9)
WithTimeout/concurrency=4000-8                 1.30µs ± 1%    1.30µs ± 1%    ~     (p=0.444 n=9+9)
WithTimeout/concurrency=400000-8               1.25µs ± 1%    1.25µs ± 1%    ~     (p=0.268 n=10+10)
CancelTree/depth=1/Root=Background-8           62.3ns ± 1%    61.9ns ± 1%  -0.72%  (p=0.046 n=9+10)
CancelTree/depth=1/Root=OpenCanceler-8          447ns ± 1%     437ns ± 0%  -2.09%  (p=0.000 n=9+9)
CancelTree/depth=1/Root=ClosedCanceler-8        210ns ± 1%     211ns ± 1%  +0.35%  (p=0.024 n=10+10)
CancelTree/depth=10/Root=Background-8          2.46µs ± 0%    2.42µs ± 1%  -1.86%  (p=0.000 n=10+10)
CancelTree/depth=10/Root=OpenCanceler-8        3.50µs ± 1%    3.46µs ± 4%    ~     (p=0.063 n=9+9)
CancelTree/depth=10/Root=ClosedCanceler-8      1.21µs ± 0%    1.22µs ± 1%  +0.72%  (p=0.001 n=8+10)
CancelTree/depth=100/Root=Background-8         26.3µs ± 1%    25.7µs ± 1%  -2.20%  (p=0.000 n=9+10)
CancelTree/depth=100/Root=OpenCanceler-8       34.0µs ± 1%    33.2µs ± 1%  -2.15%  (p=0.000 n=9+10)
CancelTree/depth=100/Root=ClosedCanceler-8     11.2µs ± 1%    11.2µs ± 0%    ~     (p=0.562 n=10+9)
CancelTree/depth=1000/Root=Background-8         265µs ± 1%     260µs ± 1%  -2.15%  (p=0.000 n=10+10)
CancelTree/depth=1000/Root=OpenCanceler-8       341µs ± 1%     334µs ± 0%  -1.90%  (p=0.000 n=10+10)
CancelTree/depth=1000/Root=ClosedCanceler-8     110µs ± 0%     111µs ± 1%  +0.53%  (p=0.001 n=9+10)
CheckCanceled/Err-8                            14.2ns ± 0%    14.2ns ± 0%  -0.08%  (p=0.012 n=8+8)
CheckCanceled/Done-8                           6.19ns ± 1%    5.69ns ± 1%  -8.11%  (p=0.000 n=8+9)
ContextCancelDone-8                            1.40ns ± 0%    1.31ns ± 0%  -6.50%  (p=0.000 n=9+9)
DeepValueNewGoRoutine/depth=10-8                488ns ± 0%     490ns ± 0%  +0.62%  (p=0.000 n=9+9)
DeepValueNewGoRoutine/depth=20-8                529ns ± 0%     531ns ± 1%  +0.46%  (p=0.004 n=10+10)
DeepValueNewGoRoutine/depth=30-8                589ns ± 1%     594ns ± 0%  +0.82%  (p=0.004 n=9+9)
DeepValueNewGoRoutine/depth=50-8                664ns ± 0%     668ns ± 0%  +0.52%  (p=0.000 n=10+9)
DeepValueNewGoRoutine/depth=100-8               916ns ± 2%     915ns ± 2%    ~     (p=0.912 n=10+10)
DeepValueSameGoRoutine/depth=10-8              39.6ns ± 1%    38.8ns ± 2%  -2.01%  (p=0.001 n=9+10)
DeepValueSameGoRoutine/depth=20-8              76.9ns ± 1%    74.4ns ± 1%  -3.25%  (p=0.000 n=9+10)
DeepValueSameGoRoutine/depth=30-8               136ns ± 1%     125ns ± 1%  -8.53%  (p=0.000 n=9+10)
DeepValueSameGoRoutine/depth=50-8               196ns ± 1%     192ns ± 1%  -1.90%  (p=0.000 n=10+10)
DeepValueSameGoRoutine/depth=100-8              383ns ± 2%     372ns ± 2%  -2.86%  (p=0.000 n=10+10)

Change-Id: Ifb12affed2d6eda1104e4074d63d3f602be4c46b
Reviewed-on: https://go-review.googlesource.com/c/go/+/405674
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-08-08 14:10:19 +00:00
Tomasz Jezierski
0f6ee42fe0 encoding/gob: replace runtime values with constants in init()
Current init() implementation in `encoding/gob/decode.go` checks int/uint/uintptr bit size with reflection in runtime. We could replace it with values available on compile stage. This should reduce time and allocations on binary start.
Results from GODEBUG=inittrace=1:
before:
init encoding/gob @4.4 ms, 0.21 ms clock, 43496 bytes, 652 allocs
after:
init encoding/gob @4.4 ms, 0.15 ms clock, 41672 bytes, 643 allocs

Updates #54184

Change-Id: I46dda2682fb92519da199415e29401d61edce697
Reviewed-on: https://go-review.googlesource.com/c/go/+/420455
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-08 06:16:59 +00:00
Matthew Dempsky
0c4db1e347 cmd/compile: fix import/export of ODYNAMICDOTTYPE
The RType field isn't needed when performing type assertions from
non-empty interface types, because we use the ITab field instead. But
the inline body exporter didn't know to expect this.

It's possible we could use a single bool to distinguish whether
we're serializing the RType or ITab field, but using two is simpler
and seems safer.

Fixes #54302.

Change-Id: I9ddac72784fb2241fee0a0dee30493d868a2c259
Reviewed-on: https://go-review.googlesource.com/c/go/+/421755
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2022-08-06 15:20:00 +00:00
Rob Pike
d75e186e2c fmt: add a function to recover the original format string given a State
Sometimes when implementing a Formatter it's helpful to use the fmt
package without invoking the formatter. This new function, FormatString,
makes that easier in some cases by recreating the original formatting
directive (such as "%3.2f") that caused Formatter.Format to be
called.

The original Formatter interface is probably not what we would
design today, but we're stuck with it. FormatString, although it
takes a State as an argument, compensates by making Formatter a
little more flexible.

The State does not include the verb so (unlike in the issue), we
must provide it explicitly in the call to FormatString. Doing it there
minimizes allocations by returning the complete format string.

Fixes #51668
Updates #51195

Change-Id: Ie31c8256515864b2f460df45fbd231286b8b7a28
Reviewed-on: https://go-review.googlesource.com/c/go/+/400875
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-08-06 09:19:31 +00:00
Dmitri Shuralyov
27f1246b85 all: update vendored golang.org/x/{net,tools} for Go 1.20 development
CL 421334 updated most of golang.org/x dependencies at the start of
the Go 1.20 development cycle. This CL updates x/net and x/tools as
well, now that go.dev/issue/54259 is resolved.

For #36905.
Updates #54259.

Change-Id: Ie422b71cba060a4774076eebf3b499cda1150367
Reviewed-on: https://go-review.googlesource.com/c/go/+/421461
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-05 19:54:32 +00:00
Russ Cox
4fb7e22ade cmd/dist: do not run on ppc64le
Also don't run on all the other tiny slow boxes we have.
Should fix the remaining ppc64le broken builders.

For #44505 (or at least somehow provoked by it).

Change-Id: I72e8086cb641f3f7da3a872140a752bf328eec1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/421438
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-08-05 19:51:08 +00:00
Russ Cox
b12366bbb5 cmd/dist: force stackGuardMultiplierDefault to 1
Nothing seems to break, not even the noopt builder.

For #51256 (the conversation there is headed toward additional changes).

Change-Id: Icb7ca451159a74f351c25d2cefb32c773b9bb017
Reviewed-on: https://go-review.googlesource.com/c/go/+/416859
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-05 15:19:31 +00:00
Russ Cox
8f6884393d sync/atomic: remove test64err in test
This check was for very old QEMU, added in 2011 in
https://codereview.appspot.com/4313051/.
It may be safe to delete now. Let's find out.
In a separate CL for easy rollback.

Change-Id: Ic99f8cf27ee348b8ffb1ef0ee36cc1c537dde722
Reviewed-on: https://go-review.googlesource.com/c/go/+/403978
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-05 15:04:35 +00:00
Russ Cox
f755e16726 bootstrap.bash: delete BOOTSTRAP_FORMAT=mintgz code
It has been superceded by golang.org/x/build/cmd/genbootstrap.

Change-Id: Ifc00cd1de769bf807a0f6df643897c2f2339a073
Reviewed-on: https://go-review.googlesource.com/c/go/+/419116
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-05 15:04:03 +00:00
Lynn Boger
15d395a196 cmd/link: use correct path for dynamic loader on ppc64le
The setting of the path for the dynamic loader when building for
linux/ppc64le ELF v2 was incorrectly set to the path for
PPC64 ELF v1. This has not caused issues in the common cases
because this string can be set based on the default GO_LDSO setting.
It does result in an incorrect value when cross compiling binaries
with -buildmode=pie.

Updates #53813

Change-Id: I84de1c97b42e0434760b76a57c5a05e055fbb730
Reviewed-on: https://go-review.googlesource.com/c/go/+/417614
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
2022-08-05 14:53:13 +00:00
hopehook
91d5ce3def all: clean up TODO after fixing issue 44505
For #44505

Change-Id: I89220be02372b5340cb987bf2ac870a9346a8c8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/421079
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-04 20:35:21 +00:00
Matthew Dempsky
39728f412d go/internal/gcimporter: rewrite interface receiver parameters
For a type definition like `type I interface{ M() }`, the go/types API
traditionally sets `M`'s receiver parameter type to `I`, whereas
Unified IR was (intentionally) leaving it as `interface{ M() }`.

I still think `interface{ M() }` is the more consistent and
semantically correct type to use in this scenario, but I concede that
users want `I` instead, as evidenced by existing tooling and tests.

Updates #49906.

Change-Id: I74ba5e8b08e4e98ed9dc49f72b7834d5b552058b
Reviewed-on: https://go-review.googlesource.com/c/go/+/421355
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2022-08-04 18:27:30 +00:00
Matthew Dempsky
a10afb15e0 all: REVERSE MERGE dev.unified (d558507) into master
This commit is a REVERSE MERGE.
It merges dev.unified back into its parent branch, master.
This marks the end of development on dev.unified.

Merge List:

+ 2022-08-04 d558507db4 [dev.unified] all: merge master (85d87b9) into dev.unified
+ 2022-08-03 c9f2150cfb [dev.unified] cmd/compile: start using runtime dictionaries
+ 2022-07-30 994ff78ba0 [dev.unified] go/internal: set underlying types in proper order
+ 2022-07-28 23554d4744 [dev.unified] all: merge master (462b78f) into dev.unified
+ 2022-07-28 c8d5ccf82e [dev.unified] go/internal/gcimporter: flatten imports
+ 2022-07-28 ac0844ec27 [dev.unified] cmd/compile: move "has init" to private metadata
+ 2022-07-28 f995946094 [dev.unified] cmd/compile: implement simple inline body pruning heuristic
+ 2022-07-28 f2851c67fd [dev.unified] cmd/compile: allow inlining to fail gracefully
+ 2022-07-28 831fdf1dff [dev.unified] cmd/compile: extract nil handling from exprType
+ 2022-07-28 92798176e7 [dev.unified] cmd/compile: write iface conversion RTTI into unified IR
+ 2022-07-28 9b70178d58 [dev.unified] cmd/compile: write RTTI into unified IR export data
+ 2022-07-25 fc72b7705d [dev.unified] cmd/compile: add method expressions to dictionaries
+ 2022-07-25 f48fa643f1 [dev.unified] cmd/compile: remove obsolete RTTI wiring
+ 2022-07-22 131f981df0 [dev.unified] cmd/compile: make Unified IR always writes concrete type for const exprs
+ 2022-07-20 ae43bdc3e3 Merge "[dev.unified] all: merge master (8e1e64c) into dev.unified" into dev.unified
+ 2022-07-19 7a8ba83b72 [dev.unified] cmd/compile/internal/reflectdata: remove hasRType's `required` param
+ 2022-07-19 64cd6faa13 [dev.unified] cmd/compile/internal/noder: simplify mixed tag/case RTTI wiring
+ 2022-07-19 a4c5198a3c [dev.unified] cmd/compile/internal/noder: better switch statements
+ 2022-07-19 318027044a [dev.unified] cmd/compile/internal/noder: explicit nil handling
+ 2022-07-19 e971b6a9be [dev.unified] test: add switch test case for tricky nil handling
+ 2022-07-19 878439cfe5 [dev.unified] cmd/compile/internal/noder: preserve RTTI for select statements
+ 2022-07-19 e376746e54 [dev.unified] cmd/compile/internal/noder: wire RTTI for implicit conversions
+ 2022-07-19 c846fd8e13 [dev.unified] cmd/compile/internal/noder: implicit conversions for binary exprs
+ 2022-07-19 ebd34e3e45 [dev.unified] test: relax panic message expectations
+ 2022-07-19 76a82f09d6 [dev.unified] cmd/compile/internal/noder: prefer *At functions
+ 2022-07-19 de649a2a98 [dev.unified] all: merge master (8e1e64c) into dev.unified
+ 2022-07-19 055a5e55fa [dev.unified] test: change Unicode file/package name to use characters not translated by macOS.
+ 2022-07-18 2cf632cd57 [dev.unified] cmd/compile/internal/reflectdata: prefer ITabAddrAt in ConvIfaceTypeWord
+ 2022-07-12 9371a65584 internal/pkgbits: change EnableSync into a dynamic knob
+ 2022-07-01 d667be8831 [dev.unified] cmd/compile/internal/walk: RType fields for range assignments
+ 2022-06-30 1b838e9556 [dev.unified] all: merge master (993c387) into dev.unified
+ 2022-06-30 0a503cf43a [dev.unified] cmd/compile: refactor `range` desugaring
+ 2022-06-30 3635b07d16 [dev.unified] cmd/compile/internal/noder: implicit conversions for multi-valued expressions
+ 2022-06-30 e7219cc093 [dev.unified] cmd/compile/internal/noder: refactor N:1 expression handling
+ 2022-06-30 2f3ef73e18 [dev.unified] test: tweak nilcheck test
+ 2022-06-30 95d7ce9ab1 [dev.unified] test: break escape_iface.go into unified/nounified variants
+ 2022-06-30 f751319a0b [dev.unified] test: relax live_regabi.go
+ 2022-06-30 e3cdc981c8 [dev.unified] cmd/compile/internal/walk: fix typo in debug print
+ 2022-06-29 2280d897d6 [dev.unified] test: add regress test for generic select statements
+ 2022-06-27 4b78ece3d7 [dev.unified] cmd/compile: drop package height from Unified IR importer
+ 2022-06-27 398d46d538 [dev.unified] cmd/compile/internal/types2: remove package height
+ 2022-06-24 e7100adbca [dev.unified] all: merge master (5a1c5b8) into dev.unified
+ 2022-06-23 09a838ad86 [dev.unified] cmd/compile: rename haveRType and implicitExpr
+ 2022-06-23 421e9e9db2 [dev.unified] cmd/compile: implicit conversions for return statements
+ 2022-06-23 a3fea7796a [dev.unified] cmd/compile/internal/noder: implicit conversions for writer.assignStmt
+ 2022-06-23 82a958a661 [dev.unified] cmd/compile/internal/noder: refactor stmtAssign generation
+ 2022-06-23 711dacd8cf [dev.unified] cmd/compile/internal/noder: implicit conversion of call arguments
+ 2022-06-23 46b01ec667 [dev.unified] cmd/compile/internal/noder: remove needType logic
+ 2022-06-23 a3e474f867 [dev.unified] cmd/compile/internal/noder: implicit conversions for complits
+ 2022-06-23 5f5422a2dd [dev.unified] cmd/compile/internal/noder: start writing implicit conversions
+ 2022-06-23 9cb784ac69 [dev.unified] cmd/compile/internal/noder: add pkgWriter.typeOf helper
+ 2022-06-23 c70e93ff3d [dev.unified] cmd/compile/internal/typecheck: replace unreachable code with assert
+ 2022-06-23 20e1d5ac8c [dev.unified] cmd/compile: special case f(g()) calls in Unified IR
+ 2022-06-23 61ae2b734c [dev.unified] cmd/compile: plumb rtype through OSWITCH/OCASE clauses
+ 2022-06-23 3d432b6c4b [dev.unified] cmd/compile: plumb rtype through for OMAPLIT
+ 2022-06-23 7368647ac6 [dev.unified] cmd/compile: start setting RType fields for Unified IR
+ 2022-06-23 5960f4ec10 [dev.unified] cmd/compile: add RType fields
+ 2022-06-21 5e0258c700 [dev.unified] cmd/compile: avoid reflectType in ssagen
+ 2022-06-21 93833cd5d8 [dev.unified] cmd/compile: extract rtype code from walk
+ 2022-06-21 f70775ff22 [dev.unified] cmd/compile: refactor reflectdata.{TypePtr,ITabAddr}
+ 2022-06-21 fc5dad6646 [dev.unified] cmd/compile/internal/walk: minor prep refactoring
+ 2022-06-16 1f4e8afafe [dev.unified] all: merge master (635b124) into dev.unified
+ 2022-06-15 8a9485c023 [dev.unified] test: extract different inline test between unified and non-unified
+ 2022-06-14 394ea70cc9 [dev.unified] cmd/compile: more Unified IR docs and review
+ 2022-06-10 f73ad3d24d [dev.unified] test: add regress tests for #53276 and #53328
+ 2022-06-09 8ef8b60e18 [dev.unified] cmd/compile/internal/noder: stop handling type expressions as expressions
+ 2022-06-09 1a6c96bb9b [dev.unified] test: relax issue7921.go diagnostic message
+ 2022-06-09 c50c6bbc03 [dev.unified] cmd/compile: set base.Pos when process assignDef in Unified IR
+ 2022-06-09 d6df08693c [dev.unified] cmd/compile: fix unified IR don't report type size too large error
+ 2022-06-08 e7ef58542c [dev.unified] cmd/compile: restore Unified IR linkname pragma diagnostic
+ 2022-06-07 9e5c968021 [dev.unified] cmd/compile: visit LHS before RHS/X in assign/for statement
+ 2022-06-06 46ddf0873e [dev.unified] cmd/compile: export/import implicit attribute for conversion exprs
+ 2022-06-06 a8780f94c3 [dev.unified] cmd/compile: fix missing method value wrapper in unified IR
+ 2022-06-06 3a1f1e1575 [dev.unified] cmd/compile: remove package height
+ 2022-06-06 df7cb59de4 [dev.unified] cmd/compile: only sort symbols by name and package path
+ 2022-06-06 b39ac80871 [dev.unified] cmd/compile/internal/noder: push exprBlank up into assignment handling
+ 2022-06-06 55fc07e164 [dev.unified] cmd/compile/internal/noder: add optExpr for optional expressions
+ 2022-06-06 6c33f1d52e [dev.unified] cmd/compile/internal/noder: rename exprName to exprGlobal
+ 2022-06-06 4d28fcabb4 [dev.unified] all: update codereview.cfg for dev.unified branch

Change-Id: I604d057735e8a365621c91c206f9e46eabb4679b
2022-08-04 10:32:51 -07:00
Matthew Dempsky
d558507db4 [dev.unified] all: merge master (85d87b9) into dev.unified
Merge List:

+ 2022-08-04 85d87b9c75 all: update vendored golang.org/x dependencies for Go 1.20 development
+ 2022-08-04 fb1bfd4d37 all: remove pre-Go 1.17 workarounds
+ 2022-08-04 44ff9bff0c runtime: clean up panic and deadlock lock ranks
+ 2022-08-04 f42dc0de74 runtime: make the lock rank DAG make more sense
+ 2022-08-04 d29a0282e9 runtime: add mayAcquire annotation for finlock
+ 2022-08-04 c5be4ed7df runtime: add missing trace lock edges
+ 2022-08-04 2b8a9a484f runtime: generate the lock ranking from a DAG description
+ 2022-08-04 ddfd639408 runtime: delete unused lock ranks
+ 2022-08-04 426ea5702b internal/dag: add a Graph type and make node order deterministic
+ 2022-08-04 d37cc9a8cd go/build, internal/dag: lift DAG parser into an internal package
+ 2022-08-04 ab0a94c6d3 cmd/dist: require Go 1.17 for building Go
+ 2022-08-04 1e3c19f3fe runtime: support riscv64 SV57 mode
+ 2022-08-03 f28fa952b5 make.bat, make.rc: show bootstrap toolchain version
+ 2022-08-03 87384801dc cmd/asm: update package doc to describe "-p" option
+ 2022-08-03 c6a2dada0d net: disable TestIPv6WriteMsgUDPAddrPortTargetAddrIPVersion [sic] on DragonflyBSD
+ 2022-08-02 29b9a328d2 runtime: trivial replacements of g in remaining files
+ 2022-08-02 c647264619 runtime: trivial replacements of g in signal_unix.go
+ 2022-08-02 399f50c9d7 runtime: tricky replacements of g in traceback.go
+ 2022-08-02 4509e951ec runtime: tricky replacements of g in proc.go
+ 2022-08-02 4400238ec8 runtime: trivial replacements of _g_ in remaining files
+ 2022-08-02 5999a28de8 runtime: trivial replacements of _g_ in os files
+ 2022-08-02 0e18cf6d09 runtime: trivial replacements of _g_ in GC files
+ 2022-08-02 4358a53a97 runtime: trivial replacements of _g_ in proc.go
+ 2022-08-02 b486518964 runtime: tricky replacements of _g_ in os3_solaris.go
+ 2022-08-02 54a0ab3f7b runtime: tricky replacements of _g_ in os3_plan9.go
+ 2022-08-02 4240ff764b runtime: tricky replacements of _g_ in signal_windows.go
+ 2022-08-02 8666d89ca8 runtime: tricky replacements of _g_ in signal_unix.go
+ 2022-08-02 74cee276fe runtime: tricky replacements of _g_ in trace.go
+ 2022-08-02 222799fde6 runtime: tricky replacements of _g_ in mgc.go
+ 2022-08-02 e9d7f54a1a runtime: tricky replacements of _g_ in proc.go
+ 2022-08-02 5e8d261918 runtime: rename _p_ to pp
+ 2022-08-02 0ad2ec6596 runtime: clean up dopanic_m
+ 2022-08-02 7e952962df runtime: clean up canpanic
+ 2022-08-02 9dbc0f3556 runtime: fix outdated g.m comment in traceback.go
+ 2022-08-02 d723df76da internal/goversion: update Version to 1.20
+ 2022-08-02 1b7e71e8ae all: disable tests that fail on Alpine
+ 2022-08-01 f2a9f3e2e0 test: improve generic type assertion test
+ 2022-08-01 27038b70f8 cmd/compile: fix wrong dict pass condition for type assertions
+ 2022-08-01 e99f53fed9 doc: move Go 1.19 release notes to x/website
+ 2022-08-01 8b13a073a1 doc: mention removal of cmd/compile's -importmap and -installsuffix flags
+ 2022-08-01 e95fd4c238 doc/go1.19: fix typo: EM_LONGARCH -> EM_LOONGARCH
+ 2022-08-01 dee3efd9f8 doc/go1.19: fix a few links that were missing trailing slashes
+ 2022-07-30 f32519e5fb runtime: fix typos
+ 2022-07-29 9a2001a8cc cmd/dist: always pass -short=true with -quick
+ 2022-07-28 5c8ec89cb5 doc/go1.19: minor adjustments and links
+ 2022-07-28 417be37048 doc/go1.19: improve the loong64 release notes
+ 2022-07-28 027855e8d8 os/exec: add GODEBUG setting to opt out of ErrDot changes

Change-Id: Idc0fbe93978c0dff7600b90a2c3ecc067fd9f5f2
2022-08-04 10:12:28 -07:00
Dmitri Shuralyov
85d87b9c75 all: update vendored golang.org/x dependencies for Go 1.20 development
Go 1.20 development is just beginning. This is a time to update all
golang.org/x/... module versions that contribute packages to the std
and cmd modules in the standard library to latest master versions.

This CL holds back some of the available updates to the x/net module
due to go.dev/issue/54259. It'll be updated in a later separate pass.
x/tools is also held back a bit to avoid pulling in too new of x/net.

For #36905.
For #53812.
Updates #54259.

Change-Id: Iaefe6a343a02cc5ceb85c15125882d64dd372627
Reviewed-on: https://go-review.googlesource.com/c/go/+/421334
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-04 17:12:04 +00:00
Russ Cox
fb1bfd4d37 all: remove pre-Go 1.17 workarounds
The Go bootstrap toolchain requirement is now Go 1.17.
We can finally delete all these pre-Go 1.17 workarounds.

For #44505.

Change-Id: I59d4dff1cde23da022892b5b6a116eb3dbad9ce4
Reviewed-on: https://go-review.googlesource.com/c/go/+/420903
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 17:05:18 +00:00
Austin Clements
44ff9bff0c runtime: clean up panic and deadlock lock ranks
I'm not entirely sure why these locks are currently ranked "deadlock <
panic" since we drop panic before acquiring deadlock, and we actually
want deadlock to be below panic because panic is implicitly below
everything else and we want deadlock to be, too. My best guess is that
we had this edge because we intentionally acquire deadlock twice to
deadlock, and that causes the lock rank checking to panic on the
second acquire.

Fix this in a more sensible way by capturing that deadlock can be
acquired in a self-cycle and flipping the rank to "panic < deadlock"
to express that deadlock needs to be under all other locks, just like
panic.

For #53789.

Change-Id: I8809e5d102ce473bd3ace0ba07bf2200ef60263f
Reviewed-on: https://go-review.googlesource.com/c/go/+/418719
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Austin Clements <austin@google.com>
2022-08-04 15:31:49 +00:00
Austin Clements
f42dc0de74 runtime: make the lock rank DAG make more sense
This groups, comments, and generally reorganizes the lock rank graph
description by subsystem. It also introduces several pseudo-nodes that
more cleanly describe the inherent layering of lock ranks by
subsystem.

I believe this doesn't actually change the graph, but haven't verified
this.

For #53789.

Change-Id: I72f332f5a23b8217c7dc1b21411631ad48cee4b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/418718
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-04 15:31:48 +00:00
Austin Clements
d29a0282e9 runtime: add mayAcquire annotation for finlock
We're missing lock edges to finlock that happen only rarely. Anything
that calls mallocgc can potentially trigger sweeping, which can
potentially queue a finalizer, which acquires finlock. While this can
happen on any malloc, it happens relatively rarely, so we simply
haven't seen some of the lock edges that could happen.

Add a mayAcquire annotation to mallocgc to capture the possibility of
acquiring finlock.

With this change, we add "fin" to the set of "malloc" locks. Several
of these edges were already there, but not quite all of them.

This was found by inspecting the rank graph for things that didn't
make sense.

For #53789.

Change-Id: Idc10ce6f250596b0c07ba07ac93f2198fb38c22b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418717
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:46 +00:00
Austin Clements
c5be4ed7df runtime: add missing trace lock edges
We're missing lock edges to trace.lock that happen only rarely. Any
trace event can potentially fill up a trace buffer and acquire
trace.lock in order to flush the buffer, but this happens relatively
rarely, so we simply haven't seen some of these lock edges that could
happen.

With this change, we promote "fin, notifyList < traceStackTab" to
"fin, notifyList < trace" and now everything that emits trace events
with a P enters the tracer lock ranks via "trace", rather than some
things entering at "trace" and others at "traceStackTab".

This was found by inspecting the rank graph for things that didn't
make sense.

Ideally we would add a mayAcquire annotation that any trace event can
potentially acquire trace.lock, but there are actually cases that
violate this ranking right now. This is #53979. The chance of a lock
cycle is extremely low given the number of conditions that have to
happen simultaneously.

For #53789.

Change-Id: Ic65947d27dee88d2daf639b21b2c9d37552f0ac0
Reviewed-on: https://go-review.googlesource.com/c/go/+/418716
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:45 +00:00
Austin Clements
2b8a9a484f runtime: generate the lock ranking from a DAG description
Currently, the runtime lock rank graph is maintained manually in a
large set of arrays that give the partial order and a manual
topological sort of this partial order. Any changes to the rank graph
are difficult to reason about and hard to review, as well as likely to
cause merge conflicts. Furthermore, because the partial order is
manually maintained, it's not actually transitively closed (though
it's close), meaning there are many cases where rank a can be acquired
before b and b before c, but a cannot be acquired before c. While this
isn't technically wrong, it's very strange in the context of lock
ordering.

Replace all of this with a much more compact, readable, and
maintainable description of the rank graph written in the internal/dag
graph language. We statically generate the runtime structures from
this description, which has the advantage that the parser doesn't have
to run during runtime initialization and the structures can live in
static data where they can be accessed from any point during runtime
init.

The current description was automatically generated from the existing
partial order, combined with a transitive reduction. This ensures it's
correct, but it could use some manual messaging to call out the
logical layers and add some structure.

We do lose the ad hoc string names of the lock ranks in this
translation, which could mostly be derived from the rank constant
names, but not always. I may bring those back but in a more uniform
way.

We no longer need the tests in lockrank_test.go because they were
checking that we manually maintained the structures correctly.

Fixes #53789.

Change-Id: I54451d561b22e61150aff7e9b8602ba9737e1b9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418715
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:44 +00:00
Austin Clements
ddfd639408 runtime: delete unused lock ranks
For #53789.

Change-Id: Ic7379afcfdcc47b541bac9b44b5bc6b43604fc0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/418714
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2022-08-04 15:31:43 +00:00
Austin Clements
426ea5702b internal/dag: add a Graph type and make node order deterministic
The go/types package doesn't care about node ordering because it's
just querying paths in the graph, but we're about to use this for the
runtime lock graph, and there we want determinism.

For #53789.

Change-Id: Ic41329bf2eb9a3a202f97c21c761ea588ca551c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/418593
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2022-08-04 15:31:42 +00:00
Austin Clements
d37cc9a8cd go/build, internal/dag: lift DAG parser into an internal package
This lifts the DAG parser from the go/build dependencies test into its
own package that can be reused elsewhere.

I tried to keep the code as close as possible. I changed some names to
reflect the more general purpose of internal/dag. Most of the changes
are related to error handling, since internal/dag doesn't take a
testing.T on which to report errors. Notably, parseRules now returns a
slice of parsed rules rather than calling a callback because this made
it easier to separate fatal parsing errors from non-fatal graph
checking errors.

For #53789.

Change-Id: I170b84fd85f971cfc1a50972156d48e78b45fce3
Reviewed-on: https://go-review.googlesource.com/c/go/+/418592
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:40 +00:00
Russ Cox
ab0a94c6d3 cmd/dist: require Go 1.17 for building Go
This makes builds using earlier Go bootstrap versions fail pretty clearly:

% GOROOT_BOOTSTRAP=$HOME/sdk/go1.16 ./make.bash
Building Go cmd/dist using /Users/rsc/sdk/go1.16. (go1.16 darwin/amd64)
found packages main (build.go) and building_Go_requires_Go_1_17_or_later (notgo117.go) in /Users/rsc/go/src/cmd/dist
%

All the builders have Go 1.17 or later for bootstrap now except
for the android corellium builders, which still need updating (#54246).
We are accepting breakage on those for now.

Fixes #44505.

Change-Id: I12a67f42f61dba43a331cee0a150194d3e42c044
Reviewed-on: https://go-review.googlesource.com/c/go/+/420902
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-08-04 14:47:49 +00:00
Dmitry Vyukov
1e3c19f3fe runtime: support riscv64 SV57 mode
riscv64 has SV57 mode when user-space VA is 56 bits.
Linux kernel recently got support for this mode and Go binaries started crashing as:

runtime: lfstack.push invalid packing: node=0xffffff5908a940 cnt=0x1
packed=0xffff5908a9400001 -> node=0xffff5908a940

Adjust lfstack code to use only 8 top bits of pointers on riscv64.

For context see:
https://groups.google.com/g/syzkaller-bugs/c/lU0GQTZoNQQ/m/O_c3vmE3AAAJ

Update #54104

Change-Id: Ib5d3d6a79c0c6eddf11618d73fcc8bc1832a9c25
Reviewed-on: https://go-review.googlesource.com/c/go/+/409055
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-08-04 05:33:40 +00:00
Russ Cox
f28fa952b5 make.bat, make.rc: show bootstrap toolchain version
Print the bootstrap toolchain version on Plan 9 and Windows,
same as on all Unix systems since CL 204757 (Nov 2019).
This makes it easier to see what is going on in a build.

For #44505.

Change-Id: I50cdd5e15a7c8b908e33e92780f8a3bca65c91ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/419452
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-03 19:52:27 +00:00
Than McIntosh
87384801dc cmd/asm: update package doc to describe "-p" option
Include a description of the assembler's "-p" command line option
in the package doc.

Fixes #54215.

Change-Id: I641abad573c37aa9447af6e8b84716093c2a2b70
Reviewed-on: https://go-review.googlesource.com/c/go/+/420900
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>
2022-08-03 19:25:54 +00:00
Matthew Dempsky
c9f2150cfb [dev.unified] cmd/compile: start using runtime dictionaries
This CL switches unified IR to start using runtime dictionaries,
rather than pure stenciling. In particular, for each instantiated
function `F[T]`, it now:

1. Generates a global variable `F[T]-dict` of type `[N]uintptr`, with
all of the `*runtime._type` values needed by `F[T]`.

2. Generates a function `F[T]-shaped`, with an extra
`.dict *[N]uintptr` parameter and indexing into that parameter for
derived types. (N.B., this function is not yet actually using shape
types.)

3. Changes `F[T]` to instead be a wrapper function that calls
`F[T]-shaped` passing `&F[T]-dict` as the `.dict` parameter.

This is done in one pass to make sure the overall wiring is all
working (especially, function literals and inlining).

Subsequent CLs will write more information into `F[T]-dict` and update
`F[T]-shaped` to use it instead of relying on `T`-derived information
itself. Once that's done, `F[T]-shaped` can be changed to
`F[shapify(T)]` (e.g., `F[go.shape.int]`) and deduplicated.

Change-Id: I0e802a4d9934794e01a6bfc367820af893335155
Reviewed-on: https://go-review.googlesource.com/c/go/+/420416
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-03 19:20:41 +00:00
Russ Cox
c6a2dada0d net: disable TestIPv6WriteMsgUDPAddrPortTargetAddrIPVersion [sic] on DragonflyBSD
Like OpenBSD, DragonflyBSD does not do IPv4-in-IPv6 mapping.

For #52264.

Change-Id: Id41606e75652e684f2e0e98c6459156641aec9b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/420775
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-03 13:50:38 +00:00
Michael Pratt
29b9a328d2 runtime: trivial replacements of g in remaining files
Rename g variables to gp for consistency.

Change-Id: I09ecdc7e8439637bc0e32f9c5f96f515e6436362
Reviewed-on: https://go-review.googlesource.com/c/go/+/418591
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:52:33 +00:00
Michael Pratt
c647264619 runtime: trivial replacements of g in signal_unix.go
Change-Id: I0d8d50c8b7ae6cd01594091392dc726cf149e34a
Reviewed-on: https://go-review.googlesource.com/c/go/+/418590
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:52:18 +00:00
Michael Pratt
399f50c9d7 runtime: tricky replacements of g in traceback.go
Change-Id: I80e847451b697de049a01df051a73b5976b39d4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/418589
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:52:13 +00:00
Michael Pratt
4509e951ec runtime: tricky replacements of g in proc.go
Change-Id: I36cd167ed77e123b3ba7dd4a1a8577cbc51a84d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/418588
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:52:08 +00:00
Michael Pratt
4400238ec8 runtime: trivial replacements of _g_ in remaining files
Change-Id: I24d299b345bda1c9d6fa7876d4f03c05b8c1156d
Reviewed-on: https://go-review.googlesource.com/c/go/+/418587
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:52:03 +00:00
Michael Pratt
5999a28de8 runtime: trivial replacements of _g_ in os files
Change-Id: I7886ea6b94697bafb8ea345508c9cb752c92cadc
Reviewed-on: https://go-review.googlesource.com/c/go/+/418586
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:51:58 +00:00
Michael Pratt
0e18cf6d09 runtime: trivial replacements of _g_ in GC files
Change-Id: Iedf10558d9a1d3b80a151927b99660b688ed9ccb
Reviewed-on: https://go-review.googlesource.com/c/go/+/418585
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:53 +00:00
Michael Pratt
4358a53a97 runtime: trivial replacements of _g_ in proc.go
Generated with global replace: 's/_g_/gp/g'.

Change-Id: Ia91606a0a8a5773be7c6e5152160510ae9bb221e
Reviewed-on: https://go-review.googlesource.com/c/go/+/418584
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:47 +00:00
Michael Pratt
b486518964 runtime: tricky replacements of _g_ in os3_solaris.go
The argument to semacreate is always getg().m.

Change-Id: I4c4104cd6b57ab6b9ed0b7d11b8089bcc9fdd621
Reviewed-on: https://go-review.googlesource.com/c/go/+/418583
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:42 +00:00
Michael Pratt
54a0ab3f7b runtime: tricky replacements of _g_ in os3_plan9.go
Change-Id: I2a3ec71a33380b1215b9ab1ceb0a9b0e2bf7835b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418582
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:38 +00:00
Michael Pratt
4240ff764b runtime: tricky replacements of _g_ in signal_windows.go
winthrow is always called on g0.

Change-Id: Ia23276a5bd545993faf4d75368c171f6ea7a3034
Reviewed-on: https://go-review.googlesource.com/c/go/+/418581
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:32 +00:00
Michael Pratt
8666d89ca8 runtime: tricky replacements of _g_ in signal_unix.go
sighandler has gp, the goroutine running when the signal arrived, and
gsignal, the goroutine executing the signal handler. The latter is
usually mp.gsignal, except in the case noted by the delayedSignal check.

Like previous CLs, cases where the getg() G is used only to access the M
are replaced with direct uses of mp.

Change-Id: I2dc7894da7004af17682712e07a0be5f9a235d81
Reviewed-on: https://go-review.googlesource.com/c/go/+/418580
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:51:27 +00:00
Michael Pratt
74cee276fe runtime: tricky replacements of _g_ in trace.go
Like previous CLs, cases where the getg() G is used only to access the M
are replaced with direct uses of mp.

Change-Id: I4740c80d6b4997d051a52afcfa8c087e0317dab3
Reviewed-on: https://go-review.googlesource.com/c/go/+/418579
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:51:22 +00:00
Michael Pratt
222799fde6 runtime: tricky replacements of _g_ in mgc.go
getg() is used primarily for gp.m, so use mp. gp.m.curg is also used,
name that curgp.

Change-Id: I9db2dc4adce2b17d6b41c60d4f2dfbc9aa41fac1
Reviewed-on: https://go-review.googlesource.com/c/go/+/418578
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:17 +00:00
Michael Pratt
e9d7f54a1a runtime: tricky replacements of _g_ in proc.go
This manually replaces uses of _g_ that cannot be trivially switched to
gp since there is another gp variable in scope.

Most of these functions only use the current g to reach the m, so this
helps with clarity by switching all accesses directly to an mp variable.

Change-Id: I96a4fc1c32470a7f3d12ddec9f147c2743210e71
Reviewed-on: https://go-review.googlesource.com/c/go/+/418577
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:12 +00:00
Michael Pratt
5e8d261918 runtime: rename _p_ to pp
_g_, _p_, and _m_ are primarily vestiges of the C version of the
runtime, while today we prefer Go-style variable names (generally gp,
pp, and mp).

This change replaces all remaining uses of _p_ with pp. These are all
trivial replacements (i.e., no conflicts). That said, there are several
functions that refer to two different Ps at once. There the naming
convention is generally that pp refers to the local P, and p2 refers to
the other P we are accessing.

Change-Id: I205b801be839216972e7644b1fbeacdbf2612859
Reviewed-on: https://go-review.googlesource.com/c/go/+/306674
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:06 +00:00
Michael Pratt
0ad2ec6596 runtime: clean up dopanic_m
gp is a user G running on the same M as getg(), so it is a fine proxy
for gp.m.

Change-Id: I9aa1dd283ecf28878eeedd7da4ded5c901809832
Reviewed-on: https://go-review.googlesource.com/c/go/+/418576
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:01 +00:00
Michael Pratt
7e952962df runtime: clean up canpanic
* The gp argument to canpanic is always equivalent to getg(), so no need
to pass it at all.
* gp must not be nil or _g_.m would have crashed, so no need to check
for nil.
* Use acquirem to better reason about preemption.

Change-Id: Ic7dc8dc1e56ab4c1644965f6aeba16807cdb2df4
Reviewed-on: https://go-review.googlesource.com/c/go/+/418575
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:50:55 +00:00
Michael Pratt
9dbc0f3556 runtime: fix outdated g.m comment in traceback.go
Change-Id: Idfd02781a9ee550da240ef53898943e8cd37dd64
Reviewed-on: https://go-review.googlesource.com/c/go/+/418574
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:50:48 +00:00
Dmitri Shuralyov
d723df76da internal/goversion: update Version to 1.20
This is the start of the Go 1.20 development cycle, so update the
Version value accordingly. It represents the Go 1.x version that
will soon open up for development (and eventually become released).

For #40705.
For #53812.

Change-Id: Ic8919a61c9b2f3139717434b9c776d1597175448
Reviewed-on: https://go-review.googlesource.com/c/go/+/420816
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-08-02 18:07:14 +00:00