1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:44:48 -07:00
Commit Graph

52821 Commits

Author SHA1 Message Date
David Chase
81d567146e runtime: add go:yeswritebarrierrec to panic functions
Panic avoids any write barriers in the runtime by checking first
and throwing if called inappropriately, so it is "okay".  Adding
this annotation repairs recursive write barrier checking, which
becomes more thorough when the local package naming convention
is changed from "" to the actual package name.

This CL is a prerequisite for a pending code cleanup,
https://go-review.googlesource.com/c/go/+/393715

Updates #51734.

Change-Id: If831a3598c6c8cd37a8e9ba269f822cd81464a13
Reviewed-on: https://go-review.googlesource.com/c/go/+/405900
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: David Chase <drchase@google.com>
2022-05-13 19:29:44 +00:00
David Chase
9a68dcd7de buildcfg: disable regabiwrappers along with regabiargs
This (1) "just makes sense"
and (2) avoids a weird bug in some name-dependent calling conventions
in wasm code generation, when the local pkg has a real name instead of "".
The calling conventions are triggered for a "wrapper" function, and somehow
an abiwrapper was taken to be a "wrapper" function, resulting in the use of
an invalid register.  But abiwrapping has no business being in js/wasm code
generation, so just turn that off.

Updates #51734.

For posterity, that crash is:

GOSSAFUNC=wasmTruncU GOMAXPROCS=1 \
GOOS=js GOARCH=wasm GOEXPERIMENT=regabi,regabiargs
/Users/drchase/work/go-quick/bin/go build \
-gcflags=all=-d=abiwrap -o a.exe \
GOROOT/test/abi/bad_select_crash.go

<autogenerated>:1: internal compiler error: panic: bad Get: invalid register

goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0xc80?, 0x0?}, {0x195c85e, 0x9}, {0xc005ef72c8, 0x1, 0x1})
	/Users/drchase/work/go-quick/src/cmd/compile/internal/base/print.go:227 +0x1d7
cmd/compile/internal/base.Fatalf(...)
	/Users/drchase/work/go-quick/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/gc.handlePanic()
	/Users/drchase/work/go-quick/src/cmd/compile/internal/gc/main.go:48 +0x85
panic({0x18bf3c0, 0x1ad0430})
	runtime/panic.go:854 +0x26d
cmd/internal/obj/wasm.assemble(0xc0000f8200, 0xc001c74880, 0x0?)
	/Users/drchase/work/go-quick/src/cmd/internal/obj/wasm/wasmobj.go:920 +0x1958
cmd/internal/obj.Flushplist(0xc0000f8200, 0xc005ef79a8, 0xc0022264c0, {0x7ff7bfefdd17, 0x7})
	/Users/drchase/work/go-quick/src/cmd/internal/obj/plist.go:151 +0x784
cmd/compile/internal/objw.(*Progs).Flush(...)
	/Users/drchase/work/go-quick/src/cmd/compile/internal/objw/prog.go:124
cmd/compile/internal/ssagen.Compile(0xc000707e00, 0xc001b4d620?)
	/Users/drchase/work/go-quick/src/cmd/compile/internal/ssagen/pgen.go:208 +0x495
cmd/compile/internal/gc.compileFunctions.func4.1(0xc005ef7a01?)
	/Users/drchase/work/go-quick/src/cmd/compile/internal/gc/compile.go:153 +0x3a
cmd/compile/internal/gc.compileFunctions.func2(0x0?)
	/Users/drchase/work/go-quick/src/cmd/compile/internal/gc/compile.go:125 +0x1e
cmd/compile/internal/gc.compileFunctions.func4({0xc004685000, 0x79f, 0xa00?})
	/Users/drchase/work/go-quick/src/cmd/compile/internal/gc/compile.go:152 +0x53
cmd/compile/internal/gc.compileFunctions()
	/Users/drchase/work/go-quick/src/cmd/compile/internal/gc/compile.go:163 +0x162
cmd/compile/internal/gc.Main(0x198d3d8)
	/Users/drchase/work/go-quick/src/cmd/compile/internal/gc/main.go:297 +0x108a
main.main()
	/Users/drchase/work/go-quick/src/cmd/compile/main.go:55 +0xdd

