1
0
mirror of https://github.com/golang/go synced 2024-11-15 05:20:21 -07:00
Commit Graph

59948 Commits

Author SHA1 Message Date
Paul E. Murphy
3aad2d0765 cmd/internal/obj/ppc64: fix incorrect int to int64 conversion when checking MOVD opcodes
A type conversion from int to int64 was done in the wrong place causing
some MOVD $const, Rx operations to be incorrectly transformed on 32 bit
hosts cross-compiling for ppc64x.

Fixes #66955

Change-Id: I023ba267a8dac6d6bd22f8146c0d9d2d473bc5c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/580796
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-24 15:53:25 +00:00
guoguangwu
4792ca7b93 doc: fix typos in docs
Change-Id: Ib51283b35d6d35acd7a90cd531ff6897a23d9894
GitHub-Last-Rev: dd485f332e
GitHub-Pull-Request: golang/go#66985
Reviewed-on: https://go-review.googlesource.com/c/go/+/580797
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joedian Reid <joedian@google.com>
2024-04-24 13:37:36 +00:00
Joe Tsai
62dfa43101 bytes: add test to ensure shallow copy of NewBuffer does not allocate
At present, there is no API to reset the underlying []byte
of an existing Buffer struct, except to shallow copy
the entire Buffer struct.

Updates #67004

