Commit graph

59999 commits

Author SHA1 Message Date
Cherry Mui 849770dec9 cmd/compile: disallow linkname referring to instantiations
Linknaming an instantiated generic symbol isn't particularly
useful: it doesn't guarantee the instantiation exists, and the
instantiated symbol name may be subject to change. Checked with a
large code corpus, currently there is no occurrance of linkname
to an instantiated generic symbol (or symbol with a bracket in its
name). This also suggests that it is not very useful. Linkname is
already an unsafe mechanism. We don't need to allow it to do more
unsafe things without justification.

Change-Id: Ifaa20c98166b28a9d7dc3290c013c2b5bb7682e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585458
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-15 19:27:25 +00:00
Alan Donovan bf0b605dfb runtime: make convTstring write barrier unreachable from throw
CL 581215 changed 'throw' so that instead of print(s) it called
a more complicated function, printpanicval, that statically
appeared to have convTstring in its call graph, even though this
isn't dynamically reachable when called with a string argument.

However, this caused the link-time static callgraph test to point
out that throw (which is called in nowritebarrierrec contexts
such as markgc) reaches a write barrier.

The solution is to inline and specialize the printpanicval
function for strings; it reduces to printindented.

Thanks to mpratt for pointing out that the reachability
check is on the fully lowered code, and is thus sensitive
to optimizations such as inlining.
I added an explanatory comment on the line that generates
the error message to help future users confused as I was.

Fixes golang/go#67274

Change-Id: Ief110d554de365ce4c09509dceee000cbee30ad9
Reviewed-on: https://go-review.googlesource.com/c/go/+/584617
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-05-15 17:29:46 +00:00
Michael Matloob 90b1521138 cmd/go/internal/modload: compute direct in workspace mode
The Requirements structure, which represents the root level requirements
of the module graph also has a 'direct' field which contains the set of
direct dependencies of a module.

Before this change, in workspace mode, the direct field was not set on
the Requirements structure. This change sets direct in the two places
it's needed: when initializing Requirements from the workspace's mod
files and when updating Requirements based on imports.

When initializing Requirements from the workspace's mod files, this
change will use the 'indirect' comments in those mod files to record the
set of direct modules passed to the Requirements.

There is a loop in updateRequirements where we consider the imports of
the packages we loaded from the main module to make sure that all those
imported packages' modules are required.  The loop also updates direct
for each of those modules (which have at least one package directly
imported by the main modules).  Before this change, in the workspace
case we continued early from the loop and didn't proceed to the code
where direct is computed. This change fixes that.

Fixes #66789

Change-Id: I2b497fbf28c2197e8ba8e8ca5314c1a720f16364
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/580256
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2024-05-15 16:04:44 +00:00
David Chase 18d0e6a14f cmd/compile, cmd/internal: fine-grained fiddling with loop alignment
This appears to be useful only on amd64, and was specifically
benchmarked on Apple Silicon and did not produce any benefit there.
This CL adds the assembly instruction `PCALIGNMAX align,amount`
which aligns to `align` if that can be achieved with `amount`
or fewer bytes of padding. (0 means never, but will align the
enclosing function.)

Specifically, if low-order-address-bits + amount are
greater than or equal to align; thus, `PCALIGNMAX 64,63` is
the same as `PCALIGN 64` and `PCALIGNMAX 64,0` will never
emit any alignment, but will still cause the function itself
to be aligned to (at least) 64 bytes.

Change-Id: Id51a056f1672f8095e8f755e01f72836c9686aa3
Reviewed-on: https://go-review.googlesource.com/c/go/+/577935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2024-05-15 15:44:14 +00:00
Matthew Dempsky 31c8150082 cmd/compile/internal/noder: enable type aliases in type checker
This CL fixes an initialization loop during IR construction, that
stems from IR lacking first-class support for aliases. As a
workaround, we avoid publishing alias declarations until the RHS type
expression has been constructed.

Thanks to gri@ for investigating while I was out.

Fixes #66873.

Change-Id: I11e0d96ea6c357c295da47f44b6ec408edef89b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585399
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
2024-05-15 15:09:14 +00:00
Kir Kolyshkin c3c97ad1bf run.bash: rm bumping open files soft limit
Since CL 393354 this should no longer be necessary.

Change-Id: Ie9a7f779515aaf8b40a4f0083ba680f7b0231f04
Reviewed-on: https://go-review.googlesource.com/c/go/+/585576
Auto-Submit: 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: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2024-05-15 15:02:23 +00:00
Cherry Mui 27603028eb cmd/internal/obj/x86: make SEH symbols content-addressable
Currently, the SEH symbol is defined as an aux symbol of the
function symbol, without adding to ctxt.Data. Each function has
its own SEH symbol. As there are a lot of duplications of the
SEH symbol contents, currently a Go object file may contain many
copies of identical SEH symbols. They are deduplicated at link
time. But it does make the linker do redundant work, and make it
hard to reason about the SEH symbol writing in the object file
writer, and its resolution in the linker. In fact, in the object
file writer, the same SEH symbol may be added to the ctxt.defs
multiple times (as it is the aux of multiple function symbols),
which is not expected.