Change-Id: I79f039e2494f78efba60e52ab1110d62656fb7ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/405899
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-13 18:21:52 +00:00
Xiaodong Liu
0653cb4cf7 cmd/asm/internal: configure assembler for loong64
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I4b0247a331256162b47fbd94589f46ba062d4d44
Reviewed-on: https://go-review.googlesource.com/c/go/+/387234
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-13 18:18:14 +00:00
Xiaodong Liu
fd17a4dc09 cmd/compile: register Init function for loong64
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: Ia3cb07af626e3422e43e3834baf15b7c8fad2326
Reviewed-on: https://go-review.googlesource.com/c/go/+/349511
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: David Chase <drchase@google.com>
2022-05-13 18:14:52 +00:00
David Chase
5b4fafd5db cmd/compile: sort named types before unnamed in reflect
When the local package has an explicit name instead of "",
this is necessary to get past a cgo plugin test that fails
because of a package signature mismatch.  There's something
questionable going on in the package hash generation, and
in particular it went wrong here.  Updating the sort order
helps.

This CL is a prerequisite for a pending code cleanup,
https://go-review.googlesource.com/c/go/+/393715

Updates #51734.

The failure:

GOROOT/misc/cgo/testplugin$ go test .
mkdir -p $TMPDIR/src/testplugin
rsync -a testdata/ $TMPDIR/src/testplugin
echo 'module testplugin' > $TMPDIR/src/testplugin/go.mod
mkdir -p $TMPDIR/alt/src/testplugin
rsync -a altpath/testdata/ $TMPDIR/alt/src/testplugin
echo 'module testplugin' > $TMPDIR/alt/src/testplugin/go.mod
cd $TMPDIR/alt/src/testplugin
( PWD=$TMPDIR/alt/src/testplugin GOPATH=$TMPDIR/alt go build -gcflags '' -buildmode=plugin -o $TMPDIR/src/testplugin/plugin-mismatch.so ./plugin-mismatch )
cd $TMPDIR/src/testplugin
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go build -gcflags '' -buildmode=plugin ./plugin1 )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go build -gcflags '' -buildmode=plugin ./plugin2 )
cp plugin2.so plugin2-dup.so
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go build -gcflags '' -buildmode=plugin -o=sub/plugin1.so ./sub/plugin1 )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go build -gcflags '' -buildmode=plugin -o=unnamed1.so ./unnamed1/main.go )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go build -gcflags '' -buildmode=plugin -o=unnamed2.so ./unnamed2/main.go )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go build -gcflags '' -o host.exe ./host )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go run -gcflags '' ./checkdwarf/main.go plugin2.so plugin2.UnexportedNameReuse )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin go run -gcflags '' ./checkdwarf/main.go ./host.exe main.main )
( PWD=$TMPDIR/src/testplugin GOPATH=$TMPDIR LD_LIBRARY_PATH=$TMPDIR/src/testplugin ./host.exe )
--- FAIL: TestRunHost (0.02s)
    plugin_test.go:187: ./host.exe: exit status 1
        2022/05/13 11:26:37 plugin.Open failed: plugin.Open("plugin1"): plugin was built with a different version of package runtime

and many more after that.

Change-Id: I0780decc5bedeea640ed0b3710867aeda5b3f725
Reviewed-on: https://go-review.googlesource.com/c/go/+/405995
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-13 18:08:06 +00:00
Roland Shoemaker
7e33e9e7a3 cmd/go: don't assume decimal in test_fuzz_mutate_crash
In the float test in test_fuzz_mutate_crash, don't assume the mutator
will generate a decimal during mutation. The probability it will is
quite high, but it is not guaranteed, which can cause a flake. Since we
are not really testing that the mutator will do this kind of mutation,
just that a mutation happens, just check that the input is not the zero
value like the rest of the targets.

Fixes #52852

Change-Id: I4640be640204ced01b4dc749c74b46da968ea7df
Reviewed-on: https://go-review.googlesource.com/c/go/+/405855
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-13 16:22:05 +00:00
Michael Anthony Knyszek
ece6ac4d4d runtime/metrics: add gomaxprocs metric
For #47216.

Change-Id: Ib2d48c4583570a2dae9510a52d4c6ffc20161b31
Reviewed-on: https://go-review.googlesource.com/c/go/+/404305
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-05-13 16:02:59 +00:00
Michael Anthony Knyszek
0f715f1ac9 runtime/internal/atomic: align 64-bit types to 8 bytes everywhere
This change extends https://go.dev/cl/381317 to the
runtime/internal/atomic package in terms of aligning 64-bit types to 8
bytes, even on 32-bit platforms.

Change-Id: Id8c45577d07b256e3144d88b31f201264295cfcd
Reviewed-on: https://go-review.googlesource.com/c/go/+/404096
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-05-13 16:02:27 +00:00
Michael Anthony Knyszek
2eb8b6eec6 runtime: make CPU limiter assist time much less error-prone
At the expense of performance (having to update another atomic counter)
this change makes CPU limiter assist time much less error-prone to
manage. There are currently a number of issues with respect to how
scavenge assist time is treated, and this change resolves those by just
having the limiter maintain its own internal pool that's drained on each
update.

