Commit Graph

49939 Commits

Author SHA1 Message Date
Ruslan Andreev
810b08b8ec cmd/compile: inline memequal(x, const, sz) for small sizes
This CL adds late expanded memequal(x, const, sz) inlining for 2, 4, 8
bytes size. This PoC is using the same method as CL 248404.
This optimization fires about 100 times in Go compiler (1675 occurrences
reduced to 1574, so -6%).
Also, added unit-tests to codegen/comparisions.go file.

Updates #37275

Change-Id: Ia52808d573cb706d1da8166c5746ede26f46c5da
Reviewed-on: https://go-review.googlesource.com/c/go/+/328291
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Trust: David Chase <drchase@google.com>
2021-10-06 13:47:50 +00:00
Lynn Boger
ce72766a02 cmd/compile: improve PPC64 rules for AtomicLoad{8,32}
This adds a rule to avoid the zero extension after an AtomicLoad8
or AtomicLoad32 since the atomic load has already filled it with
zeros. This eliminates an instruction in a high use block in findObject
and the AtomicLoad8 appears many times within runtime.

Change-Id: I7e684bf73d3812110bd371e05b1aa44fa235fc9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/354029
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
2021-10-06 12:54:11 +00:00
Damien Neil
72c52bfbe2 net/http: parse HTTP version strings according to RFC 7230
RFC 2616 permits multiple digits in the major and minor numbers of an
HTTP version:

	https://datatracker.ietf.org/doc/html/rfc2616#section-3.1

RFC 7230 obsoletes 2616 and tightens the specification to permit only a
single digit in the major and minor number:

	https://datatracker.ietf.org/doc/html/rfc7230#section-2.6

Use the stricter definition.

Also fix a bug which caused version numbers with a leading "+" to
be accepted (e.g., "HTTP/1.+1".)

Fixes #46587.

Change-Id: Ic5923bb858e5ac402cfde486fba2c075e221553d
Reviewed-on: https://go-review.googlesource.com/c/go/+/325874
Trust: Damien Neil <dneil@google.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-06 00:43:45 +00:00
Ian Lance Taylor
ac60900759 cmd/go: use os.ErrProcessDone rather than matching error string
Change-Id: Ied57fb6e71d56618d46aeb36a37a709e08b4346e
Reviewed-on: https://go-review.googlesource.com/c/go/+/354136
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-05 23:58:29 +00:00
Josh Bleecher Snyder
e82ed0cd83 runtime: start moduledata memory load early
The slowest thing that can happen in funcdata is a cache miss
on moduledata.gofunc. Move that memory load earlier.

Also, for better ergonomics when working on this code,
do more calculations as uintptrs.

name                   old time/op  new time/op  delta
StackCopyWithStkobj-8  10.5ms ± 5%   9.9ms ± 4%  -6.03%  (p=0.000 n=15+15)

Change-Id: I590f4449725983c7f8d274c4ac7ed384d9018d85
Reviewed-on: https://go-review.googlesource.com/c/go/+/354134
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 23:36:43 +00:00
Josh Bleecher Snyder
2a5d4ea97e runtime: make funcspdelta inlineable
funcspdelta should be inlined: It is a tiny wrapper around another func.
The sanity check prevents that. Condition the sanity check on debugPcln.
While we're here, make the sanity check throw when it fails.

Change-Id: Iec022b8463b13a8e5a6d8479e7ddcb68909d6fe0
Reviewed-on: https://go-review.googlesource.com/c/go/+/354133
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 23:36:03 +00:00
Josh Bleecher Snyder
5758c40ac8 runtime: add a single-text-section fast path to findfunc
name                   old time/op  new time/op  delta
StackCopyWithStkobj-8  11.5ms ± 4%  10.7ms ± 7%  -7.10%  (p=0.000 n=10+10)

Change-Id: Ib806d732ec11f2a6cfde229fd88aff0fe68d9e7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/354129
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 23:34:32 +00:00
Josh Bleecher Snyder
77bd0da688 cmd/link,runtime: remove unnecessary funcdata alignment
Change-Id: I2777feaae4f266de99b56b444045370c82447cff
Reviewed-on: https://go-review.googlesource.com/c/go/+/354011
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 23:25:24 +00:00
Josh Bleecher Snyder
e31c9ab557 cmd/link,runtime: remove functab relocations
Use an offset from runtime.text instead.
This removes the last relocation from functab generation,
which lets us simplify that code.

size      before    after     Δ        %
addr2line 3680818   3652498   -28320   -0.769%
api       4944850   4892418   -52432   -1.060%
asm       4757586   4711266   -46320   -0.974%
buildid   2418546   2392578   -25968   -1.074%
cgo       4197346   4164818   -32528   -0.775%
compile   22076882  21875890  -200992  -0.910%
cover     4411362   4358418   -52944   -1.200%
dist      3091346   3062738   -28608   -0.925%
doc       3563234   3532610   -30624   -0.859%
fix       3020658   2991666   -28992   -0.960%
link      6164642   6110834   -53808   -0.873%
nm        3646818   3618482   -28336   -0.777%
objdump   4012594   3983042   -29552   -0.736%
pack      2153554   2128338   -25216   -1.171%
pprof     13011666  12870114  -141552  -1.088%
test2json 2383906   2357554   -26352   -1.105%
trace     9736514   9631186   -105328  -1.082%
vet       6655058   6580370   -74688   -1.122%
total     103927380 102914820 -1012560 -0.974%