In fact, "aux symbol" is just a mechanism to associate auxiliary
data to another symbol. The auxiliary data symbol itself can be an
ordinary data symbol, even a content-addressable symbol. Define
the SEH symbol as a conntent-addressable symbol and add it to
ctxt.Data. This way there is only one definition of each unique
SEH symbol, which can be the aux of many functions.

While here, add a check to ensure that we add a symbol at most
once to the defs list.

Change-Id: Ie7a0cf02ca114060423e025931b30de97ca330fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/585656
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-15 14:41:10 +00:00
Cherry Mui 8056540772 cmd/internal/obj: print symbol index at -S=3
When the compiler or assembler's -S flag is set to 3 or higher,
print the symbol index, for debugging.

Change-Id: Ia7a42b0c017105ef12fd97b3e52de0e155b0cf2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/585655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2024-05-15 14:39:06 +00:00
Paul E. Murphy 408739fc96 cmd/compile,cmd/asm: on PPC64, generate compares against constant 0
Merge the handling of CMPx r,r,cr and CMPx r,i,cr when assembling.

This prevents generating machine code like cmpd rx,r0 when cmpdi rx,0
is preferred. The preferred form can be fused on Power10 for faster
execution of some instruction sequences.

Likewise, update a common case to use $0 instead of R0 to take
advantage of this.

Change-Id: If2549ca25a5f7d23001885ad444c70d829b3b066
Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-ppc64_power8,gotip-linux-ppc64le_power10,gotip-linux-ppc64le_power8,gotip-linux-ppc64le_power9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585137
Reviewed-by: Dmitri Shuralyov <dmitshur@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-05-15 13:55:28 +00:00
Russ Cox 6ccd8e4cf6 cmd/go: add support for godebug lines in go.mod and go.work
The fact that the go line sets both the language version and the
GODEBUG compatibility version can be a problem, especially since
the go line is also required to be ≥ the go lines of any required
dependency modules.

This change adds a new 'godebug' line to go.mod and go.work
to allow setting the GODEBUG values for the entire module.

It also adds a new meta-value default=go1.21 that means
take the defaults from Go 1.21 no matter what the go line says.

These were discussed in proposal #65573.

Fixes #65573.

Change-Id: I91746322a10178370ed1015ce5278372a024c824
Reviewed-on: https://go-review.googlesource.com/c/go/+/584476
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2024-05-15 13:52:10 +00:00
Paul E. Murphy 0222a028f1 cmd/compile/internal/ssa: combine more shift and masking on PPC64
Investigating binaries, these patterns seem to show up frequently.

Change-Id: I987251e4070e35c25e98da321e444ccaa1526912
Reviewed-on: https://go-review.googlesource.com/c/go/+/583302
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-15 13:27:41 +00:00
Russ Cox bbdad50c09 doc/godebug: correct gotypealias=1 deprecation
Per the note earlier in the page, GODEBUGs are maintained for a
minimum of two years (four Go releases). Not said but certainly
implied is that they are maintained for four Go releases from the
point where people started needing to use them.

Since people would start needing gotypesalias=0 in Go 1.23,
it can be removed in Go 1.27.

Change-Id: Ifad63a1fff63c3f96f2ee192ca74bd1ce8bdb61f
Reviewed-on: https://go-review.googlesource.com/c/go/+/585457
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2024-05-15 12:20:56 +00:00
Michael Stapelberg d05af62695 syscall: skip TestAmbientCapsUserns when restricted, document
fixes golang/go#67088

Change-Id: I42e7a8d02b161187772f147e3e136ab6e0f71d7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/585059
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-15 07:45:37 +00:00
Damien Neil a524b87253 net/http: avoid panic when writing 100-continue after handler done
When a request contains an "Expect: 100-continue" header,
the first read from the request body causes the server to
write a 100-continue status.

This write caused a panic when performed after the server handler
has exited. Disable the write when cleaning up after a handler
exits.

This also fixes a bug where an implicit 100-continue could be
sent after a call to WriteHeader has sent a non-1xx header.

This change drops tracking of whether we've written a
100-continue or not in response.wroteContinue. This tracking
was used to determine whether we should consume the remaining
request body in chunkWriter.writeHeader, but the discard-the-body
path was only taken when the body was already consumed.
(If the body is not consumed, we set closeAfterReply, and we
don't consume the remaining body when closeAfterReply is set.
If the body is consumed, then we may attempt to discard the
remaining body, but there is obviously no body remaining.)