While we're here, clear the measured assist time each cycle, which was
the impetus for the change.

Change-Id: I84c513a9f012b4007362a33cddb742c5779782b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/404304
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-05-13 16:02:20 +00:00
Roland Shoemaker
5a4ba6d905 cmd/go: make TestScript/test_fuzz_minimize_dirty_cov use less memory
The test doesn't need to be as aggressive, it _should_ still tickle
the right paths with high enough probability. This should
significantly reduce the memory it consumes, which is at a premium
when testing fuzzing things.

Fixes #52744

Change-Id: I4d8dd5b29e65fb429962850b3f4477982452c856
Reviewed-on: https://go-review.googlesource.com/c/go/+/404634
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-05-13 15:23:38 +00:00
Paul E. Murphy
d4dd7acd2e crypto/aes: simplify key load+store on PPC64
There is no requirement for how the expanded keys are stored
in memory. They are only accessed by asm routines. If keys
are stored directly with stxvd2x, they can be loaded directly
with lxvd2x.

This speeds up ppc64le key expansion and crypting a bit too.

POWER9 aes benchmark delta:

name     old time/op    new time/op    delta
Encrypt    15.0ns ± 0%    13.0ns ± 0%  -13.17%
Decrypt    14.6ns ± 0%    13.0ns ± 0%  -11.02%
Expand     49.1ns ± 0%    45.1ns ± 0%   -8.01%

name             old time/op    new time/op    delta
AESCBCEncrypt1K    1.08µs ± 0%    1.08µs ± 0%   -0.46%
AESCBCDecrypt1K     744ns ± 0%     562ns ± 0%  -24.46%

Change-Id: I91f3cdc770a178aee849301e4e6aa5a4a517ad10
Reviewed-on: https://go-review.googlesource.com/c/go/+/405135
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-05-13 14:14:49 +00:00
Paul E. Murphy
b553f51fcd crypto/aes: enable aes-cbc asm for ppc64
This reworks how we load/store vector registers using the new
bi-endian P9 instruction emulation macros. This also removes
quite a bit of asm used to align and reorder vector registers.

This is also a slight improvement on P9 ppc64le/linux:

    name             old speed      new speed      delta
    AESCBCEncrypt1K   936MB/s ± 0%   943MB/s ± 0%  +0.80%
    AESCBCDecrypt1K  1.28GB/s ± 0%  1.37GB/s ± 0%  +6.76%

Updates #18499

Change-Id: Ic5ff71d217d7302b6ae4e8d877c25004bfda5ecd
Reviewed-on: https://go-review.googlesource.com/c/go/+/405134
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-13 14:14:26 +00:00
Keith Randall
016d755213 runtime: measure stack usage; start stacks larger if needed
Measure the average stack size used by goroutines at every GC. When
starting a new goroutine, allocate an initial goroutine stack of that
average size. Intuition is that we'll waste at most 2x in stack space
because only half the goroutines can be below average. In turn, we
avoid some of the early stack growth / copying needed in the average
case.

More details in the design doc at: https://docs.google.com/document/d/1YDlGIdVTPnmUiTAavlZxBI1d9pwGQgZT7IKFKlIXohQ/edit?usp=sharing

name        old time/op  new time/op  delta
Issue18138  95.3µs ± 0%  67.3µs ±13%  -29.35%  (p=0.000 n=9+10)

Fixes #18138

Change-Id: Iba34d22ed04279da7e718bbd569bbf2734922eaa
Reviewed-on: https://go-review.googlesource.com/c/go/+/345889
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2022-05-12 22:32:42 +00:00
Robert Griesemer
da0a6f4b57 spec: fix prose about promoted methods of embedded fields
The types of embedded fields must be named, but they don't
need to be defined types (e.g. if the type name is an alias).

Fixes #41687.

Change-Id: Ib9de65dfab0e23c27d8303875fa45c217aa03331
Reviewed-on: https://go-review.googlesource.com/c/go/+/406054
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-05-12 22:29:02 +00:00
Ian Lance Taylor
6365efb7dc test: add test case that caused a gofrontend crash
For #52841

Change-Id: If4723a70fba0dbedb5d1e70dab58f0b4612bf8b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/405759
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-05-12 21:45:28 +00:00
Xiaodong Liu
2136e15510 cmd/compile/internal/loong64: implement Init function for loong64
Register functions and parameters that are used in gc backend and
are architecture related for loong64.

Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: Iab3f13b70a41f31f412b59801def3106f5eb7c11
Reviewed-on: https://go-review.googlesource.com/c/go/+/367036
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
2022-05-12 21:40:53 +00:00
Roland Shoemaker
267013e6e9 crypto/x509: attempt to prime windows root pool before hybrid test
In TestHybridPool attempt to prime to the windows root pool before
the real test actually happens. This is a bit of a band-aid, with
a better long term solution discussed in #52108.