relocs    before  after   Δ       %
addr2line 25069   22709   -2360   -9.414%
api       17176   13321   -3855   -22.444%
asm       18271   15630   -2641   -14.455%
buildid   9233    7352    -1881   -20.373%
cgo       16222   13044   -3178   -19.591%
compile   60421   46299   -14122  -23.373%
cover     18479   14526   -3953   -21.392%
dist      10135   7733    -2402   -23.700%
doc       12735   9940    -2795   -21.947%
fix       10820   8341    -2479   -22.911%
link      21849   17785   -4064   -18.600%
nm        24988   22642   -2346   -9.389%
objdump   26060   23462   -2598   -9.969%
pack      7665    5936    -1729   -22.557%
pprof     60764   50998   -9766   -16.072%
test2json 8389    6431    -1958   -23.340%
trace     37180   29382   -7798   -20.974%
vet       24044   19055   -4989   -20.749%
total     409499  334585  -74914  -18.294%


Caching the field size in debug/gosym.funcTab
avoids a 20% PCToLine performance regression.

name            old time/op    new time/op    delta
115/LineToPC-8    56.4µs ± 3%    57.3µs ± 2%  +1.66%  (p=0.006 n=15+13)
115/PCToLine-8     188ns ± 2%     190ns ± 3%  +1.46%  (p=0.030 n=15+15)


Change-Id: I2816a1b28e62b01852e3b306f08546f1e56cd5ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/352191
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-05 23:25:06 +00:00
Matthew Dempsky
96fface83a Revert "cmd/dist: omit cmd/cgo from toolchain1"
This reverts commit 81b7ec1ad5.

Reason for revert: broke ios builder

Change-Id: I7f469161c3c632ae48b7d938d355c9929eaaad92
Reviewed-on: https://go-review.googlesource.com/c/go/+/354135
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 22:42:11 +00:00
Archana R
6ae3afa7e7 cmd/compile: add prefetch intrinsic support on PPC64
This CL enables intrinsic support to emit the following prefetch
instructions for PPC64 platform that are already emitted on other
platforms
1. Prefetch - prefetches data from memory address to cache;
2. PrefetchStreamed - prefetches data from memory address, with a
hint that this data is being streamed.

Benchmarks picked from go/test/bench/garbage
Parameters tested with:
GOMAXPROCS=8
tree2 -heapsize=1000000000 -cpus=8
tree -n=18
parser
peano

Performance results with this change on POWER9

name                 old time/op  new time/op  delta
Tree2-8              75.3ms ± 2%  65.0ms ± 6%  -13.61%  (p=0.003 n=5+7)
Tree-8               576ms ± 2%   576ms ± 1%   ~     (p=0.756 n=11+10)
Parser-8             3.60s ± 2%   3.59s ± 1%   ~     (p=0.818 n=6+6)
Peano-8              84.8ms ± 1%  84.6ms ± 1%   ~     (p=0.180 n=6+6)

Results on POWER8 and POWER10 are similar

Change-Id: If4ac95a85aaa7b2266014e1f8fb7cd7440cbf906
Reviewed-on: https://go-review.googlesource.com/c/go/+/353730
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
2021-10-05 21:25:51 +00:00
Ian Lance Taylor
8444a545e3 text/template: only unwrap final and/or value
In the last CL I missed the fact that except for the final value the
code already unwraps the argument.

For #31103

Change-Id: Ic9099aeb50c6b3322fc14a90ac8026c1d8cb1698
Reviewed-on: https://go-review.googlesource.com/c/go/+/354091
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-05 21:22:16 +00:00
Dan Scales
55e7f7e12d cmd/compile: fix problem with methods of instantiated types which are nointerface
In the case of a nointerface method on an instantiated type, we still
have to call methodWrapper, because methodWrapper generates the actual
generic method on the type as well. Currently, we don't call
methodWrapper, so the method on the instantiated type never gets filled
in.

Adjusted the code to still call methodWrapper, but not use the result,
in the case of a nointerface method on an instantiated type.

Change-Id: I34bca58de2861aa772be04eb8dd7695c5b7f3a77
Reviewed-on: https://go-review.googlesource.com/c/go/+/353369
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
2021-10-05 20:57:56 +00:00
Dan Scales
695a59b513 test: add test for export/import of recover & defer
Add a simple test with an exported generic function that does
recover/defer, to test that recover/defer are exported/imported
properly (and a generic function with recover/defer works fine).