Fixes #53808

Change-Id: I3542df26ad6cdfe93b50a45ae2d6e7ef031e46fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/585395
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-05-14 22:34:15 +00:00
Cherry Mui b86527ec05 cmd/compile/internal/ssa: print output on failure in TestFmaHash
When the test fails to run the command, print the error message
to help debug.

Change-Id: I443579a622ba1bf67ef27071f141e945303d4c2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/585357
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 21:57:53 +00:00
apocelipes 1f6a983baf database/sql: reordering fields to reduce struct sizes
There are 16 bytes reduced.

Change-Id: I33ca96fd22002b3111f0462c3029d70df48adb6e
GitHub-Last-Rev: 8df56a9655
GitHub-Pull-Request: golang/go#67055
Reviewed-on: https://go-review.googlesource.com/c/go/+/581935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-14 20:18:21 +00:00
Tobias Klauser c7597a8d23 internal/poll: use internal/byteorder
Change-Id: Ied768b8b675281b340f91f4ac6f688594be8bf4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/585118
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-14 20:14:02 +00:00
Tobias Klauser 7ba8a23b67 syscall: use internal/byteorder
Change-Id: I798729a6095494e9d0bd18d6b7d4372910056218
Reviewed-on: https://go-review.googlesource.com/c/go/+/585117
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-14 20:13:24 +00:00
Tobias Klauser 7008859ae1 os: use internal/byteorder
Change-Id: Ic88535f05a55966e35e5da7abb499aa5fadb5cc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585116
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2024-05-14 20:11:45 +00:00
Michael Matloob eef288da1e cmd: add telemetry for commands in cmd
This change modifies the commands in cmd to open counter files,
increment invocations counters and to increment counters for the names
of the flags that were passed in.

cmd/pprof and cmd/vet are both wrappers around tools defined in other
modules which do their own flag processing so we can't directly
increment flag counters right after flags are parsed. For those two
commands we wait to increment counters until after the programs have
returned.

cmd/dist is built with the bootstrap go so it can't depend on telemetry
yet. We can add telemetry support to it once 1.23 is the minimum
bootstrap version.

For #58894

Change-Id: Ic7f6009992465e55c56ad4dc6451bcb1ca51374a
Reviewed-on: https://go-review.googlesource.com/c/go/+/585235
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 19:41:17 +00:00
Michael Matloob efc347348e cmd: pull in golang.org/x/telemetry@7d78a97
Commands run:
    go get golang.org/x/telemetry@7d78a97
    go mod tidy
    go mod vendor

Change-Id: Iea0fbe11bcc69fac35fba0ee3d02cd14344a3ee9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585455
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-14 19:09:33 +00:00
Russ Cox ca5fc8de65 cmd/vendor: pull in x/mod/modfile godebug changes
go get golang.org/x/mod@c0bdc7bd
	go mod tidy
	go mod vendor

Pulls in CL 584300.

For #65573.

Change-Id: Ia8ec86e2ee049b911fcf09d57f83972786b0470d
Reviewed-on: https://go-review.googlesource.com/c/go/+/584475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2024-05-14 18:34:56 +00:00
Russ Cox 2cc42f7328 time: more flake removal in asynctimerchan test
Trying to write a test for the corner cases in the old async timer chan
implementation may have been a mistake, especially since this isn't
going to be the default timer chan implementation anymore.
But let's try one more time to fix the test.

I reproduced the remaining builder failures on my Mac laptop
by overloading the CPU in one window and then running 48 instances
of the flaky test in loops using 'stress' in another window.

It turns out that, contrary to my understanding of async timers
and therefore contrary to what the test expected, it is technically
possible for

	t := time.NewTicker(1)
	t.Reset(1000*time.Hour)
	<-t.C
	<-t.C

to observe two time values on t.C, as opposed to blocking forever.

We always expect the first time value, since the ticker goes off
immediately (after 1ns) and sends that value into the channel buffer.
To get the second value, the ticker has to be in the process of
going off (which it is doing constantly anyway), and the timer
goroutine has to be about to call sendTime and then get rescheduled.
Then t.Reset and the first <-t.C have to happen.
Then the timer goroutine gets rescheduled and can run sendTime's
non-blocking send on t.C, which finds an empty buffer and writes
a value.

This is unlikely, of course, but it definitely happens. This program
always panics in just a second or two on my laptop:

	package main

	import (
		"os"
		"time"
	)

	func main() {
		os.Setenv("GODEBUG", "asynctimerchan=1")
		for  {
			go func() {
				t := time.NewTicker(1)
				t.Reset(1000*time.Hour)
				<-t.C
				select {
				case <-t.C:
					panic("two receives")
				case <-time.After(1*time.Second):
				}
			}()
		}
	}