Updates #51599

Change-Id: I406add8d9cd9e3fae37bfc20b97f5479c10a52c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/405914
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-05-12 20:58:12 +00:00
Michael Matloob
27ace7ab9e cmd/go: make modifications to copies of go/build files for index
This change makes the modifications to the copies of the files of
go/build used by the modindex package needed for them to be used by
modindex. It also removes the parts of the files not needed by the
modindex package.

Change-Id: I72607868bd7e1ca5fc7c5a496cc836e7922e3786
Reviewed-on: https://go-review.googlesource.com/c/go/+/403974
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
2022-05-12 20:19:10 +00:00
Michael Matloob
1e5fcefcd1 cmd/go: copy files from go/build into new modindex package
These files are all copied as is from the go/build package, to files
with the same name in modindex (with the exception of build_read, which
was copied from go/build/read.go).

This is being done so that the next CL can show exactly the changes that
were made against the go/build versions.

Unfortunately, git doesn't recognize these as copies, which is annoying.

Change-Id: I27b05b23dc5ccefe5252956bf75025bd57b36c66
Reviewed-on: https://go-review.googlesource.com/c/go/+/403777
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-05-12 20:17:26 +00:00
Cherry Mui
d6e6140c98 cmd/compile: fix boolean comparison on RISCV64
Following CL 405114, for RISCV64.

May fix RISCV64 builds.

Updates #52788.

Change-Id: Ifc34658703d1e8b97665e7b862060152e3005d71
Reviewed-on: https://go-review.googlesource.com/c/go/+/405553
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-05-12 19:11:22 +00:00
Robert Griesemer
f269d90bf2 spec: use original terminology in metasyntax (cleanup)
The metasyntax used in the spec is exactly the Wirth Syntax
Notation (WSN), which eventually influenced EBNF. Add a link
but keep mentioning EBNF which is likely more commonly known.

Use the original terms in the productions. Specifically, use
the words "Term" and "Factor" rather than "Alternative" and
"Term".

The terminology cleanup also resolves an inconsistency in the
subsequent prose which is referring to the correct "terms" now.

While at it, add a production for the entire Syntax itself,
matching the original WSN definition.

Also, replace the two uses of "grammar" with "syntax" for
consistency ("syntax" is the prevalent term used throughout
the spec).

Fixes #50074.

Change-Id: If770d5f32f56f509f85893782c1dafbb0eb29b2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/405814
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-05-12 19:04:52 +00:00
Robert Griesemer
1dfe994fe9 spec: use Unicode terminology consistently
- refer to character "categories" rather than "classes" per the
  definitions in the Unicode standard
- use "uppercase", "lowercase" (one word) instead of "upper case"
  or "upper-case", matching the spelling in the Unicode standard
- clarify that that the blank character "_" is considered a lowercase
  letter for Go's purposes (export of identifiers)

Fixes #44715.

Change-Id: I54ef177d26c6c56624662fcdd6d1da60b9bb8d02
Reviewed-on: https://go-review.googlesource.com/c/go/+/405758
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-05-12 19:04:46 +00:00
Cherry Mui
e3f7816f0e cmd/link: remove name expansion logic
Now both the compiler and the assembler require the -p flag and
emit full package path in symbol names, we no longer need to do
the name expansion in the linker. Delete it.

Change-Id: I771d4d97987a0a17414881b52806d600ef4cc351
Reviewed-on: https://go-review.googlesource.com/c/go/+/404300
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-05-12 18:45:57 +00:00
Yasuhiro Matsumoto
c4c9c80e4f all.bat,clean.bat,race.bat,run.bat: call some.bat with .\some.bat
When set NoDefaultCurrentDirectoryInExePath=1, call some.bat does not work.

Change-Id: Ifeab27ecf0d7ba1d504b755a22f73a0f13abbbb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/405874
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-05-12 16:59:17 +00:00
Yasuhiro Matsumoto
917f201f95 make.bat: call env.bat with .\env.bat
When set NoDefaultCurrentDirectoryInExePath=1, call env.bat does not work.

Change-Id: If63b02e236079681bdadadbdebc0b39abce01219
Reviewed-on: https://go-review.googlesource.com/c/go/+/405774
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-05-12 13:50:51 +00:00
Tobias Klauser
0d8345df66 net/netip: skip some TestAddrStringAllocs tests on noopt builders
CL 403914 introduced TestAddrStringAllocs which checks that there is
only 1 alloc in Addr.String for v4-in-v6 addresses. This requires
optimizations to be enabled, otherwise there are 2 allocs. Skip the
ipv4-in-ipv6 sub-tests on noopt builders to fix failing
TestAddrStringAllocs on the noopt builders.