Change-Id: Idc3af101cbb78fc96bf945f1f5eab2740dd8994b
Reviewed-on: https://go-review.googlesource.com/c/go/+/353883
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
2021-10-05 20:53:02 +00:00
Bryan C. Mills
0d6561b72b cmd/go: do not check for a built binary in TestScript/mod_get_fossil
This test hasn't passed since CL 349997, but the failure was not
detected because the Go project's builders do not have a 'fossil'
binary installed (#48802).

For #43684

Change-Id: I25544574ab48f4f146ae3795e541179e78815758
Reviewed-on: https://go-review.googlesource.com/c/go/+/354149
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-05 20:52:58 +00:00
Josh Bleecher Snyder
990c9c6cab Revert "runtime: use unsafe.Slice in getStackMap"
This reverts commit golang.org/cl/352953.

Reason for revert: unsafe.Slice is considerably slower.
Part of this is extra safety checks (good), but most of it
is the function call overhead. We should consider open-coding it (#48798).

Impact of this change:

name                   old time/op  new time/op  delta
StackCopyWithStkobj-8  12.1ms ± 5%  11.6ms ± 3%  -4.03%  (p=0.009 n=10+8)

Change-Id: Ib2448e3edac25afd8fb55ffbea073b8b11521bde
Reviewed-on: https://go-review.googlesource.com/c/go/+/354090
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-05 20:35:54 +00:00
Josh Bleecher Snyder
113b52979f runtime: remove a branch from funcdata
name                   old time/op  new time/op  delta
StackCopyWithStkobj-8  12.1ms ± 7%  11.6ms ± 8%  -3.88%  (p=0.002 n=19+19)

Change-Id: Idf810017d541eba70bcf9c736267de9efae916d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/354072
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 20:35:48 +00:00
Josh Bleecher Snyder
75773b0e7b runtime: add BenchmarkStackCopyWithStkobj
For benchmarking and improving recent stkobj-related changes.

Co-Authored-By: Cherry Mui <cherryyz@google.com>
Change-Id: I34c8b1a09e4cf98547460882b0d3908158269f57
Reviewed-on: https://go-review.googlesource.com/c/go/+/354071
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 20:35:41 +00:00
Katie Hockman
0b4d4998d5 testing: document f.Fuzz requirement to not change underlying data
Updates #48606

Change-Id: I6d555fdefccd842fb65ec8d630b4808bcb54a825
Reviewed-on: https://go-review.googlesource.com/c/go/+/353977
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-10-05 20:15:01 +00:00
Robert Griesemer
7ae83c8f38 go/types: implement generic slice expressions
This is a clean port of CL 354070 from types2 to go/types.

Change-Id: I44de1b8e6c0177e2a33e7f36a82465dc520c35aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/354092
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-05 19:28:36 +00:00
Josh Bleecher Snyder
c1a0aa300a cmd/compile: make stkobj symbols content-addressable
Shrinks binaries a little bit.

size    before    after     Δ       %
api     4892370   4875858   -16512  -0.338%
asm     4711218   4694706   -16512  -0.350%
cgo     4164770   4148258   -16512  -0.396%
compile 21875922  21826386  -49536  -0.226%
cover   4358370   4341858   -16512  -0.379%
doc     3532562   3516050   -16512  -0.467%
link    6110786   6094274   -16512  -0.270%
objdump 3982914   3966402   -16512  -0.415%
pprof   12869986  12836962  -33024  -0.257%
trace   9614626   9598114   -16512  -0.172%
vet     6580322   6563810   -16512  -0.251%
total   102897284 102666116 -231168 -0.225%

Change-Id: Idf4ba3c05e35ec1d1ae957d6ded00ae79cc0fd2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/172198
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 19:17:53 +00:00
Josh Bleecher Snyder
3100dc1a7f cmd/link,runtime: remove relocations from stkobjs
Use an offset from go.func.* instead.
This removes the last relocation from funcdata symbols,
which lets us simplify that code.

size      before    after     Δ       %
addr2line 3683218   3680706   -2512   -0.068%
api       4951074   4944850   -6224   -0.126%
asm       4744258   4757586   +13328  +0.281%
buildid   2419986   2418546   -1440   -0.060%
cgo       4218306   4197346   -20960  -0.497%
compile   22132066  22076882  -55184  -0.249%
cover     4432834   4411362   -21472  -0.484%
dist      3111202   3091346   -19856  -0.638%
doc       3583602   3563234   -20368  -0.568%
fix       3023922   3020658   -3264   -0.108%
link      6188034   6164642   -23392  -0.378%
nm        3665826   3646818   -19008  -0.519%
objdump   4015234   4012450   -2784   -0.069%
pack      2155010   2153554   -1456   -0.068%
pprof     13044178  13011522  -32656  -0.250%
test2json 2402146   2383906   -18240  -0.759%
trace     9765410   9736514   -28896  -0.296%
vet       6681250   6655058   -26192  -0.392%
total     104217556 103926980 -290576 -0.279%

relocs    before  after   Δ       %
addr2line 25563   25066   -497    -1.944%
api       18409   17176   -1233   -6.698%
asm       18903   18271   -632    -3.343%
buildid   9513    9233    -280    -2.943%
cgo       17103   16222   -881    -5.151%
compile   64825   60421   -4404   -6.794%
cover     19464   18479   -985    -5.061%
dist      10798   10135   -663    -6.140%
doc       13503   12735   -768    -5.688%
fix       11465   10820   -645    -5.626%
link      23214   21849   -1365   -5.880%
nm        25480   24987   -493    -1.935%
objdump   26610   26057   -553    -2.078%
pack      7951    7665    -286    -3.597%
pprof     63964   60761   -3203   -5.008%
test2json 8735    8389    -346    -3.961%
trace     39639   37180   -2459   -6.203%
vet       25970   24044   -1926   -7.416%
total     431108  409489  -21619  -5.015%

Change-Id: I43c26196a008da6d1cb3a782eea2f428778bd569
Reviewed-on: https://go-review.googlesource.com/c/go/+/353138
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 19:16:08 +00:00
Lynn Boger
ae83301ab2 internal/buildcfg: enable register ABI for PPC64
This enables the new register ABI for all PPC64 targets
by default including linux/ppc64, linux/ppc64le, and aix/ppc64.

Improvements with the new register ABI on a power9:

name	old time/op (ns/op)	new time/op (ns/op)	delta
BinaryTree17    	3882070000	3274900000	-15.64%
Fannkuch11	        3787620000	3614740000	-4.56%
FmtFprintfEmpty	        58.705	        51.1875 	-12.81%
FmtFprintfString	101.675	        94.4725 	-7.08%
FmtFprintfInt	        112.725 	104.075 	-7.67%
FmtFprintfIntInt	166.475 	158.05  	-5.06%
FmtFprintfPrefixedInt	183.7	        178.975 	-2.57%
FmtFprintfFloat	        246.55	        258.8	        +4.97%
FmtManyArgs	        648.325 	665.875 	+2.71%
GobDecode	        8004660	        6802210 	-15.02%
GobEncode       	7289780 	5675710 	-22.14%
Gzip    	        326931000	323586000	-1.02%
Gunzip          	47544700	37808000	-20.48%
HTTPClientServer    	46927.2 	42357.8 	-9.74%
JSONEncode	        12098300	9621450	        -20.47%
JSONDecode      	62305300	55410200	-11.07%
Mandelbrot200	        5841540 	5934590 	+1.59%
GoParse         	5594880 	4003360 	-28.45%
RegexpMatchEasy0_32	96.185	        89.6325 	-6.81%
RegexpMatchEasy0_1K	255.775 	210.45  	-17.72%
RegexpMatchEasy1_32	102.95  	93.8825 	-8.81%
RegexpMatchEasy1_1K	511.65  	385.075 	-24.74%
RegexpMatchMedium_32	1414.75 	1236.75 	-12.58%
RegexpMatchMedium_1K	42114.5 	37022.5 	-12.09%
RegexpMatchHard_32	2110.5  	1901.5  	-9.90%
RegexpMatchHard_1K	63559.5 	59494   	-6.40%
Revcomp         	532981000	480640000	-9.82%
Template        	81903600	65743300	-19.73%
TimeParse       	310.75	        276.525 	-11.01%
TimeFormat	        483.4   	355.475  	-26.46%

Change-Id: Ib7c5dfe8ddc2f17050943912048f55667dabde39
Reviewed-on: https://go-review.googlesource.com/c/go/+/353969
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 19:15:03 +00:00
Robert Griesemer
7e69c5decf cmd/compile/internal/types2: implement generic slice expressions
For now, the constraint's underlying type set must be a single
type that is sliceable.

Change-Id: I08b6a2e88fe35e8238a95b3f40dc969689021a0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/354070
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-05 18:39:53 +00:00
nimelehin
097a82f54d cmd/compile: don't emit unnecessary amd64 extension checks
In case of amd64 the compiler issues checks if extensions are
available on a platform. With GOAMD64 microarchitecture levels
provided, some of the checks could be eliminated.

Change-Id: If15c178bcae273b2ce7d3673415cb8849292e087
Reviewed-on: https://go-review.googlesource.com/c/go/+/352010
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-05 18:32:12 +00:00
Keith Randall
5d946f1892 cmd/compile: add remaining >v1 instructions to v1-only test
roundsd and FMA (vfmadd231sd).

Change-Id: I2d91332667e577bd9bb903ac58904f62b8454128
Reviewed-on: https://go-review.googlesource.com/c/go/+/354069
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-10-05 18:31:14 +00:00
Robert Griesemer
5140ad104b cmd/compile/internal/types2: update the recorded function type after inference
This is a clean port of CL 353831 from go/types to types2.

For #47916.

Change-Id: I2c2b9c7bbcd416fb21f3032c55a06406bad9334a
Reviewed-on: https://go-review.googlesource.com/c/go/+/353934
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-10-05 17:10:45 +00:00
Keith Randall
cbd7200167 cmd/compile: test to ensure we guard GOAMD64>v1 instructions
When compiling with GOAMD64=v1, clobber all the >v1 instructions
with faulting instructions. Run the binary with the corresponding
feature flags off. We shouldn't try to execute any of the clobbered
instructions.

Change-Id: I295acaf9fd0eafd037192aa6f933365c794cc76e
Reviewed-on: https://go-review.googlesource.com/c/go/+/352831
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-10-05 17:05:06 +00:00
wdvxdr
060cd73ab9 cmd/compile: use TZCNT instruction for GOAMD64>=v3
on my Intel CoffeeLake CPU:
name               old time/op  new time/op  delta
TrailingZeros-8    0.68ns ± 1%  0.64ns ± 1%  -6.26%  (p=0.000 n=10+10)
TrailingZeros8-8   0.70ns ± 1%  0.70ns ± 1%    ~     (p=0.697 n=10+10)
TrailingZeros16-8  0.70ns ± 1%  0.70ns ± 1%  +0.57%  (p=0.043 n=10+10)
TrailingZeros32-8  0.66ns ± 1%  0.64ns ± 1%  -3.35%  (p=0.000 n=10+10)
TrailingZeros64-8  0.68ns ± 1%  0.64ns ± 1%  -5.84%  (p=0.000 n=9+10)

Updates #45453

Change-Id: I228ff2d51df24b1306136f061432f8a12bb1d6fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/353249
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2021-10-05 16:06:49 +00:00
Cherry Mui
f1f626de53 cmd/link: mangle function name with ABI on XCOFF
This is like CL 304432 and CL 307229, for XCOFF.

With this, GOEXPERIMENT=regabi works on AIX/PPC64.

Change-Id: I8cf00681df5c93f397913febd78f38099d91e7c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/353972
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-10-05 15:58:05 +00:00
Josh Bleecher Snyder
017ffcd10d cmd/link, runtime: convert FUNCDATA relocations to offsets
Every function has associated numbered extra funcdata to another symbol.
Prior to this change, a funcdata pointer was stored as a relocation.

This change alters this to be an offset relative to go.func.* or go.funcrel.*.

This reduces the number of relocations on darwin/arm64 by about 40%.
It also shrinks externally linked binaries. On darwin/arm64:

size      before    after     Δ        %
addr2line 3788498   3699730   -88768   -2.343%
api       5100018   4951074   -148944  -2.920%
asm       4855234   4744274   -110960  -2.285%
buildid   2500162   2419986   -80176   -3.207%
cgo       4338258   4218306   -119952  -2.765%
compile   22764418  22132226  -632192  -2.777%
cover     4583186   4432770   -150416  -3.282%
dist      3200962   3094626   -106336  -3.322%
doc       3680402   3583602   -96800   -2.630%
fix       3114914   3023922   -90992   -2.921%
link      6308578   6154786   -153792  -2.438%
nm        3754338   3665826   -88512   -2.358%
objdump   4124738   4015234   -109504  -2.655%
pack      2232626   2155010   -77616   -3.476%
pprof     13497474  13044066  -453408  -3.359%
test2json 2483810   2402146   -81664   -3.288%
trace     10108898  9748802   -360096  -3.562%
vet       6884322   6681314   -203008  -2.949%
total     107320836 104167700 -3153136 -2.938%

relocs    before  after   Δ       %
addr2line 33357   25563   -7794   -23.365%
api       31589   18409   -13180  -41.723%
asm       27825   18904   -8921   -32.061%
buildid   15603   9513    -6090   -39.031%
cgo       27809   17103   -10706  -38.498%
compile   114769  64829   -49940  -43.513%
cover     32932   19462   -13470  -40.902%
dist      18797   10796   -8001   -42.565%
doc       22891   13503   -9388   -41.012%
fix       19700   11465   -8235   -41.802%
link      37324   23198   -14126  -37.847%
nm        33226   25480   -7746   -23.313%
objdump   35237   26610   -8627   -24.483%
pack      13535   7951    -5584   -41.256%
pprof     97986   63961   -34025  -34.724%
test2json 15113   8735    -6378   -42.202%
trace     66786   39636   -27150  -40.652%
vet       43328   25971   -17357  -40.060%
total     687806  431088  -256718 -37.324%

It should also incrementally speed up binary launching
and may reduce linker memory use.

This is another step towards removing relocations so
that pages that were previously dirtied by the loader may remain clean,
which will offer memory savings useful in constrained environments like iOS.

Removing the relocations in .stkobj symbols will allow some simplifications.
There will be no references into go.funcrel.*,
so we will no longer need to use the bottom bit to distinguish offset bases.

Change-Id: I83d34c1701d6f3f515b9905941477d522441019d
Reviewed-on: https://go-review.googlesource.com/c/go/+/352110
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 15:47:57 +00:00
Josh Bleecher Snyder
cfd74f7727 cmd/link: move all FUNCDATA refs into go.func.*
This change moves all symbols referred to by FUNCDATA
into go.func.* and go.funcrel.*.

Surprisingly (because it inhibits some content-addressability),
it shrinks binaries by a little bit, about 0.1%.

This paves the way for a subsequent change to change
FUNCDATA relocations to offsets.

Change-Id: I70e487205073699f442192b0791cc92da5663057
Reviewed-on: https://go-review.googlesource.com/c/go/+/352189
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-05 15:47:07 +00:00
Lynn Boger
7983830423 runtime: add ABIInternal to strhash and memhash on ppc64x
In testing the register ABI changes I found that the benchmarks
for strhash and memhash degraded unless I marked them as
ABIInternal. This fixes that.

Change-Id: I9c7a04eaa6a66b888877f43454c51277c07e638a
Reviewed-on: https://go-review.googlesource.com/c/go/+/353832
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
2021-10-05 14:12:44 +00:00
Tobias Klauser
d55009c594 crypto/rand: document additional getrandom/getentropy support in Reader
CL 269999 added support for getrandom on Dragonfly.
CL 299134 added support for getrandom on Solaris.
CL 302489 added support for getentropy on macOS.

Update the godoc for Reader accordingly.

Change-Id: Ice39e5e62f052f21b664db6abbfd97f03944586e
Reviewed-on: https://go-review.googlesource.com/c/go/+/353190
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-05 07:32:41 +00:00
Cuong Manh Le
123393a535 cmd/go: enable test build concurrent backend on darwin/arm64
After CL 353871, darwin/arm64 now do concurrent build, so enable the
test for it.

Updates #48490

Change-Id: I29336f6fc7d7d2f463d8ad2a620534bd7f048d2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/353949
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-05 01:30:56 +00:00
Matthew Dempsky
81b7ec1ad5 cmd/dist: omit cmd/cgo from toolchain1
We don't need cmd/cgo for building go_bootstrap or toolchain2, so skip
building it as part of toolchain1.

This allows cmd/cgo to assume a current go/ast; e.g., that
ast.IndexListExpr exists (needed for next CL).

Change-Id: I642bba780bf273e6ea9c6e7c5d5d7ccfe86bf462
Reviewed-on: https://go-review.googlesource.com/c/go/+/353884
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-05 00:29:40 +00:00
Cherry Mui
e5f6d8d00c cmd/internal/obj: reduce alignment for gcbits
runtime.gcbits symbols are pointer masks, which are just bytes.

Change-Id: I6e86359451c7da69da435e1928e55712dd904047
Reviewed-on: https://go-review.googlesource.com/c/go/+/353571
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-10-04 23:29:20 +00:00
Josh Bleecher Snyder
78c2529d73 debug/gosym: add funcTab abstraction
This clarifies the existing code and makes modifications easier.

name            old time/op    new time/op    delta
115/LineToPC-8    58.6µs ± 3%    56.4µs ± 3%  -3.80%  (p=0.000 n=15+15)
115/PCToLine-8     194ns ± 2%     188ns ± 2%  -3.31%  (p=0.000 n=15+15)

Change-Id: Iafdf57af93d5e3c145965c32e0227e37c69ab017
Reviewed-on: https://go-review.googlesource.com/c/go/+/353880
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-04 22:59:44 +00:00
Josh Bleecher Snyder
199ec42350 debug/gosym: use sort.Search in findFunc
Use sort.Search instead of open-coding the binary search.
This makes the code a lot easier to work on.

As a bonus, it speeds it up.

name            old time/op    new time/op    delta
115/LineToPC-8    57.4µs ± 5%    59.2µs ± 8%   +3.19%  (p=0.003 n=15+13)
115/PCToLine-8     255ns ± 1%     192ns ± 3%  -24.63%  (p=0.000 n=15+15)

Change-Id: I41da18bfb0e745c40d24e5b96e50dfdd0c3b79f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/353879
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-04 22:59:13 +00:00
Josh Bleecher Snyder
7c79e8ef09 cmd/objdump: print full disassembly when testing with -v
It is helpful for debugging.

Change-Id: Idd566d312037420f8341fcf502a45410a8497798
Reviewed-on: https://go-review.googlesource.com/c/go/+/353878
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-10-04 22:54:58 +00:00
Cherry Mui
17674e2f17 cmd/internal/obj, cmd/link: move symbol alignment logic to object file writer
Change-Id: I827a9702dfa01b712b88331668434f8db94df249
Reviewed-on: https://go-review.googlesource.com/c/go/+/353569
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-10-04 22:46:23 +00:00
Josh Bleecher Snyder
c2483a5c03 cmd, runtime: eliminate runtime.no_pointers_stackmap
runtime.no_pointers_stackmap is an odd beast.
It is defined in a Go file, populated by assembly,
used by the GC, and its address is magic used
by async pre-emption to ascertain whether a
routine was implemented in assembly.

A subsequent change will force all GC data into the go.func.* linker symbol.
runtime.no_pointers_stackmap is GC data, so it must go there.
Yet it also needs to go into rodata, for the runtime address trick.

This change eliminates it entirely.

Replace the runtime address check with the newly introduced asm funcflag.

Handle the assembly macro as magic, similarly to our handling of go_args_stackmap.
This allows the no_pointers_stackmap to be identical in all ways
to other gclocals stackmaps, including content-addressability.

Change-Id: Id2f20a262cfab0719beb88e6342984ec4b196268
Reviewed-on: https://go-review.googlesource.com/c/go/+/353672
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-04 22:45:17 +00:00
Josh Bleecher Snyder
a8d78fae95 cmd/compile: refactor gclocals sym creation
It'll be used in second place in a subsequent change.
No functional changes.

Change-Id: I58dd12d7dde45b36995d031fc7fbb27d6eaf48d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/353670
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2021-10-04 22:38:27 +00:00
Josh Bleecher Snyder
752cc07c77 cmd, runtime: mark assembly routines in FuncFlags
There's no good way to ascertain at runtime whether
a function was implemented in assembly.
The existing workaround doesn't play nicely
with some upcoming linker changes.

This change introduces an explicit marker for routines
implemented in assembly.

This change doesn't use the new bit anywhere,
it only introduces it.

Change-Id: I4051dc0afc15b260724a04b9d18aeeb94911bb29
Reviewed-on: https://go-review.googlesource.com/c/go/+/353671
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-10-04 22:27:40 +00:00
Michael Pratt
7ee4c16654 Revert "runtime: add padding to Linux kernel structures"
This reverts commit f0db7eae74.

Reason for revert: Breaks linux-386 tests

Change-Id: Ia51fbf97460ab52920b67d6db6177ac2d6b0058e
Reviewed-on: https://go-review.googlesource.com/c/go/+/353432
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-04 22:08:53 +00:00
Cherry Mui
d9952ff511 cmd/compile: set opendefer info symbol as content-addressable
Also move the logic of setting arginfo symbols content-addressable
to the place of symbol creation.

Change-Id: Ia5c3d77b1cec988c42c84d573170120948575c07
Reviewed-on: https://go-review.googlesource.com/c/go/+/353830
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-10-04 22:00:53 +00:00
Ruslan Andreev
739328c694 cmd/compile: intrinsify publicationBarrier
This CL intrinsify asm call for publicationBarrier on ARM64. As for x86
we may completly removes any instructions due to strong memory
oredering, but decided to leave it as is for compiler barrier.

Benchmarks Go1 ARM64:
name                     old time/op    new time/op    delta
BinaryTree17-8              3.38s ± 1%     3.36s ± 1%    ~     (p=0.095 n=5+5)
Fannkuch11-8                2.93s ± 0%     2.84s ± 0%  -3.26%  (p=0.008 n=5+5)
FmtFprintfEmpty-8          54.2ns ± 1%    54.0ns ± 1%    ~     (p=0.690 n=5+5)
FmtFprintfString-8          111ns ± 0%     109ns ± 0%  -1.48%  (p=0.008 n=5+5)
FmtFprintfInt-8             140ns ± 0%     138ns ± 0%  -1.10%  (p=0.000 n=4+5)
FmtFprintfIntInt-8          168ns ± 0%     169ns ± 0%  +0.66%  (p=0.008 n=5+5)
FmtFprintfPrefixedInt-8     206ns ± 1%     195ns ± 0%  -5.12%  (p=0.008 n=5+5)
FmtFprintfFloat-8           270ns ± 0%     269ns ± 0%  -0.20%  (p=0.024 n=5+5)
FmtManyArgs-8               721ns ± 0%     733ns ± 0%  +1.69%  (p=0.008 n=5+5)
GobDecode-8                9.75ms ± 1%    9.28ms ± 3%  -4.88%  (p=0.008 n=5+5)
GobEncode-8                6.38ms ± 1%    6.34ms ± 1%    ~     (p=0.095 n=5+5)
Gzip-8                      255ms ± 0%     254ms ± 0%  -0.44%  (p=0.008 n=5+5)
Gunzip-8                   41.8ms ± 1%    40.8ms ± 0%  -2.40%  (p=0.008 n=5+5)
HTTPClientServer-8         65.1µs ± 1%    65.1µs ± 1%    ~     (p=0.690 n=5+5)
JSONEncode-8               11.7ms ± 0%    11.7ms ± 1%    ~     (p=0.841 n=5+5)
JSONDecode-8               60.2ms ± 1%    60.0ms ± 0%    ~     (p=0.841 n=5+5)
Mandelbrot200-8            5.85ms ± 0%    5.86ms ± 0%  +0.22%  (p=0.016 n=4+5)
GoParse-8                  4.38ms ± 0%    4.35ms ± 0%  -0.60%  (p=0.008 n=5+5)
RegexpMatchEasy0_32-8      87.1ns ± 2%    88.3ns ± 1%    ~     (p=0.151 n=5+5)
RegexpMatchEasy0_1K-8       306ns ± 0%     306ns ± 1%    ~     (p=0.143 n=5+5)
RegexpMatchEasy1_32-8      86.3ns ± 0%    84.8ns ± 0%  -1.81%  (p=0.008 n=5+5)
RegexpMatchEasy1_1K-8       491ns ± 2%     487ns ± 1%    ~     (p=0.548 n=5+5)
RegexpMatchMedium_32-8     7.50ns ± 0%    7.49ns ± 1%    ~     (p=0.817 n=5+5)
RegexpMatchMedium_1K-8     40.3µs ± 1%    39.9µs ± 0%  -1.02%  (p=0.008 n=5+5)
RegexpMatchHard_32-8       2.10µs ± 1%    2.10µs ± 1%    ~     (p=0.548 n=5+5)
RegexpMatchHard_1K-8       62.4µs ± 1%    62.5µs ± 2%    ~     (p=0.690 n=5+5)
Revcomp-8                   504ms ± 1%     502ms ± 1%    ~     (p=0.095 n=5+5)
Template-8                 86.8ms ± 1%    86.5ms ± 1%    ~     (p=0.222 n=5+5)
TimeParse-8                 330ns ± 0%     327ns ± 0%  -0.84%  (p=0.008 n=5+5)
TimeFormat-8                383ns ± 1%     392ns ± 1%  +2.42%  (p=0.008 n=5+5)
[Geo mean]                 54.3µs         53.9µs       -0.67%

name                     old speed      new speed      delta
GobDecode-8              78.7MB/s ± 1%  82.8MB/s ± 4%  +5.16%  (p=0.008 n=5+5)
GobEncode-8               120MB/s ± 1%   121MB/s ± 1%    ~     (p=0.095 n=5+5)
Gzip-8                   76.2MB/s ± 0%  76.5MB/s ± 0%  +0.44%  (p=0.008 n=5+5)
Gunzip-8                  464MB/s ± 1%   475MB/s ± 0%  +2.45%  (p=0.008 n=5+5)
JSONEncode-8              166MB/s ± 0%   166MB/s ± 1%    ~     (p=0.841 n=5+5)
JSONDecode-8             32.2MB/s ± 1%  32.3MB/s ± 0%    ~     (p=0.714 n=5+5)
GoParse-8                13.2MB/s ± 0%  13.3MB/s ± 0%  +0.59%  (p=0.008 n=5+5)
RegexpMatchEasy0_32-8     368MB/s ± 2%   362MB/s ± 1%    ~     (p=0.151 n=5+5)
RegexpMatchEasy0_1K-8    3.34GB/s ± 0%  3.34GB/s ± 1%    ~     (p=0.127 n=5+5)
RegexpMatchEasy1_32-8     371MB/s ± 0%   378MB/s ± 0%  +1.84%  (p=0.008 n=5+5)
RegexpMatchEasy1_1K-8    2.09GB/s ± 2%  2.10GB/s ± 1%    ~     (p=0.548 n=5+5)
RegexpMatchMedium_32-8    133MB/s ± 0%   134MB/s ± 1%    ~     (p=0.952 n=5+5)
RegexpMatchMedium_1K-8   25.4MB/s ± 1%  25.6MB/s ± 0%  +1.04%  (p=0.008 n=5+5)
RegexpMatchHard_32-8     15.3MB/s ± 1%  15.2MB/s ± 1%    ~     (p=0.500 n=5+5)
RegexpMatchHard_1K-8     16.4MB/s ± 1%  16.4MB/s ± 2%    ~     (p=0.595 n=5+5)
Revcomp-8                 504MB/s ± 1%   506MB/s ± 1%    ~     (p=0.095 n=5+5)
Template-8               22.4MB/s ± 1%  22.4MB/s ± 1%    ~     (p=0.206 n=5+5)
[Geo mean]                120MB/s        121MB/s       +0.71%

Change-Id: I9cc10840b5c0d6bf759150f052c79f4c499e35e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/328290
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: David Chase <drchase@google.com>
2021-10-04 22:00:19 +00:00
Robert Findley
d99f1de56e go/types: update the recorded function type after inference
This change preserves the observable invariant that for an *ast.CallExpr
'call', Info.Types[call.Fun] is the signature being called.

Updates #47916

Change-Id: I3e97c712a7ee33a4f29e8cf4c18dc7c946b66cc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/353831
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-10-04 21:57:33 +00:00
Rhys Hiltner
f0db7eae74 runtime: add padding to Linux kernel structures
Go exchanges siginfo and sigevent structures with the kernel. They
contain unions, but Go's use is limited to the first few fields. Pad out
the rest so the size Go sees is the same as what the Linux kernel sees.

This is a follow-up to CL 342052 which added the sigevent struct without
padding. It updates the siginfo struct as well so there are no bad
examples in the defs_linux_*.go files.

Change-Id: Id991d4a57826677dd7e6cc30ad113fa3b321cddf
Reviewed-on: https://go-review.googlesource.com/c/go/+/353136
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
2021-10-04 21:10:16 +00:00
Amelia Downs
e8a85e90ac internal/fuzz: print size of interesting cache
This change updates the log lines to clarify that the printed
interesting count is only for newly discovered cache entries, and prints
the total cache size. It only prints information about interesting
entries when coverageEnabled is true.

Fixes #48669

Change-Id: I2045afc204764c1842d323e8ae42016fb21b6fb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/353172
Trust: Michael Knyszek <mknyszek@google.com>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-10-04 20:57:50 +00:00