Because I did not understand this nuance, the test did not expect it.

This CL rewrites the test to expect that possibility. I can no longer
make the test fail under 'stress' on my laptop.

For #66322.

Change-Id: I15c75d2c6f24197c43094da20d6ab55306a0a9f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/585359
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 18:27:21 +00:00
Than McIntosh 0767ffdf27 doc: add relnote fragment on stack slot merging
Add a blurb to the toolchain section talking about stack slot merging.

Updates #62737.

Change-Id: I26193a6a381c95ff5d79ce80b77c10c7561d00cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/581439
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-14 17:18:10 +00:00
Than McIntosh 3454ac0d63 cmd/link/internal/ld: clean tmpdir obj timestamps
This patch changes the Go linker to "clean" (reset to Unix epoch) the
timestamps on object files copied to the tmpdir that is presented to
the external linker or archive tool. The intent is to improve build
reproducibility on Darwin, where later versions of xcode seem to want
to incorporate object file timestamps into the hash used for the final
build ID (which precludes the possibility of having reproducible Go
builds). Credit for this idea goes to Cherry (see
https://github.com/golang/go/issues/64947#issuecomment-1887667189).

Updates #64947.

Change-Id: I2eb7dddff538e247122b04fdcf8a57c923f61201
Reviewed-on: https://go-review.googlesource.com/c/go/+/585355
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 16:44:47 +00:00
Niklas Ott c7c578cdf3 encoding/base32: use correct length for unpadded buffer in Read
If unpadded content was passed, in some occassions content was omitted,
because the division result was floored. Ceiling it makes sure all
content is always read.

Fixes #65166

Change-Id: I1d8ee7ef436080483ed8f0e615b70a1013455f92
Reviewed-on: https://go-review.googlesource.com/c/go/+/581415
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-14 16:25:54 +00:00
Tobias Klauser 9fa34d9fa2 net/netip: fix TestInlining after CL 585057
Addr.AsSlice is not inlinable on all architectures.

Fixes #67354

Change-Id: Ibaf7daa2e1188a05952f8df3c84255436b29478d
Reviewed-on: https://go-review.googlesource.com/c/go/+/585058
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-14 16:17:33 +00:00
Mateusz Poliwczak 8623c0ba95 internal/chacha8rand: use internal/byteorder
Change-Id: Ia5bcaba47da949583a720ca3506d6bd9e3794824
GitHub-Last-Rev: 1ed3dad2bf
GitHub-Pull-Request: golang/go#67320
Reviewed-on: https://go-review.googlesource.com/c/go/+/584996
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:47:29 +00:00
Tobias Klauser 9f9afbf332 net/netip: test that Addr.AsSlice is inlineable
CL 584995 made Addr.AsSlice inlineable as a side effect. Make sure we
don't regress.

Updates #56136

Change-Id: Ib5f77a430db66ffe45c4cbb264da7a401945fec9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585057
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-13 21:43:09 +00:00
Mateusz Poliwczak 259d2347d2 net/netip: replace != nil with != "" in comment
Change-Id: Ie204f90e51c210efe520a075b917c6178e109676
GitHub-Last-Rev: 9ca21ff92f
GitHub-Pull-Request: golang/go#67341
Reviewed-on: https://go-review.googlesource.com/c/go/+/585155
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:42:34 +00:00
Tobias Klauser 4015277b61 net/netip: combine import groups
Change-Id: If79f4452a34281796c4b8e7b0246c978e09a64af
Reviewed-on: https://go-review.googlesource.com/c/go/+/585056
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:42:31 +00:00
Alberto Donizetti cc1479653d slices: fix punctuation in the documentation of Values
Change-Id: Idea4f92d511b5f18531758667cb0cb5ed6f91a0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/584359
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-13 21:40:32 +00:00
apocelipes a949ade592 image/gif: use internal/byteorder
Change-Id: Ic00e63aa35bcea4c97a5885d61edb8fc37d84e22
GitHub-Last-Rev: 1ad3a5d0ed
GitHub-Pull-Request: golang/go#67324
Reviewed-on: https://go-review.googlesource.com/c/go/+/584997
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-13 21:38:09 +00:00
nobishino 133cdfb469 encoding/csv: clarify that Writer uses different line break than RFC 4180 by default
Package documentation of encoding/csv says:

> this package supports the format described in RFC 4180.

According to section 2 of RFC 4180:

> Each record is located on a separate line, delimited by a line break (CRLF).

On the other hand, Writer uses LF (not CRLF) as newline character by default.

> If [Writer.UseCRLF] is true, the Writer ends each output line with \r\n instead of \n.

Strictly speaking, this behavior is different from RFC 4180.
Package documentation would improve if we clarify that point.

Change-Id: I120e9332b593e1ac9ed8e49f6f8419ea88efc57d
GitHub-Last-Rev: 489167eb04
GitHub-Pull-Request: golang/go#67290
Reviewed-on: https://go-review.googlesource.com/c/go/+/584835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-13 21:32:28 +00:00
Mateusz Poliwczak 509bbeb407 math/rand/v2, math/big: use internal/byteorder
Change-Id: Id07f16d14133ee539bc2880b39641c42418fa6e2
GitHub-Last-Rev: 7b327d508f
GitHub-Pull-Request: golang/go#67319
Reviewed-on: https://go-review.googlesource.com/c/go/+/585016
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-13 21:31:58 +00:00
aimuz 7e196c04ed fmt, internal/fmtsort: refactor SortedMap to use slice of structs for map sorting
This change refactors the SortedMap type in the fmtsort package from using
two parallel slices for keys and values to a single slice of structs. This
improves code clarity and reduces the complexity of handling map entries.
Affected files and their respective functions have been updated to work
with the new structure, including adjustments in fmt/print.go and
text/template/exec.go to iterate over the new map representation.

goos: darwin
goarch: arm64
pkg: fmt
cpu: Apple M2 Max
                                 │   old.txt    │               new.txt                │
                                 │    sec/op    │    sec/op     vs base                │
SprintfPadding-12                  21.29n ±  5%   20.89n ±  8%        ~ (p=0.393 n=10)
SprintfEmpty-12                    2.986n ±  4%   2.997n ± 10%        ~ (p=0.697 n=10)
SprintfString-12                   8.327n ±  9%   8.493n ± 12%        ~ (p=0.579 n=10)
SprintfTruncateString-12           15.93n ± 10%   15.56n ± 10%        ~ (p=0.853 n=10)
SprintfTruncateBytes-12            14.56n ± 12%   14.13n ± 11%        ~ (p=0.796 n=10)
SprintfSlowParsingPath-12          9.026n ± 15%   9.511n ± 14%        ~ (p=0.646 n=10)
SprintfQuoteString-12              40.88n ±  3%   40.73n ±  1%        ~ (p=0.782 n=10)
SprintfInt-12                      6.279n ±  7%   6.130n ±  6%        ~ (p=0.218 n=10)
SprintfIntInt-12                   11.08n ± 10%   11.37n ± 10%        ~ (p=0.424 n=10)
SprintfPrefixedInt-12              31.24n ±  3%   31.21n ±  2%        ~ (p=0.912 n=10)
SprintfFloat-12                    13.96n ±  7%   13.99n ± 15%        ~ (p=0.986 n=10)
SprintfComplex-12                  49.16n ±  7%   50.57n ±  6%        ~ (p=0.436 n=10)
SprintfBoolean-12                  7.578n ± 15%   7.267n ± 11%        ~ (p=0.529 n=10)
SprintfHexString-12                36.14n ±  2%   35.74n ±  1%        ~ (p=0.118 n=10)
SprintfHexBytes-12                 48.74n ±  1%   48.34n ±  4%        ~ (p=0.128 n=10)
SprintfBytes-12                    60.16n ±  3%   61.36n ±  5%        ~ (p=0.218 n=10)
SprintfStringer-12                 39.02n ± 10%   39.31n ±  9%        ~ (p=0.739 n=10)
SprintfStructure-12                161.2n ±  1%   133.9n ±  4%  -16.90% (p=0.000 n=10)
ManyArgs-12                        31.87n ± 17%   33.00n ± 12%        ~ (p=0.165 n=10)
FprintInt-12                       32.32n ±  0%   33.13n ±  1%   +2.49% (p=0.000 n=10)
FprintfBytes-12                    47.31n ±  0%   47.99n ±  1%   +1.44% (p=0.000 n=10)
FprintIntNoAlloc-12                32.05n ±  1%   33.12n ±  0%   +3.34% (p=0.000 n=10)
ScanInts-12                        130.5µ ±  1%   131.3µ ±  0%   +0.57% (p=0.000 n=10)
ScanRecursiveInt-12                40.83m ±  1%   40.65m ±  2%        ~ (p=0.353 n=10)
ScanRecursiveIntReaderWrapper-12   40.77m ±  2%   40.83m ±  2%        ~ (p=0.971 n=10)
geomean                            100.6n         100.3n         -0.32%

                                 │    old.txt     │                new.txt                 │
                                 │      B/op      │     B/op      vs base                  │
SprintfPadding-12                    16.00 ± 0%       16.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfEmpty-12                      0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfString-12                     5.000 ± 0%       5.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateString-12             16.00 ± 0%       16.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateBytes-12              16.00 ± 0%       16.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfSlowParsingPath-12            5.000 ± 0%       5.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfQuoteString-12                32.00 ± 0%       32.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfInt-12                        0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfIntInt-12                     3.000 ± 0%       3.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfPrefixedInt-12                64.00 ± 0%       64.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfFloat-12                      8.000 ± 0%       8.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfComplex-12                    24.00 ± 0%       24.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBoolean-12                    4.000 ± 0%       4.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexString-12                  80.00 ± 0%       80.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexBytes-12                   104.0 ± 0%       104.0 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBytes-12                      88.00 ± 0%       88.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStringer-12                   32.00 ± 0%       32.00 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStructure-12                  216.0 ± 0%       168.0 ± 0%  -22.22% (p=0.000 n=10)
ManyArgs-12                          0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintInt-12                         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintfBytes-12                      24.00 ± 0%       24.00 ± 0%        ~ (p=1.000 n=10) ¹
FprintIntNoAlloc-12                  0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
ScanInts-12                        14.87Ki ± 0%     14.87Ki ± 0%        ~ (p=1.000 n=10) ¹
ScanRecursiveInt-12                16.37Ki ± 0%     16.34Ki ± 9%        ~ (p=0.950 n=10)
ScanRecursiveIntReaderWrapper-12   16.43Ki ± 8%     16.35Ki ± 0%        ~ (p=0.052 n=10)
geomean                                         ²                  -1.03%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │    old.txt    │                new.txt                │
                                 │   allocs/op   │  allocs/op   vs base                  │
SprintfPadding-12                   1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfEmpty-12                     0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfString-12                    1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateString-12            1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfTruncateBytes-12             1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfSlowParsingPath-12           1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfQuoteString-12               1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfInt-12                       0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfIntInt-12                    1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfPrefixedInt-12               1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfFloat-12                     1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfComplex-12                   1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBoolean-12                   1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexString-12                 1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfHexBytes-12                  2.000 ± 0%      2.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfBytes-12                     2.000 ± 0%      2.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStringer-12                  4.000 ± 0%      4.000 ± 0%        ~ (p=1.000 n=10) ¹
SprintfStructure-12                 8.000 ± 0%      6.000 ± 0%  -25.00% (p=0.000 n=10)
ManyArgs-12                         0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintInt-12                        0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintfBytes-12                     1.000 ± 0%      1.000 ± 0%        ~ (p=1.000 n=10) ¹
FprintIntNoAlloc-12                 0.000 ± 0%      0.000 ± 0%        ~ (p=1.000 n=10) ¹
ScanInts-12                        1.590k ± 0%     1.590k ± 0%        ~ (p=1.000 n=10) ¹
ScanRecursiveInt-12                1.592k ± 0%     1.592k ± 0%        ~ (p=0.303 n=10)
ScanRecursiveIntReaderWrapper-12   1.594k ± 0%     1.594k ± 0%        ~ (p=0.582 n=10)
geomean                                        ²                 -1.14%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

Change-Id: I2e850d827d2fd7d6618db60f7071977af5639032
GitHub-Last-Rev: 5a4afcf045
GitHub-Pull-Request: golang/go#67256
Reviewed-on: https://go-review.googlesource.com/c/go/+/584155
Reviewed-by: Dmitri Shuralyov <dmitshur@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: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-13 21:22:43 +00:00
Lorenz Bauer ec1724bc99 encoding/binary: simplify encoder.value
Remove some duplicate type switching from encoder.value. reflect.Uint and
reflect.Int don't have a case statement anymore, but since they aren't valid
types there is no change in semantics.

goos: darwin
goarch: arm64
pkg: encoding/binary
cpu: Apple M1 Pro
                            │   base.txt   │            simplify.txt             │
                            │    sec/op    │    sec/op     vs base               │
ReadSlice1000Int32s-10         2.649µ ± 1%    2.645µ ± 0%        ~ (p=0.069 n=6)
ReadStruct-10                  204.8n ± 2%    199.9n ± 0%   -2.39% (p=0.002 n=6)
WriteStruct-10                 185.6n ± 2%    154.0n ± 0%  -17.03% (p=0.002 n=6)
WriteSlice1000Structs-10       157.9µ ± 1%    125.0µ ± 0%  -20.86% (p=0.002 n=6)
ReadSlice1000Structs-10        162.6µ ± 2%    159.3µ ± 0%        ~ (p=0.065 n=6)
ReadInts-10                    159.7n ± 1%    156.7n ± 0%   -1.88% (p=0.002 n=6)
WriteInts-10                   134.2n ± 0%    134.1n ± 0%   -0.11% (p=0.011 n=6)
WriteSlice1000Int32s-10        2.680µ ± 0%    2.680µ ± 0%        ~ (p=0.955 n=6)
PutUint16-10                  0.6253n ± 2%   0.6211n ± 0%   -0.67% (p=0.013 n=6)
AppendUint16-10                1.417n ± 2%    1.413n ± 0%        ~ (p=0.065 n=6)
PutUint32-10                  0.6210n ± 0%   0.6210n ± 0%        ~ (p=0.835 n=6)
AppendUint32-10                1.414n ± 0%    1.414n ± 0%        ~ (p=1.000 n=6)
PutUint64-10                  0.6210n ± 0%   0.6212n ± 0%        ~ (p=0.260 n=6)
AppendUint64-10                1.414n ± 1%    1.417n ± 0%        ~ (p=0.097 n=6)
LittleEndianPutUint16-10      0.6236n ± 0%   0.6238n ± 0%        ~ (p=0.426 n=6)
LittleEndianAppendUint16-10    1.419n ± 0%    1.421n ± 1%        ~ (p=0.054 n=6)
LittleEndianPutUint32-10      0.6236n ± 0%   0.6239n ± 0%        ~ (p=0.457 n=6)
LittleEndianAppendUint32-10    1.421n ± 3%    1.421n ± 0%        ~ (p=1.000 n=6)
LittleEndianPutUint64-10      0.6242n ± 1%   0.6239n ± 0%        ~ (p=0.372 n=6)
LittleEndianAppendUint64-10    1.421n ± 0%    1.421n ± 0%        ~ (p=1.000 n=6)
ReadFloats-10                  39.39n ± 0%    39.35n ± 0%   -0.10% (p=0.026 n=6)
WriteFloats-10                 33.64n ± 0%    33.65n ± 0%        ~ (p=0.297 n=6)
ReadSlice1000Float32s-10       2.661µ ± 0%    2.664µ ± 0%        ~ (p=0.916 n=6)
WriteSlice1000Float32s-10      2.763µ ± 0%    2.758µ ± 2%        ~ (p=0.225 n=6)
ReadSlice1000Uint8s-10         129.5n ± 2%    129.5n ± 2%        ~ (p=0.485 n=6)
WriteSlice1000Uint8s-10        144.4n ± 4%    146.1n ± 2%        ~ (p=0.065 n=6)
PutUvarint32-10                12.12n ± 0%    12.12n ± 2%        ~ (p=0.933 n=6)
PutUvarint64-10                30.75n ± 0%    31.29n ± 1%   +1.76% (p=0.002 n=6)
geomean                        33.44n         32.89n        -1.65%

Change-Id: Ibce978012c268a7f26fe7567c340c861fa4b115d
Reviewed-on: https://go-review.googlesource.com/c/go/+/579156
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 21:22:39 +00:00
lifubang 59003b6d87 syscall: don't change local limit if prlimit used for another process
Fixes: #67184

Change-Id: Ibdf3810cbba30ae29f466f7f95f357e8512f228b
GitHub-Last-Rev: 5eabc760be
GitHub-Pull-Request: golang/go#67185
Reviewed-on: https://go-review.googlesource.com/c/go/+/583299
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-13 21:18:19 +00:00
Tim King 99283b81f4 cmd/go: add module information to vet actions
Update golang/go#66315

Change-Id: Ica9b7e010ea9a0a12f80cc83b8ace51f22822ec2
Reviewed-on: https://go-review.googlesource.com/c/go/+/580076
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 20:08:58 +00:00
Mateusz Poliwczak c98867d23a crypto: replace encoding/binary in favour of internal/byteorder
Updates #54097

Change-Id: I827a5efd1736ce057b76f079466f2d9ead225898
GitHub-Last-Rev: 40af10469d
GitHub-Pull-Request: golang/go#67321
Reviewed-on: https://go-review.googlesource.com/c/go/+/585017
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-13 18:57:38 +00:00
Ian Lance Taylor a32e94d43e cmd/cgo, cmd/go: add cgo -ldflags option, use it in cmd/go
This will automatically use a response file if ldflags is long,
avoiding "argument list too long" errors with a very large CGO_LDFLAGS.

Fixes #66456

Change-Id: I5f9ee86e03b4e6d6430f7f9d8357ef37a9c22465
Reviewed-on: https://go-review.googlesource.com/c/go/+/584655
Reviewed-by: Michael Matloob <matloob@golang.org>
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>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-05-13 17:12:16 +00:00
Nick Ripley f4494522dc runtime: use frame pointer unwinding for block and mutex profilers
Use frame pointer unwinding, where supported, to collect call stacks for
the block, and mutex profilers. This method of collecting call stacks is
typically an order of magnitude faster than callers/tracebackPCs. The
marginal benefit for these profile types is likely small compared to
using frame pointer unwinding for the execution tracer. However, the
block profiler can have noticeable overhead unless the sampling rate is
very high. Additionally, using frame pointer unwinding in more places
helps ensure more testing/support, which benefits systems like the
execution tracer which rely on frame pointer unwinding to be practical
to use.

Change-Id: I4b36c90cd2df844645fd275a41b247352d635727
Reviewed-on: https://go-review.googlesource.com/c/go/+/533258
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-05-13 16:42:35 +00:00
Nick Ripley b5bfb5a3ce runtime: refactor fpunwindExpand to use provided buffer
fpunwindExpand currently allocates a new slice to hold the expanded call
stack. In each place it's used, the resulting slice won't be needed
immediately afterward, so the allocation is wasteful. Refactor
fpunwindExpand to instead expand the call stack into a provided buffer.

Change-Id: I05b26c191a8f76404c21ccbe3bd422325540425b
Reviewed-on: https://go-review.googlesource.com/c/go/+/543715
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-05-13 16:41:50 +00:00
Mateusz Poliwczak f43d9c40f3 net/netip: use internal/byteorder
This also as a side effect fixes #56136 because internal/byteorder
package has a special treatment in the inliner.

Fixes #56136

Change-Id: Ib90eb716f7a67659fb4cea7e99c14cf7e819ef7b
GitHub-Last-Rev: a78d8f6fee
GitHub-Pull-Request: golang/go#67317
Reviewed-on: https://go-review.googlesource.com/c/go/+/584995
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-13 15:55:25 +00:00
qiulaidongfeng f933f78d17 cmd/go: remove unused code
Change-Id: I39e8533a646d171a84c1ef307915286213006543
GitHub-Last-Rev: 3c21684ad0
GitHub-Pull-Request: golang/go#67090
Reviewed-on: https://go-review.googlesource.com/c/go/+/581938
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
2024-05-13 15:54:54 +00:00
Guoqi Chen 9ea4770e14 cmd/internal/obj/loong64: improve the definition of plan9 assembly format in optab
In the three formats corresponding to case 7 of the function asmout, BREAK actually
corresponds to the cacop instruction of Loong64, refer to the loong64 instruction
manual volume 1 [1], the cacop instruction is a privileged instruction used to
maintain the cache, and the user mode does not have permission to execute.

Referring to the loong64 instruction manual volume 1 [1], the SYSCALL, BREAK and DBAR
instructions have similar formats and can be grouped into one category, the RDTIMED,
RDTIMELW and RDTIMEHW instructions can be grouped into one category, and the NOOP and
UNDEF instructions can be grouped into one category.

[1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html

Change-Id: I0b8998270102d1557fc2b2410cf8c0b078bd0c2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/493435
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Qiqi Huang <huangqiqi@loongson.cn>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
2024-05-13 15:52:19 +00:00
Guoqi Chen ec711aaaaa all: delete loong64 non-register ABI fallback path
Change-Id: If1d3eba9a922ac6f9d78301bb8f07e445c712899
Reviewed-on: https://go-review.googlesource.com/c/go/+/525576
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Commit-Queue: abner chenc <chenguoqi@loongson.cn>
Run-TryBot: abner chenc <chenguoqi@loongson.cn>
2024-05-13 15:04:25 +00:00
Michael Matloob 5881ae742f cmd: vendor golang.org/x/telemetry@51e8b5d
Commands run
    go get golang.org/x/telemetry@51e8b5d
    go mod tidy
    go mod vendor

Change-Id: Ie11f207d25902c3ef932237eec66bdd586564fc0
Reviewed-on: https://go-review.googlesource.com/c/go/+/584237
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-13 14:38:01 +00:00
qiulaidongfeng 0eaf8d97b6 runtime: remove unused code
Change-Id: Ifb9864704f55e27adfa5c21452fed5a243468d13
GitHub-Last-Rev: 6b000e7314
GitHub-Pull-Request: golang/go#67013
Reviewed-on: https://go-review.googlesource.com/c/go/+/581376
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-13 14:20:38 +00:00
Mateusz Poliwczak 07fc59199b hash: use internal/byteorder
Change-Id: I58c24a58a7b32d3f8d544509db04baac1ea1b56e
GitHub-Last-Rev: 7a648fda00
GitHub-Pull-Request: golang/go#67318
Reviewed-on: https://go-review.googlesource.com/c/go/+/585015
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@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>
Reviewed-by: Keith Randall <khr@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
2024-05-12 05:36:29 +00:00