Change-Id: I0285264260b264b53cf822dc7cec4829e9854531
Reviewed-on: https://go-review.googlesource.com/c/go/+/405834
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-05-12 13:42:39 +00:00
Robert Griesemer
2bea43b0e7 spec: state that variable names must be unique in short var decls
Fixes #45652.

Change-Id: I5e1434480c12815369a6ce204f3729eb63139125
Reviewed-on: https://go-review.googlesource.com/c/go/+/405757
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-12 04:47:29 +00:00
Robert Griesemer
c01feba15d spec: clarify "continue" statement
Taking into account the discussion and relevant feedback on a
change proposed in 2013 (see e-mail thread mentioned in issue).

Fixes #48864.

Change-Id: I811d518b7cbdf6b815695174f1da3d4251f491c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/405756
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-12 04:47:23 +00:00
Robert Griesemer
7e11ff3816 spec: correct assignment rules with respect to type parameters
Fixes #52628.

Change-Id: If4261abc25868d62f7689253d40f872692c23a4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/405755
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-05-12 04:47:18 +00:00
Robert Griesemer
5d0400c72d spec: adjust scope of function/method type parameters
Change scope rules per the accepted proposal #52038.
Match prose for type parameters of type declarations.
Fixing the implementation is tracked by #51503.

Fixes #52038.
For #51503.

Change-Id: Iebd88a82c896b7b2e8520cd514ef6a2cc903e807
Reviewed-on: https://go-review.googlesource.com/c/go/+/405754
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-12 04:47:13 +00:00
Xiaodong Liu
900ae5b35a cmd/compile/internal/ssagen: enable intrinsic operation on loong64
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: If28fe03297e1de62f348373f2779dce07f54611c
Reviewed-on: https://go-review.googlesource.com/c/go/+/367042
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-05-12 04:08:07 +00:00
Xiaodong Liu
756fcd8fc2 cmd/compile/internal/ssa: config functions used in lower pass for loong64
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I50d20eb22f2108d245513de8ac95ebe0b7e1a1dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/367037
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-12 01:08:28 +00:00
Xiaodong Liu
a2d12076b9 cmd/compile/internal/ssa: add support on loong64 for schedule phase
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: Id533912c62d8c4e2aa3c124561772b543d685d7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/367041
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-12 00:24:40 +00:00
Xiaodong Liu
a6c95e75d9 cmd/compile/internal/ssa: inline memmove with known size
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I1534b66b527efaf2bbaa8e6e6ac0618aac0b5930
Reviewed-on: https://go-review.googlesource.com/c/go/+/367040
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-11 23:58:56 +00:00
Alexander Yastrebov
c14ed5b37c Revert "net/http: close accepted connection"
This reverts CL 353714.

The change closes accepted connection also in graceful shutdown which
breaks the fix for #33313 (and apparent duplicate #36819).

The proper fix should close accepted connection only if server is closed
but not in graceful shutdown.

Updates #48642

Change-Id: I2f7005f3f3037e6563745731bb2693923b654004
GitHub-Last-Rev: f6d885aa37
GitHub-Pull-Request: golang/go#52823
Reviewed-on: https://go-review.googlesource.com/c/go/+/405454
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-11 23:44:16 +00:00
Xiaodong Liu
ec5bdefd0a cmd/compile/internal/ssa{,/gen}: define rules and operation on loong64
The rules and operation definition is used to generate rewrite functions
and OpKind type constant.

Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: Ia362ed7ba5d84046697aadbc8d6d4cbe495f6076
Reviewed-on: https://go-review.googlesource.com/c/go/+/367039
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-11 23:39:27 +00:00
Tobias Klauser
f2cd6d60ae net/netip: reduce allocations in Addr.String for v4-in-v6 addresses
ip.Unmap will always return an Addr with ip.z == z4 in case of an
v4-in-v6 address. Thus, Addr.string4 can be called directly without the
additional indirection.

name                      old time/op    new time/op    delta
IPString/v6_v4-4             108ns ± 3%      74ns ± 4%  -31.23%  (p=0.000 n=9+10)
IPStringExpanded/v6_v4-4    89.6ns ± 6%    77.2ns ± 3%  -13.91%  (p=0.000 n=10+10)
AddrPortString/v6_v4-4       253ns ± 8%     197ns ± 3%  -22.13%  (p=0.000 n=10+10)