Change-Id: I08998f7a95ae5bde0897d86247d47f23cd784583
Reviewed-on: https://go-review.googlesource.com/c/go/+/581297
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Joedian Reid <joedian@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-24 13:36:51 +00:00
Rhys Hiltner
fc6a5ea88c runtime: test mutex contention stacks and counts
Fully testing the runtime's profiles and metrics for contention on its
internal mutex values involves comparing two separate clocks (cputicks
for the profile and nanotime for the metric), verifying its fractional
sampling (when MutexProfileRate is greater than 1), and observing a very
small critical section outside of the test's control (semrelease).
Flakiness (#64253) from those parts of the test have led to skipping it
entirely.

But there are portions of the mutex profiling behavior that should have
more consistent behavior: for a mutex under the test's control, the test
and the runtime should be able to agree that the test successfully
induced contention, and should agree on the call stack that caused the
contention. Allow those more consistent parts to run.

For #64253

Change-Id: I7f368d3265a5c003da2765164276fab616eb9959
Reviewed-on: https://go-review.googlesource.com/c/go/+/581296
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
2024-04-24 13:36:48 +00:00
Austin Clements
960fa9bf66 sync: add examples for OnceValue and OnceValues
Updates #56102.

Change-Id: I2ee2dbc43b4333511d9d23752fdc574dfbf5f5bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/481062
Reviewed-by: Andrew Gerrand <adg@golang.org>
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joedian Reid <joedian@google.com>
2024-04-23 17:45:47 +00:00
gucio321
a62c290c50 src/buildall.bash: use grep -E instead of egrep
according to https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep egrep and fgrep should not be used anymore. thats why using buildall.bash throws the following warning: egrep: warning: egrep is obsolescent; using grep -E

Change-Id: I2f3be55ebaa7826a7f89a93d756e083b9bddfb03
GitHub-Last-Rev: 60be0651af
GitHub-Pull-Request: golang/go#66990
Reviewed-on: https://go-review.googlesource.com/c/go/+/581055
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-23 17:45:23 +00:00
Ian Lance Taylor
08e73e6152 debug/elf: remove incorrect doc link
Here Version is a field in Symbol, not the elf.Version type.

Change-Id: I0285937d806d1a9b53b49420b45a07744be244c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/563095
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-04-23 16:49:58 +00:00
Ian Lance Taylor
8d880da1c4 cmd/cgo/internal/test: don't skip some tests on musl
They reportedly work at least as of Alpine 3.18.

Fixes #39857

Change-Id: I6a249d61d33e467bf32e8c250f870fc261b90941
Reviewed-on: https://go-review.googlesource.com/c/go/+/563096
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2024-04-23 16:49:01 +00:00
racequite
83613293d8 all: fix some typos in comments
This change fixes some typographic errors that I found in various packages.

Change-Id: Ie2d0316f0137d6521496d389a9777659ae22128b
GitHub-Last-Rev: 0307b03d50
GitHub-Pull-Request: golang/go#66917
Reviewed-on: https://go-review.googlesource.com/c/go/+/580077
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2024-04-23 16:37:32 +00:00
Michael Anthony Knyszek
0304d035cd runtime: switch to systemstack before throw in casgstatus
CL 580255 increased the frame size of entersyscall and reentersyscall,
which is causing the x/sys repository to fail to build for
windows/arm64 because of an overflow of the nosplit stack reservation.

Fix this by wrapping the other call to throw in casgstatus in a system
stack switch. This is a fatal throw anyway indicating a core runtime
invariant is broken, so this path is basically never taken. This cuts
off the nosplit frame chain and allows x/sys to build.

Change-Id: I00b16c9db3a7467413ed48953c7f8a9a750f000a
Reviewed-on: https://go-review.googlesource.com/c/go/+/580775
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-23 02:53:00 +00:00
Cherry Mui
9702cd980f cmd/compile: mark closure DUPOK if the outer function is
If a function is DUPOK (e.g. an instantiation of a generic
function) and contains closures, the closure also needs to be
DUPOK. Otherwise, when the outer function is included in multiple
packages, the closure will also be included in these packages, and
the linker will dedup the outer function but not the closure,
causing duplicated symbols. In normal builds it is mostly still ok
as these closure symbols are only referenced by indices. But in
shared build mode all symbols are named and kept live, causing an
error.

Should fix the shared build mode.

Change-Id: I227d26e589465440335a4ec7e33d29739ed44aad
Reviewed-on: https://go-review.googlesource.com/c/go/+/580917
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-04-23 01:21:39 +00:00
Cherry Mui
0c39dc1ff7 runtime: reduce stack usage for asmcgocall on PPC64
Define it as ABIInternal, so the result does not take space on
stack.

Also use R10 as a temporary register for arithmetics on SP, so it
is hidden from the assembler's SP delta calculation, which is
irrelevant anyway as we are on the system stack.

Change-Id: I8fed467601c19cad2d7afab26978246d15ce3147
Reviewed-on: https://go-review.googlesource.com/c/go/+/580918
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-04-22 22:46:08 +00:00
Sabyrzhan Tasbolatov
552faa8927 runtime: reduced struct sizes found via pahole
During my research of pahole with Go structs, I've found couple of
structs in runtime/ pkg where we can reduce several structs' sizes
highligted by pahole tool which detect byte holes and paddings.

Overall, there are 80 bytes reduced.

Change-Id: I398e5ed6f5b199394307741981cb5ad5b875e98f
Reviewed-on: https://go-review.googlesource.com/c/go/+/578795
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-22 22:07:41 +00:00
Jes Cok
674657e130 net/http: correct error messages for TestParseSetCookie
This change fixes typos in error messages, while here, also improves
'line' strings to indicate the errEqualNotFoundInCookie error.

Change-Id: I0ce6115c605844d2d86f337f208fd3b2d3774674
Reviewed-on: https://go-review.googlesource.com/c/go/+/579799
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2024-04-22 22:06:46 +00:00
Lev Ustimenko
5a3b6400ef Refactor output message
"/reflect/all_test.go : refactor message."

This PR corrects a syntax

%value -> %v

Change-Id: Ie56b93d238f090c564a88eb963dc9b7773054356
GitHub-Last-Rev: 023fde3ed4
GitHub-Pull-Request: golang/go#66974
Reviewed-on: https://go-review.googlesource.com/c/go/+/580935
Reviewed-by: Joedian Reid <joedian@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-22 22:06:14 +00:00
Michael Anthony Knyszek
aa63ef4b8b internal/intern: delete unused package
The functionality within has been replaced with the unique package, and
all uses of it have been replaced by uses of the unique package.

Change-Id: I399ca72972c712711d4ec6a5ddbdbcba7088ecd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/577036
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-22 20:48:19 +00:00
Michael Anthony Knyszek
6737f4cee5 runtime: set gp.syscallbp from entersyscallblock_handoff
This was an oversight and is causing a few failures, most notably on
Solaris and Illumos, but also occasionally on the Linux builders.

Change-Id: I38bd28537ad01d955675f61f9b1d42b9ecdd1ef0
Reviewed-on: https://go-review.googlesource.com/c/go/+/580875
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-22 20:21:45 +00:00
Michael Pratt
1f4bcee2cd runtime: move zeroVal out of map.go
It isn't specific to maps, so put it in a more general location.

For #54766.

Change-Id: Ia3f3ebe8c347cfa5a8582082a306f4df4e05818d
Reviewed-on: https://go-review.googlesource.com/c/go/+/580777
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-22 20:09:01 +00:00
Keith Randall
9f9dd2bfd8 cmd/compile: fix cmpstring rewrite rule
We need to ensure that the Select0 lives in the same block as
its argument. Divide up the rule into 2 so that we can put the
parts in the right places.

(This would be simpler if we could use @block syntax mid-rule, but
that feature currently only works at the top level.)

This fixes the ssacheck builder after CL 578835

Change-Id: Id26a01d9fac0684e0b732d35d0f7999f6de07825
Reviewed-on: https://go-review.googlesource.com/c/go/+/580815
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-22 18:24:47 +00:00
Michael Anthony Knyszek
79065f0a5e net/netip: use the unique package instead of internal/intern
This change replaces net/netip's use of the internal/intern package with
the new unique package.

Below are the benchmark results for the package. Lots of things get
faster, but some things get slower. The single-core performance of
unique.Make is expected to be a tad slower than internal/intern, but is
vastly more scalable. No benchmark in this package currently
demonstrates this, however.

                                    │ before.bench  │             after.bench              │
                                    │    sec/op     │    sec/op      vs base               │
IPNextPrev-48                          85.66n ± ∞ ¹    85.61n ± ∞ ¹        ~ (p=0.690 n=5)
BinaryMarshalRoundTrip/ipv4-48         16.12n ± ∞ ¹    15.84n ± ∞ ¹   -1.74% (p=0.008 n=5)
BinaryMarshalRoundTrip/ipv6-48         33.14n ± ∞ ¹    32.49n ± ∞ ¹   -1.96% (p=0.016 n=5)
BinaryMarshalRoundTrip/ipv6+zone-48    88.84n ± ∞ ¹   101.50n ± ∞ ¹  +14.25% (p=0.008 n=5)
StdIPv4-48                             126.6n ± ∞ ¹    157.2n ± ∞ ¹  +24.17% (p=0.008 n=5)
IPv4-48                                101.2n ± ∞ ¹    101.0n ± ∞ ¹        ~ (p=0.452 n=5)
IPv4_inline-48                         131.7n ± ∞ ¹    101.2n ± ∞ ¹  -23.16% (p=0.008 n=5)
StdIPv6-48                             180.6n ± ∞ ¹    178.7n ± ∞ ¹   -1.05% (p=0.040 n=5)
IPv6-48                                136.7n ± ∞ ¹    137.4n ± ∞ ¹        ~ (p=0.135 n=5)
IPv4Contains-48                        4.650n ± ∞ ¹    5.287n ± ∞ ¹  +13.70% (p=0.008 n=5)
IPv6Contains-48                        5.284n ± ∞ ¹    5.290n ± ∞ ¹        ~ (p=0.540 n=5)
ParseAddr/v4-48                        23.94n ± ∞ ¹    23.62n ± ∞ ¹        ~ (p=0.841 n=5)
ParseAddr/v6-48                        84.95n ± ∞ ¹    80.64n ± ∞ ¹   -5.07% (p=0.008 n=5)
ParseAddr/v6_ellipsis-48               51.54n ± ∞ ¹    51.62n ± ∞ ¹        ~ (p=1.000 n=5)
ParseAddr/v6_v4-48                     55.85n ± ∞ ¹    56.56n ± ∞ ¹   +1.27% (p=0.008 n=5)
ParseAddr/v6_zone-48                   110.0n ± ∞ ¹    124.6n ± ∞ ¹  +13.27% (p=0.008 n=5)
StdParseIP/v4-48                       54.05n ± ∞ ¹    53.74n ± ∞ ¹   -0.57% (p=0.016 n=5)
StdParseIP/v6-48                       111.6n ± ∞ ¹    111.7n ± ∞ ¹        ~ (p=0.651 n=5)
StdParseIP/v6_ellipsis-48              81.81n ± ∞ ¹    82.15n ± ∞ ¹   +0.42% (p=0.008 n=5)
StdParseIP/v6_v4-48                    89.36n ± ∞ ¹    90.72n ± ∞ ¹   +1.52% (p=0.008 n=5)
StdParseIP/v6_zone-48                  138.7n ± ∞ ¹    150.7n ± ∞ ¹   +8.65% (p=0.008 n=5)
AddrString/v4-48                       36.43n ± ∞ ¹    36.33n ± ∞ ¹        ~ (p=0.508 n=5)
AddrString/v6-48                       106.1n ± ∞ ¹    102.5n ± ∞ ¹   -3.39% (p=0.008 n=5)
AddrString/v6_ellipsis-48              93.93n ± ∞ ¹    92.87n ± ∞ ¹   -1.13% (p=0.008 n=5)
AddrString/v6_v4-48                    43.09n ± ∞ ¹    43.33n ± ∞ ¹        ~ (p=0.111 n=5)
AddrString/v6_zone-48                  91.15n ± ∞ ¹    89.22n ± ∞ ¹   -2.12% (p=0.008 n=5)
IPStringExpanded/v4-48                 37.99n ± ∞ ¹    37.77n ± ∞ ¹   -0.58% (p=0.032 n=5)
IPStringExpanded/v6-48                 63.59n ± ∞ ¹    63.58n ± ∞ ¹        ~ (p=0.690 n=5)
IPStringExpanded/v6_ellipsis-48        64.33n ± ∞ ¹    63.50n ± ∞ ¹   -1.29% (p=0.024 n=5)
IPStringExpanded/v6_v4-48              64.79n ± ∞ ¹    63.08n ± ∞ ¹   -2.64% (p=0.008 n=5)
IPStringExpanded/v6_zone-48            111.7n ± ∞ ¹    109.7n ± ∞ ¹   -1.79% (p=0.016 n=5)
AddrMarshalText/v4-48                  34.45n ± ∞ ¹    34.04n ± ∞ ¹        ~ (p=0.151 n=5)
AddrMarshalText/v6-48                  105.2n ± ∞ ¹    102.6n ± ∞ ¹   -2.47% (p=0.008 n=5)
AddrMarshalText/v6_ellipsis-48         99.69n ± ∞ ¹    98.56n ± ∞ ¹        ~ (p=0.151 n=5)
AddrMarshalText/v6_v4-48               48.22n ± ∞ ¹    47.33n ± ∞ ¹        ~ (p=0.151 n=5)
AddrMarshalText/v6_zone-48             98.55n ± ∞ ¹    94.82n ± ∞ ¹   -3.78% (p=0.008 n=5)
AddrPortString/v4-48                   59.03n ± ∞ ¹    50.09n ± ∞ ¹  -15.14% (p=0.008 n=5)
AddrPortString/v6-48                   118.2n ± ∞ ¹    113.3n ± ∞ ¹   -4.15% (p=0.008 n=5)
AddrPortString/v6_ellipsis-48          110.1n ± ∞ ¹    107.3n ± ∞ ¹   -2.54% (p=0.008 n=5)
AddrPortString/v6_v4-48                66.48n ± ∞ ¹    58.80n ± ∞ ¹  -11.55% (p=0.008 n=5)
AddrPortString/v6_zone-48              106.7n ± ∞ ¹    104.9n ± ∞ ¹   -1.69% (p=0.008 n=5)
AddrPortMarshalText/v4-48              56.67n ± ∞ ¹    54.19n ± ∞ ¹   -4.38% (p=0.008 n=5)
AddrPortMarshalText/v6-48              125.1n ± ∞ ¹    122.1n ± ∞ ¹   -2.40% (p=0.008 n=5)
AddrPortMarshalText/v6_ellipsis-48     120.1n ± ∞ ¹    118.0n ± ∞ ¹   -1.75% (p=0.024 n=5)
AddrPortMarshalText/v6_v4-48           71.53n ± ∞ ¹    70.25n ± ∞ ¹        ~ (p=0.548 n=5)
AddrPortMarshalText/v6_zone-48         116.4n ± ∞ ¹    114.0n ± ∞ ¹   -2.06% (p=0.016 n=5)
PrefixMasking/IPv4_/32-48              5.259n ± ∞ ¹    5.289n ± ∞ ¹   +0.57% (p=0.016 n=5)
PrefixMasking/IPv4_/17-48              5.286n ± ∞ ¹    5.284n ± ∞ ¹        ~ (p=0.937 n=5)
PrefixMasking/IPv4_/0-48               5.266n ± ∞ ¹    5.280n ± ∞ ¹        ~ (p=0.151 n=5)
PrefixMasking/IPv6_/128-48             5.271n ± ∞ ¹    5.284n ± ∞ ¹        ~ (p=0.151 n=5)
PrefixMasking/IPv6_/65-48              5.256n ± ∞ ¹    5.282n ± ∞ ¹        ~ (p=0.317 n=5)
PrefixMasking/IPv6_/0-48               5.253n ± ∞ ¹    5.284n ± ∞ ¹        ~ (p=0.095 n=5)
PrefixMasking/IPv6_zone_/128-48        5.274n ± ∞ ¹    5.284n ± ∞ ¹        ~ (p=0.222 n=5)
PrefixMasking/IPv6_zone_/65-48         5.280n ± ∞ ¹    5.291n ± ∞ ¹        ~ (p=0.095 n=5)
PrefixMasking/IPv6_zone_/0-48          5.283n ± ∞ ¹    5.292n ± ∞ ¹        ~ (p=0.095 n=5)
PrefixMarshalText-48                   44.60n ± ∞ ¹    44.81n ± ∞ ¹        ~ (p=1.000 n=5)
ParseAddrPort/v4-48                    46.40n ± ∞ ¹    41.27n ± ∞ ¹  -11.06% (p=0.008 n=5)
ParseAddrPort/v6-48                   106.90n ± ∞ ¹    99.29n ± ∞ ¹   -7.12% (p=0.008 n=5)
ParseAddrPort/v6_ellipsis-48           77.10n ± ∞ ¹    69.98n ± ∞ ¹   -9.23% (p=0.008 n=5)
ParseAddrPort/v6_v4-48                 71.82n ± ∞ ¹    74.97n ± ∞ ¹   +4.39% (p=0.008 n=5)
ParseAddrPort/v6_zone-48               130.0n ± ∞ ¹    148.5n ± ∞ ¹  +14.23% (p=0.008 n=5)
As16-48                                7.446n ± ∞ ¹    7.437n ± ∞ ¹        ~ (p=0.286 n=5)
geomean                                45.52n          45.18n         -0.76%
¹ need >= 6 samples for confidence interval at level 0.95

                                   │ before.bench │             after.bench             │
                                   │     B/op     │    B/op      vs base                │
StdIPv4-48                            16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv4-48                               0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv4_inline-48                        0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdIPv6-48                            16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv6-48                               0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv4Contains-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv6Contains-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v4-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6_ellipsis-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6_v4-48                    0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6_zone-48                  0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v4-48                      16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6-48                      16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6_ellipsis-48             16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6_v4-48                   16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6_zone-48                 16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v4-48                      16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6-48                      48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6_ellipsis-48             24.00 ± ∞ ¹   24.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6_v4-48                   24.00 ± ∞ ¹   24.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6_zone-48                 24.00 ± ∞ ¹   24.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v4-48                16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6-48                48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6_ellipsis-48       48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6_v4-48             48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6_zone-48           128.0 ± ∞ ¹   128.0 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v4-48                 16.00 ± ∞ ¹   16.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6-48                 48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6_ellipsis-48        48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6_v4-48              32.00 ± ∞ ¹   32.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6_zone-48            48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v4-48                  24.00 ± ∞ ¹   24.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6-48                  48.00 ± ∞ ¹   48.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6_ellipsis-48         32.00 ± ∞ ¹   32.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6_v4-48               32.00 ± ∞ ¹   32.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6_zone-48             32.00 ± ∞ ¹   32.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v4-48             24.00 ± ∞ ¹   24.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6-48             64.00 ± ∞ ¹   64.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6_ellipsis-48    64.00 ± ∞ ¹   64.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6_v4-48          64.00 ± ∞ ¹   64.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6_zone-48        64.00 ± ∞ ¹   64.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv4_/32-48             0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv4_/17-48             0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv4_/0-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_/128-48            0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_/65-48             0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_/0-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_zone_/128-48       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_zone_/65-48        0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_zone_/0-48         0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMarshalText-48                  24.00 ± ∞ ¹   24.00 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v4-48                   0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6-48                   0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6_ellipsis-48          0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6_v4-48                0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6_zone-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
geomean                                         ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

                                   │ before.bench │             after.bench             │
                                   │  allocs/op   │  allocs/op   vs base                │
StdIPv4-48                            1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv4-48                               0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv4_inline-48                        0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdIPv6-48                            1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv6-48                               0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv4Contains-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPv6Contains-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v4-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6-48                       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6_ellipsis-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6_v4-48                    0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddr/v6_zone-48                  0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v4-48                      1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6-48                      1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6_ellipsis-48             1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6_v4-48                   1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
StdParseIP/v6_zone-48                 1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v4-48                      1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6-48                      1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6_ellipsis-48             1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6_v4-48                   1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrString/v6_zone-48                 1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v4-48                1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6-48                1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6_ellipsis-48       1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6_v4-48             1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
IPStringExpanded/v6_zone-48           2.000 ± ∞ ¹   2.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v4-48                 1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6-48                 1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6_ellipsis-48        1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6_v4-48              1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrMarshalText/v6_zone-48            1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v4-48                  1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6-48                  1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6_ellipsis-48         1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6_v4-48               1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortString/v6_zone-48             1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v4-48             1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6-48             1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6_ellipsis-48    1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6_v4-48          1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
AddrPortMarshalText/v6_zone-48        1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv4_/32-48             0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv4_/17-48             0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv4_/0-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_/128-48            0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_/65-48             0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_/0-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_zone_/128-48       0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_zone_/65-48        0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMasking/IPv6_zone_/0-48         0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
PrefixMarshalText-48                  1.000 ± ∞ ¹   1.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v4-48                   0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6-48                   0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6_ellipsis-48          0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6_v4-48                0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
ParseAddrPort/v6_zone-48              0.000 ± ∞ ¹   0.000 ± ∞ ¹       ~ (p=1.000 n=5) ²
geomean                                         ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

Change-Id: Ieec7d1f0836f3ee93a33653aee9b0c0fc77f399d
Reviewed-on: https://go-review.googlesource.com/c/go/+/577035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-04-22 18:14:15 +00:00
Michael Anthony Knyszek
a088e230d4 unique: add unique package and implement Make/Handle
This change adds the unique package for canonicalizing values, as
described by the proposal in #62483.

Fixes #62483.

Change-Id: I1dc3d34ec12351cb4dc3838a8ea29a5368d59e99
Reviewed-on: https://go-review.googlesource.com/c/go/+/574355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ingo Oeser <nightlyone@googlemail.com>
Reviewed-by: David Chase <drchase@google.com>
2024-04-22 18:14:07 +00:00
Ian Lance Taylor
654c3368e5 cmd/go: update comment to not say GO386 does not exist
GO386 was removed by CL 258957, but it was restored by CL 260017.

Change-Id: Iced49ca61512a0f2ef513acbf9700a87ac964c68
Reviewed-on: https://go-review.googlesource.com/c/go/+/580675
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2024-04-22 17:58:25 +00:00
Than McIntosh
ed2671aa15 cmd/link/internal/ld: temporarily add skip for new portion of TestElfBindNow
Skip newly added sections in TestElfBindNow from elf_test.go
temporarily pending resolution of failures on loong64 and ppc64le.

Change-Id: I22e0e52c9fbbcad88a4d0088f631ed7be15bf9da
Reviewed-on: https://go-review.googlesource.com/c/go/+/580776
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-22 17:13:24 +00:00
zhangjian
734fd7a949 cmd/compile/internal/ssa: fix the description of auxCCop as auxInt
The auxCCop has been modified from aux to auxInt in CL 252517.

Change-Id: I5c472d684c51fd38fd38f61561d1b1644e20bafe
GitHub-Last-Rev: 78d1cf40f4
GitHub-Pull-Request: golang/go#66950
Reviewed-on: https://go-review.googlesource.com/c/go/+/580635
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joedian Reid <joedian@google.com>
2024-04-22 15:29:10 +00:00
jeffery
69aa1974f3 cmd/compile: combine phielim and copyelim into a single pass
Change-Id: Id21145b14169d28bac2144a31f6d3d9729f4be1e
GitHub-Last-Rev: 5413f4753e
GitHub-Pull-Request: golang/go#63818
Reviewed-on: https://go-review.googlesource.com/c/go/+/538535
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-22 14:55:18 +00:00
Rhys Hiltner
4bb67bc21e runtime: always acquire M when acquiring locks by rank
Profiling of runtime-internal locks checks gp.m.locks to see if it's
safe to add a new record to the profile, but direct use of
acquireLockRank can change the list of the M's active lock ranks without
updating gp.m.locks to match. The runtime's internal rwmutex
implementation makes a point of calling acquirem/releasem when
manipulating the lock rank list, but the other user of acquireLockRank
(the GC's Gscan bit) relied on the GC's invariants to avoid deadlocks.

Codify the rwmutex approach by renaming acquireLockRank to
acquireLockRankAndM and having it include a call to aquirem. Do the same
for release.

Fixes #64706
Fixes #66004

Change-Id: Ib76eaa0cc1c45b64861d03345e17e1e843c19713
GitHub-Last-Rev: 160577bdb2
GitHub-Pull-Request: golang/go#66276
Reviewed-on: https://go-review.googlesource.com/c/go/+/571056
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-04-22 14:29:04 +00:00
Than McIntosh
2dddc7ef88 cmd/link: move .dynamic and .got sections to relro if applicable
This is the second of two CLs to roll forward the changes in CL
473495, which was subsequently reverted.

In this patch we move the .dynamic and .got sections from the writable
data segment to the relro segment if the platform supports relro and
we're producing a PIE binary, and also moves .got.plt into relro if
eager binding is in effect (e.g. -bindnow or -Wl,-z,now).

Updates #45681.

Change-Id: I9f4fba6e825b96d1b5e27fb75844450dd0a650b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/571417
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-22 13:29:54 +00:00
Michael Pratt
7f76c00fc5 internal/reflectlite: remove unused mapType
Change-Id: I715186c053bc9911b912e69904735c9498bf9c13
Reviewed-on: https://go-review.googlesource.com/c/go/+/580376
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2024-04-19 21:11:15 +00:00
Ian Lance Taylor
903e0ffbed reflect: remove unnecessary type conversions of untyped PtrSize
Change-Id: I0f20020c2929b58958ce228b9f175d5b4fd77a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/578855
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2024-04-19 18:02:47 +00:00
Keith Randall
35c619398b runtime: for fallback hash, get rid of constant xors
There's no need for these. If hashkey[i] is uniform over [0,1<<64), then
hashkey[0]^C has exactly the same distribution, for any constant C.

Change-Id: I4e10c27eff15e4b7a45139654ac41f410b1b12fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/580218
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-19 17:39:28 +00:00
khr@golang.org
c260de24b6 runtime: remove odd-forcing of hash constants
We don't multiply by them any more, so no need to make them odd.

Suggested by me here in 2021:
https://go-review.googlesource.com/c/go/+/280372/comment/1a86b8aa_f64310bf/
Never got around to it until now.

Change-Id: Iddc675e6a18b4a7a785acbf77c96e127003cc3c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/579116
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-19 17:39:06 +00:00
khr@golang.org
ef2f3391da runtime: make it harder to find collisions in the 64-bit fallback hash
Currently the first argument to mix() can be set by an attacker, as it
is just the input bytes xored by some constants. That lets an attacker
set the value being multipled by to 0. That can lead to lots of
collisions. To fix, xor the first argument with the process-wide seed,
so the magic collision-generating value isn't a constant known to the
attacker.  (Maybe there's a timing attack that could figure out the
process-wide seed, but that's a much harder attack.)

Fixes #66841

Change-Id: I33e073c78355d1cee08660de52074e6ccc38b426
Reviewed-on: https://go-review.googlesource.com/c/go/+/579115
Reviewed-by: M Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-04-19 17:38:07 +00:00
Michael Anthony Knyszek
2b82a4f488 runtime: track frame pointer while in syscall
Currently the runtime only tracks the PC and SP upon entering a syscall,
but not the FP (BP). This is mainly for historical reasons, and because
the tracer (which uses the frame pointer unwinder) does not need it.

Until it did, of course, in CL 567076, where the tracer tries to take a
stack trace of a goroutine that's in a syscall from afar. It tries to
use gp.sched.bp and lots of things go wrong. It *really* should be using
the equivalent of gp.syscallbp, which doesn't exist before this CL.

This change introduces gp.syscallbp and tracks it. It also introduces
getcallerfp which is nice for simplifying some code. Because we now have
gp.syscallbp, we can also delete the frame skip count computation in
traceLocker.GoSysCall, because it's now the same regardless of whether
frame pointer unwinding is used.

Fixes #66889.

Change-Id: Ib6d761c9566055e0a037134138cb0f81be73ecf7
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-nocgo
Reviewed-on: https://go-review.googlesource.com/c/go/+/580255
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 17:25:00 +00:00
Michael Anthony Knyszek
dcb5de5cac cmd/trace/v2: tolerate traces with broken tails
This change modifies cmd/trace/v2 to tolerate traces with
incomplete/broken generations at the tail. These broken tails can be
created if a program crashes while a trace is being produced. Although
the runtime tries to flush the trace on some panics, it may still
produce some extra trace data that is incomplete.

This change modifies cmd/trace/v2 to still work on any complete
generations, even if there are incomplete/broken generations at the tail
end of the trace. Basically, the tool now just tracks when the last good
generation ended (via Sync events) and truncates the trace to that point
when it encounters an error.

This change also revamps the text output of the tool to emit regular
progress notifications as well as warnings as to how much of the trace
data was lost.

Fixes #65316.

Change-Id: I877d39993bc02a81eebe647db9c2be17635bcec8
Reviewed-on: https://go-review.googlesource.com/c/go/+/580135
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
2024-04-19 17:23:57 +00:00
Michael Anthony Knyszek
4324d5a88c internal/concurrent: handle boundary case for hash bits in HashTrieMap
Currently the HashTrieMap has a panic for running out of hash bits, but
it turns out we can end up in these paths in valid cases, like inserting
or deleting an element that requires *all* the hash bits to finds its
position in the tree. There's basically an off-by-one error here where
the panic fires erroneously.

This wasn't caught before the original CL landed because it's very
unlikely on 64-bit platforms, with a 64-bit hash, but much more likely
on 32-bit platforms, where using all 32 bits of a 32-bit hash is much
more likely.

This CL makes the condition for panicking much more explicit, which
avoids the off-by-one error.

After this CL, I can't get the tests to fail on 32-bit under stress
testing.

Change-Id: I855e301e3b3893e2b6b017f6dd9f3d83a94a558d
Reviewed-on: https://go-review.googlesource.com/c/go/+/580138
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
2024-04-19 17:16:47 +00:00
Ian Lance Taylor
2ff89341f6 reflect: omit anonymous field name from StructOf type string
This makes the reflect package match the compiler for StructOf
with an embedded field.

Fixes #24781

Change-Id: Ice64b167cbe0b9d30a953c5d8e2a86f3ad1158bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/567897
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-04-19 17:15:47 +00:00
Roland Shoemaker
f0d6ddfac0 crypto/tls: don't cache marshal'd bytes
Only cache the wire representation for clientHelloMsg and serverHelloMsg
during unmarshal, which are the only places we actually need to hold
onto them. For everything else, remove the raw field.

This appears to have zero performance impact:

name                                               old time/op   new time/op   delta
CertCache/0-10                                       177µs ± 2%    189µs ±11%   ~     (p=0.700 n=3+3)
CertCache/1-10                                       184µs ± 3%    182µs ± 6%   ~     (p=1.000 n=3+3)
CertCache/2-10                                       187µs ±12%    187µs ± 2%   ~     (p=1.000 n=3+3)
CertCache/3-10                                       204µs ±21%    187µs ± 1%   ~     (p=0.700 n=3+3)
HandshakeServer/RSA-10                               410µs ± 2%    410µs ± 3%   ~     (p=1.000 n=3+3)
HandshakeServer/ECDHE-P256-RSA/TLSv13-10             473µs ± 3%    460µs ± 2%   ~     (p=0.200 n=3+3)
HandshakeServer/ECDHE-P256-RSA/TLSv12-10             498µs ± 3%    489µs ± 2%   ~     (p=0.700 n=3+3)
HandshakeServer/ECDHE-P256-ECDSA-P256/TLSv13-10      140µs ± 5%    138µs ± 5%   ~     (p=1.000 n=3+3)
HandshakeServer/ECDHE-P256-ECDSA-P256/TLSv12-10      132µs ± 1%    133µs ± 2%   ~     (p=0.400 n=3+3)
HandshakeServer/ECDHE-X25519-ECDSA-P256/TLSv13-10    168µs ± 1%    171µs ± 4%   ~     (p=1.000 n=3+3)
HandshakeServer/ECDHE-X25519-ECDSA-P256/TLSv12-10    166µs ± 3%    163µs ± 0%   ~     (p=0.700 n=3+3)
HandshakeServer/ECDHE-P521-ECDSA-P521/TLSv13-10     1.87ms ± 2%   1.81ms ± 0%   ~     (p=0.100 n=3+3)
HandshakeServer/ECDHE-P521-ECDSA-P521/TLSv12-10     1.86ms ± 0%   1.86ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/1MB/TLSv12-10                  6.79ms ± 3%   6.73ms ± 0%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/1MB/TLSv13-10                  6.73ms ± 1%   6.75ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv12-10                  12.8ms ± 2%   12.7ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv13-10                  13.1ms ± 3%   12.8ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/4MB/TLSv12-10                  24.9ms ± 2%   24.7ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/4MB/TLSv13-10                  26.0ms ± 4%   24.9ms ± 1%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/8MB/TLSv12-10                  50.0ms ± 3%   48.9ms ± 0%   ~     (p=0.200 n=3+3)
Throughput/MaxPacket/8MB/TLSv13-10                  49.8ms ± 2%   49.3ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/16MB/TLSv12-10                 97.3ms ± 1%   97.4ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/16MB/TLSv13-10                 97.9ms ± 0%   97.9ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/32MB/TLSv12-10                  195ms ± 0%    194ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/32MB/TLSv13-10                  196ms ± 0%    196ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/64MB/TLSv12-10                  405ms ± 3%    385ms ± 0%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/64MB/TLSv13-10                  391ms ± 1%    388ms ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/1MB/TLSv12-10              6.75ms ± 0%   6.75ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/1MB/TLSv13-10              6.84ms ± 1%   6.77ms ± 0%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/2MB/TLSv12-10              12.8ms ± 1%   12.8ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/DynamicPacket/2MB/TLSv13-10              12.8ms ± 1%   13.0ms ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/4MB/TLSv12-10              24.8ms ± 1%   24.8ms ± 0%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/4MB/TLSv13-10              25.1ms ± 2%   25.1ms ± 1%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/8MB/TLSv12-10              49.2ms ± 2%   48.9ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/8MB/TLSv13-10              49.3ms ± 1%   49.4ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/16MB/TLSv12-10             97.1ms ± 0%   98.0ms ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/16MB/TLSv13-10             98.8ms ± 1%   98.4ms ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/32MB/TLSv12-10              192ms ± 0%    198ms ± 5%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/32MB/TLSv13-10              194ms ± 0%    196ms ± 1%   ~     (p=0.400 n=3+3)
Throughput/DynamicPacket/64MB/TLSv12-10              385ms ± 1%    384ms ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/64MB/TLSv13-10              387ms ± 0%    388ms ± 0%   ~     (p=0.400 n=3+3)
Latency/MaxPacket/200kbps/TLSv12-10                  694ms ± 0%    694ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/200kbps/TLSv13-10                  699ms ± 0%    699ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/500kbps/TLSv12-10                  278ms ± 0%    278ms ± 0%   ~     (p=0.400 n=3+3)
Latency/MaxPacket/500kbps/TLSv13-10                  280ms ± 0%    280ms ± 0%   ~     (p=1.000 n=3+3)
Latency/MaxPacket/1000kbps/TLSv12-10                 140ms ± 1%    140ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/1000kbps/TLSv13-10                 141ms ± 0%    141ms ± 0%   ~     (p=1.000 n=3+3)
Latency/MaxPacket/2000kbps/TLSv12-10                70.5ms ± 0%   70.4ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/2000kbps/TLSv13-10                70.7ms ± 0%   70.7ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/5000kbps/TLSv12-10                28.8ms ± 0%   28.8ms ± 0%   ~     (p=0.700 n=3+3)
Latency/MaxPacket/5000kbps/TLSv13-10                28.9ms ± 0%   28.9ms ± 0%   ~     (p=0.700 n=3+3)
Latency/DynamicPacket/200kbps/TLSv12-10              134ms ± 0%    134ms ± 0%   ~     (p=0.700 n=3+3)
Latency/DynamicPacket/200kbps/TLSv13-10              138ms ± 0%    138ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/500kbps/TLSv12-10             54.1ms ± 0%   54.1ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/500kbps/TLSv13-10             55.7ms ± 0%   55.7ms ± 0%   ~     (p=0.100 n=3+3)
Latency/DynamicPacket/1000kbps/TLSv12-10            27.6ms ± 0%   27.6ms ± 0%   ~     (p=0.200 n=3+3)
Latency/DynamicPacket/1000kbps/TLSv13-10            28.4ms ± 0%   28.4ms ± 0%   ~     (p=0.200 n=3+3)
Latency/DynamicPacket/2000kbps/TLSv12-10            14.4ms ± 0%   14.4ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/2000kbps/TLSv13-10            14.6ms ± 0%   14.6ms ± 0%   ~     (p=1.000 n=3+3)
Latency/DynamicPacket/5000kbps/TLSv12-10            6.44ms ± 0%   6.45ms ± 0%   ~     (p=0.100 n=3+3)
Latency/DynamicPacket/5000kbps/TLSv13-10            6.49ms ± 0%   6.49ms ± 0%   ~     (p=0.700 n=3+3)

name                                               old speed     new speed     delta
Throughput/MaxPacket/1MB/TLSv12-10                 155MB/s ± 3%  156MB/s ± 0%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/1MB/TLSv13-10                 156MB/s ± 1%  155MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv12-10                 163MB/s ± 2%  165MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/2MB/TLSv13-10                 160MB/s ± 3%  164MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/4MB/TLSv12-10                 168MB/s ± 2%  170MB/s ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/4MB/TLSv13-10                 162MB/s ± 4%  168MB/s ± 1%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/8MB/TLSv12-10                 168MB/s ± 3%  172MB/s ± 0%   ~     (p=0.200 n=3+3)
Throughput/MaxPacket/8MB/TLSv13-10                 168MB/s ± 2%  170MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/16MB/TLSv12-10                172MB/s ± 1%  172MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/16MB/TLSv13-10                171MB/s ± 0%  171MB/s ± 1%   ~     (p=1.000 n=3+3)
Throughput/MaxPacket/32MB/TLSv12-10                172MB/s ± 0%  173MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/MaxPacket/32MB/TLSv13-10                171MB/s ± 0%  172MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/MaxPacket/64MB/TLSv12-10                166MB/s ± 3%  174MB/s ± 0%   ~     (p=0.100 n=3+3)
Throughput/MaxPacket/64MB/TLSv13-10                171MB/s ± 1%  173MB/s ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/1MB/TLSv12-10             155MB/s ± 0%  155MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/1MB/TLSv13-10             153MB/s ± 1%  155MB/s ± 0%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/2MB/TLSv12-10             164MB/s ± 1%  164MB/s ± 1%   ~     (p=0.400 n=3+3)
Throughput/DynamicPacket/2MB/TLSv13-10             163MB/s ± 1%  162MB/s ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/4MB/TLSv12-10             169MB/s ± 1%  169MB/s ± 0%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/4MB/TLSv13-10             167MB/s ± 1%  167MB/s ± 1%   ~     (p=1.000 n=3+3)
Throughput/DynamicPacket/8MB/TLSv12-10             170MB/s ± 2%  171MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/8MB/TLSv13-10             170MB/s ± 1%  170MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/16MB/TLSv12-10            173MB/s ± 0%  171MB/s ± 1%   ~     (p=0.200 n=3+3)
Throughput/DynamicPacket/16MB/TLSv13-10            170MB/s ± 1%  170MB/s ± 1%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/32MB/TLSv12-10            175MB/s ± 0%  170MB/s ± 5%   ~     (p=0.100 n=3+3)
Throughput/DynamicPacket/32MB/TLSv13-10            173MB/s ± 0%  171MB/s ± 1%   ~     (p=0.300 n=3+3)
Throughput/DynamicPacket/64MB/TLSv12-10            174MB/s ± 1%  175MB/s ± 0%   ~     (p=0.700 n=3+3)
Throughput/DynamicPacket/64MB/TLSv13-10            174MB/s ± 0%  173MB/s ± 0%   ~     (p=0.400 n=3+3)

Change-Id: Ifa79cce002011850ed8b2835edd34f60e014eea8
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-arm64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/580215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2024-04-19 16:55:49 +00:00
Michael Pratt
1a3682b4c1 runtime: use bootstrapRand to initialize hashkey
The seed for rand is not initialized until after alginit. Before
initialization, rand returns a deterministic sequence, making hashkey
deterministic across processes.

Switch to bootstrapRand, like other early rand calls, such as
initialization of aeskeysched.

Fixes #66885.

Change-Id: I5023a9161232b49fda2ebd1d5f9338bbdd17b1fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/580136
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2024-04-19 16:34:32 +00:00
khr@golang.org
1a0b86375f cmd/compile: remove redundant calls to cmpstring
The results of cmpstring are reuseable if the second call has the
same arguments and memory.

Note that this gets rid of cmpstring, but we still generate a
redundant </<= test and branch afterwards, because the compiler
doesn't know that cmpstring only ever returns -1,0,1.

Update #61725

Change-Id: I93a0d1ccca50d90b1e1a888240ffb75a3b10b59b
Reviewed-on: https://go-review.googlesource.com/c/go/+/578835
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 16:31:02 +00:00
Michael Pratt
d428a63875 internal/goexperiment: remove unused range experiment
This experiment was added mistakenly in https://go.dev/cl/537980,
probably as the result of a bad rebase on https://go.dev/cl/539277.

Change-Id: Ia3fc75725535ac70a2e6dd655440a2f515405c48
Reviewed-on: https://go-review.googlesource.com/c/go/+/580375
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 16:08:40 +00:00
Tobias Klauser
974b2011ca internal/syscall/unix: implement Eaccess on darwin
Like on other Unix-like platforms, use faccessat(AT_FDCWD, path, mode,
AT_EACCESS).

Change-Id: I6e04b4244f8e90bd3b35b1b8a9ca38fe845b34ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/579976
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-04-19 15:02:38 +00:00
Jacob
104c293ffe syscall/js: allocate arg slices on stack for small numbers of args
The existing implementation causes unnecessary heap allocations for
javascript syscalls: Call, Invoke, and New. The new change seeks to
hint the Go compiler to allocate arg slices with length <=16 to the
stack.

Original Work: CL 367045
- Calling a JavaScript function with 16 arguments or fewer will not
induce two additional heap allocations, at least with the current Go
compiler.
- Using syscall/js features with slices and strings of
statically-known length will not cause them to be escaped to the heap,
at least with the current Go compiler.
- The reduction in allocations has the additional benefit that the
garbage collector runs less often, blocking WebAssembly's one and only
thread less often.

Fixes #39740

Change-Id: I815047e1d4f8ada796318e2064d38d3e63f73098
GitHub-Last-Rev: 36df1b33a4
GitHub-Pull-Request: golang/go#66684
Reviewed-on: https://go-review.googlesource.com/c/go/+/576575
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-19 14:35:26 +00:00
Jes Cok
f31fcc7538 doc: make symbol links simpler for relnotes
This is a follow-up to CL 578195.

Change-Id: I6466ff8753f05a9424a8098cd88490aab6b236c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/580277
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-04-19 14:33:17 +00:00
Nuno Gonçalves
a63907808d net/http: add field Cookie.Quoted bool
The current implementation of the http package strips double quotes
from the cookie-value during parsing, resulting in the serialized
cookie not including them. This patch addresses this limitation by
introducing a new field to track whether the original value was
enclosed in quotes.

Additionally, the internal representation of a cookie in the cookiejar
package has been adjusted to align with the new representation.

The syntax of cookies is outlined in RFC 6265 Section 4.1.1:
https://datatracker.ietf.org/doc/html/rfc6265\#section-4.1.1

Fixes #46443

Change-Id: Iac12a56397d77a6060a75757ab0daeacc60457f3
GitHub-Last-Rev: a76440e741
GitHub-Pull-Request: golang/go#66752
Reviewed-on: https://go-review.googlesource.com/c/go/+/577755
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 00:32:19 +00:00
Alan Donovan
01064622a2 go/types: add Func.Signature method
Unfortunately we can't enforce the repr invariant
that Func.typ != nil without thinking about the
object color invariants. For now, return a trivial
Signature if typ == nil, which should never happen
in bug-free client code.

Fixes golang/go#65772

Change-Id: I7f89c6d8fdc8dcd4b8880572e54bb0ed9b6136eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/565375
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 22:17:27 +00:00
Michael Anthony Knyszek
dfc86e922c internal/weak: add package implementing weak pointers
This change adds the internal/weak package, which exposes GC-supported
weak pointers to the standard library. This is for the upcoming weak
package, but may be useful for other future constructs.

For #62483.

Change-Id: I4aa8fa9400110ad5ea022a43c094051699ccab9d
Reviewed-on: https://go-review.googlesource.com/c/go/+/576297
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 21:25:11 +00:00
Michael Anthony Knyszek
fa470f6245 internal/concurrent: add HashTrieMap
This change adds a concurrent hash-trie map implementation to the
standard library in the new internal/concurrent package, intended to
hold concurrent data structures. (The name comes from how Java names
their concurrent data structure library in the standard library.)

This data structure is created specially for the upcoming unique
package. It is built specifically around frequent successful lookups and
comparatively rare insertions and deletions.

A valid question is whether this is worth it over a simple locked map.
Some microbenchmarks in this new package show that yes, this extra
complexity appears to be worth it.

Single-threaded performance for LoadOrStore is comparable to a locked
map for a map with 128k small string elements. The map scales perfectly
up to 24 cores for Loads, which is the maximum available parallelism
on my machine. LoadOrStore operations scale less well. Small maps will
have a high degree of contention, but for the unique library, small maps
are very unlikely to stay small if there are a lot of inserts, since
they have a full GC cycle to grow.

For #62483.

Change-Id: I38e5ac958d19ebdd0c8c02e36720bb3338fe2e35
Reviewed-on: https://go-review.googlesource.com/c/go/+/573956
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 21:20:09 +00:00
Michael Pratt
68c0ad3a68 cmd/go: only attempt to match subset of $GOCACHE in test
This test attempted to be clever by looking for the entirety of $GOCACHE
in the compile command line to ensure that the profile was coming from
cache.

Unfortunately, on Windows $GOCACHE contains \, which needs extra
escaping in a regexp. As an approximate alternative, just look for the
"gocache" component specified when defining GOCACHE.

This fixes the Windows longtest builders.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest
Change-Id: If6c77cf066d8612431e0720405254e1fdf528e9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/580137
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
2024-04-18 18:28:25 +00:00
Robert Griesemer
ad87d44047 go/types, types2: use correct predicate when asserting comma-ok types
While at it and unrelated, up-date testdata/manual.go sample file so
we can just copy its contents into a test file after debugging, without
fixing the date.

Fixes #66878.

Change-Id: Ie49a341b78d99bdc0f1a0ba1ca42fa2d3a807bd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/580075
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-04-18 17:42:47 +00:00
Jes Cok
a0205e650a doc: simplify symbol links for relnotes
This is a follow-up to CL 578195.

Change-Id: Iab38ee008df8b06c300b0027019cc0464bdadca1
Reviewed-on: https://go-review.googlesource.com/c/go/+/579796
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-04-18 16:00:16 +00:00