name                      old alloc/op   new alloc/op   delta
IPString/v6_v4-4             40.0B ± 0%     24.0B ± 0%  -40.00%  (p=0.000 n=10+10)
IPStringExpanded/v6_v4-4     48.0B ± 0%     48.0B ± 0%     ~     (all equal)
AddrPortString/v6_v4-4       77.0B ± 0%     61.0B ± 0%  -20.78%  (p=0.000 n=10+10)

name                      old allocs/op  new allocs/op  delta
IPString/v6_v4-4              2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
IPStringExpanded/v6_v4-4      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
AddrPortString/v6_v4-4        4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.000 n=10+10)

Change-Id: Id4affaf7a493aa11579c48721294f2e5889a8bef
Reviewed-on: https://go-review.googlesource.com/c/go/+/403914
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2022-05-11 23:26:11 +00:00
Xiaodong Liu
83ee6c1d16 cmd/compile/internal/ssa: increase the bit width of BlockKind type
After the BlockKind of loong64 is introduced, it exceeds the maximum
range that int8 can represent.

Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I246d9c22334d0ea9e1440d29df05c9ec2d472b30
Reviewed-on: https://go-review.googlesource.com/c/go/+/367038
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-11 23:20:01 +00:00
Cherry Mui
6e03de7b83 cmd/asm: require -p flag
CL 391014 requires the compiler to be invoked with the -p flag, to
specify the package path. Later, CL 394217 makes the compiler to
produce an unlinkable object file, so "go tool compile x.go" can
still be used on the command line. This CL does the same for the
assembler, requiring -p, otherwise generating an unlinkable object.

No special case for the main package, as the main package cannot
be only assembly code, and there is no way to tell if it is the
main package from an assembly file.

Now we guarantee that we always have an expanded package path in
the object file. A later CL will delete the name expansion code
in the linker.

Change-Id: I8c10661aaea2ff794614924ead958d80e7e2487d
Reviewed-on: https://go-review.googlesource.com/c/go/+/404298
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-11 22:59:46 +00:00
Cherry Mui
b89a194889 cmd/internal/obj: add a flag to not write referenced symbol names in object file
The Go object file references (some of) symbols from other
packages by indices, not by names. The linker doesn't need the
symbol names to do the linking. The names are included in the
object file so it is self-contained and tools (objdump, nm) can
read the referenced symbol names. Including the names increases
object file size. Add a flag to disable it on demand (off by
default).

Change-Id: I143a0eb656997497c750b8eb1541341b2aee8f30
Reviewed-on: https://go-review.googlesource.com/c/go/+/404297
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-11 21:01:09 +00:00
Xiaodong Liu
c1105cfd43 cmd/internal/obj{,/loong64}: instructions and registers for loong64
Implemented an assembler for LoongArch64(loong64 is short name) -
this provides register definitions and instruction encoding as
defined in the LoongArch Instruction Set Manual.

LoongArch Instruction Set Manual:
  https://github.com/loongson/LoongArch-Documentation/releases

Contributors to the linux/loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I930d2a19246496e3ca36d55539183c0f9f650ad9
Reviewed-on: https://go-review.googlesource.com/c/go/+/342309
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-05-11 20:11:34 +00:00
David Chase
857cda4625 cmd/compile: convert merge to use appl. bal. trees for sharing
This CL replaces a not-very-shared linear-sized set
representation with a much more shared representation.
For the annoying test program in question, it reduces
the heap size by 95%, and the time slightly.

However, for some programs build time is longer.

This also includes at least one bug fix for problems
uncovered while ensuring compatibility with what it
replaces.

Fixes #51543.

Change-Id: Ie7a4c6ea460775faeed2b0378ab21ddffd15badc
Reviewed-on: https://go-review.googlesource.com/c/go/+/397318
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-05-11 16:34:41 +00:00
Bryan C. Mills
d339d085c9 cmd/go: add timestamps to script test output
Go tests don't include timestamps by default, but we would like to
have them in order to correlate builder failures with server and
network logs.

Since many of the Go tests with external network and service
dependencies are script tests for the 'go' command, logging timestamps
here adds a lot of logging value with one simple and very low-risk
change.

For #50541.
For #52490.
For #52545.
For #52851.

Change-Id: If3fa86deb4a216ec6a1abc4e6f4ee9b05030a729
Reviewed-on: https://go-review.googlesource.com/c/go/+/405714
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-05-11 15:00:05 +00:00
Ian Lance Taylor
949b3e9880 compress/flate: remove compressor.hash field
After CL 20929, the only remaining uses of d.hash are immediately
after it is set.

Benchmarks where benchstat reports a non-zero delta:

name                              old time/op    new time/op    delta
Decode/Newton/Huffman/1e5-12         982µs ± 6%     922µs ± 4%  -6.12%  (p=0.000 n=10+10)
Decode/Newton/Huffman/1e6-12        8.14ms ± 2%    7.71ms ± 2%  -5.19%  (p=0.000 n=10+10)
Encode/Digits/Huffman/1e5-12         241µs ± 0%     239µs ± 0%  -0.62%  (p=0.000 n=9+10)
Encode/Digits/Speed/1e4-12           113µs ± 0%     114µs ± 0%  +1.21%  (p=0.000 n=9+8)
Encode/Digits/Speed/1e5-12          1.04ms ± 0%    1.05ms ± 0%  +0.22%  (p=0.027 n=9+8)
Encode/Digits/Speed/1e6-12          10.3ms ± 0%    10.3ms ± 0%  +0.16%  (p=0.036 n=9+8)
Encode/Digits/Default/1e4-12         193µs ± 0%     195µs ± 1%  +0.77%  (p=0.010 n=8+8)
Encode/Digits/Default/1e5-12        2.92ms ± 1%    2.93ms ± 0%  +0.54%  (p=0.002 n=8+8)
Encode/Digits/Compression/1e4-12     193µs ± 0%     194µs ± 0%  +0.67%  (p=0.000 n=8+8)
Encode/Digits/Compression/1e5-12    2.92ms ± 0%    2.93ms ± 0%  +0.53%  (p=0.002 n=8+8)
Encode/Digits/Compression/1e6-12    31.0ms ± 1%    31.2ms ± 0%  +0.80%  (p=0.000 n=10+9)
Encode/Newton/Huffman/1e4-12        34.8µs ± 1%    34.3µs ± 0%  -1.31%  (p=0.000 n=9+10)
Encode/Newton/Huffman/1e5-12         294µs ± 0%     291µs ± 0%  -1.09%  (p=0.000 n=8+9)
Encode/Newton/Huffman/1e6-12        2.91ms ± 0%    2.89ms ± 0%  -0.89%  (p=0.000 n=8+9)
Encode/Newton/Speed/1e5-12           838µs ± 0%     836µs ± 0%  -0.18%  (p=0.015 n=8+8)
Encode/Newton/Speed/1e6-12          8.35ms ± 0%    8.28ms ± 1%  -0.89%  (p=0.000 n=8+10)
Encode/Newton/Default/1e5-12        3.55ms ± 0%    3.54ms ± 0%  -0.23%  (p=0.027 n=8+9)
Encode/Newton/Default/1e6-12        37.4ms ± 0%    37.3ms ± 0%  -0.18%  (p=0.001 n=9+8)
Encode/Newton/Compression/1e6-12    53.3ms ± 0%    53.1ms ± 0%  -0.25%  (p=0.010 n=10+9)

name                              old speed      new speed      delta
Decode/Newton/Huffman/1e5-12       102MB/s ± 6%   109MB/s ± 4%  +6.48%  (p=0.000 n=10+10)
Decode/Newton/Huffman/1e6-12       123MB/s ± 2%   130MB/s ± 2%  +5.49%  (p=0.000 n=10+10)
Encode/Digits/Huffman/1e5-12       416MB/s ± 0%   418MB/s ± 0%  +0.62%  (p=0.000 n=9+10)
Encode/Digits/Speed/1e4-12        88.9MB/s ± 0%  87.8MB/s ± 0%  -1.19%  (p=0.000 n=9+8)
Encode/Digits/Speed/1e5-12        95.7MB/s ± 0%  95.5MB/s ± 0%  -0.22%  (p=0.025 n=9+8)
Encode/Digits/Speed/1e6-12        97.5MB/s ± 0%  97.3MB/s ± 0%  -0.16%  (p=0.026 n=9+8)
Encode/Digits/Default/1e4-12      51.7MB/s ± 0%  51.3MB/s ± 1%  -0.76%  (p=0.007 n=8+8)
Encode/Digits/Default/1e5-12      34.3MB/s ± 1%  34.1MB/s ± 0%  -0.54%  (p=0.001 n=8+8)
Encode/Digits/Compression/1e4-12  51.8MB/s ± 0%  51.5MB/s ± 0%  -0.66%  (p=0.000 n=8+8)
Encode/Digits/Compression/1e5-12  34.3MB/s ± 0%  34.1MB/s ± 0%  -0.53%  (p=0.002 n=8+8)
Encode/Digits/Compression/1e6-12  32.3MB/s ± 1%  32.0MB/s ± 0%  -0.79%  (p=0.000 n=10+9)
Encode/Newton/Huffman/1e4-12       288MB/s ± 1%   291MB/s ± 0%  +1.33%  (p=0.000 n=9+10)
Encode/Newton/Huffman/1e5-12       340MB/s ± 0%   344MB/s ± 0%  +1.10%  (p=0.000 n=8+9)
Encode/Newton/Huffman/1e6-12       343MB/s ± 0%   346MB/s ± 0%  +0.90%  (p=0.000 n=8+9)
Encode/Newton/Speed/1e5-12         119MB/s ± 0%   120MB/s ± 0%  +0.18%  (p=0.014 n=8+8)
Encode/Newton/Speed/1e6-12         120MB/s ± 0%   121MB/s ± 1%  +0.90%  (p=0.000 n=8+10)
Encode/Newton/Default/1e5-12      28.2MB/s ± 0%  28.3MB/s ± 0%  +0.23%  (p=0.029 n=8+9)
Encode/Newton/Default/1e6-12      26.7MB/s ± 0%  26.8MB/s ± 0%  +0.20%  (p=0.000 n=9+7)
Encode/Newton/Compression/1e6-12  18.8MB/s ± 0%  18.8MB/s ± 0%  +0.25%  (p=0.012 n=10+9)

Change-Id: I8ba0efcf5d42595d856082656b45f87bb3d7be0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/404696
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-05-11 13:57:00 +00:00
Keith Randall
de9805c702 Revert "testing: document -race goroutine limits"
This reverts commit 4907c62f99.

Reason for revert: Race detector v3, which we just upgraded to, no longer has a goroutine limit.

(small caveat: openbsd/amd64 can't be updated, windows/amd64 isn't updated yet but should be by release time.)

Change-Id: I90017834501e81d3990d888f1b2baf3432452846
Reviewed-on: https://go-review.googlesource.com/c/go/+/405595
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2022-05-11 13:55:35 +00:00
Charlie Vieth
536282763f go/build: replace ioutil.ReadDir with os.ReadDir
Change go/build.readDir to use os.ReadDir instead of ioutil.ReadDir.
This addresses a TODO and improves performance on Darwin and Linux.

Darwin: Apple M1
name              old time/op    new time/op    delta
ImportVendor-10     39.8µs ± 1%    37.0µs ± 1%  -6.91%  (p=0.000 n=10+10)

Linux: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
name              old time/op    new time/op    delta
ImportVendor-16     22.9µs ±11%    21.2µs ± 5%  -7.47%  (p=0.001 n=10+9)

Updates #45557

Change-Id: Ib1bd2e66210e714e499a035847d6261b61b7e2c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/392074
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-11 13:52:09 +00:00
Axel Busch
636c5f0208 runtime: enable vDSO support for s390x architecture
This change adds support for vDSO for s390x architecture. This avoids the use of system calls in nanotime and walltime and accelerates them by factor 4-5.

Benchmarks:
100,000,000 x time.Now():
syscall fallback	13923ms		139.23 ns/op
vDSO enabled		2640ms	 	26.40 ns/op

Change-Id: Ic679fe31048379e59ccf83b400140f13c9d49696
GitHub-Last-Rev: 8f6e918a45
GitHub-Pull-Request: golang/go#49717
Reviewed-on: https://go-review.googlesource.com/c/go/+/365995
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Jonathan Albrecht <jonathan.albrecht@ibm.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
2022-05-11 13:30:43 +00:00
Cuong Manh Le
7b314d27ce cmd/compile: fix bad order of evaluation for multi-value f()(g()) calls
The compiler use to compile f()(g()) as:

	t1, t2 := g()
	f()(t1, t2)

That violates the Go spec, since when "..., all function calls, ... are
evaluated in lexical left-to-right order"

This PR fixes the bug by compiling f()(g()) as:

	t0 := f()
	t1, t2 := g()
	t0(t1, t2)

to make "f()" to be evaluated before "g()".

Fixes #50672

Change-Id: I6a766f3dfc7347d10f8fa3a151f6a5ea79bcf818
Reviewed-on: https://go-review.googlesource.com/c/go/+/392834
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-05-11 08:12:15 +00:00
Keith Randall
e0ae8540ab doc: mention jump tables and tsan upgrades in 1.19 release notes
Change-Id: I0ab34f2f931e0e712218e4eb086f4535cc17775c
Reviewed-on: https://go-review.googlesource.com/c/go/+/405614
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-11 05:57:07 +00:00
Cuong Manh Le
4388faf964 runtime: use unsafe.Slice in getStackMap
CL 362934 added open code for unsafe.Slice, so using it now no longer
negatively impacts the performance.

Updates #48798

Change-Id: Ifbabe8bc1cc4349c5bcd11586a11fc99bcb388b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/404974
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-11 04:25:28 +00:00