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

53778 Commits

Author SHA1 Message Date
eric fang
eeb1ba7a89 cmd/compile/obj/arm64: fix encoding error of FMOVD/FMOVS $0|ZR
Previously the first operand of FMOVD and FMOVS could be $0, which
would be converted to the ZR register. This is prohibited by CL 404316,
also it broken the encoding of "FMOVD/FMOVS ZR, Rn", this CL restores
this instruction format and fixes the encoding issue.

Fixes #54655.
Fixes #54729.

Change-Id: I9c42cd41296bed7ffd601609bd8ecaa27d11e659
Reviewed-on: https://go-review.googlesource.com/c/go/+/425188
Run-TryBot: Eric Fang <eric.fang@arm.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-29 17:03:10 +00:00
Cuong Manh Le
7393049780 reflect: simplify array value comparable check
If array element is not interface, array or struct, we just need to
check whether the array element type is comparable.

Change-Id: I1ab94cfa17ae86feb6cd3fbdf878af5a776e7bec
Reviewed-on: https://go-review.googlesource.com/c/go/+/426194
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-29 16:39:37 +00:00
Nigel Tao
63e129ba1c image/png: allow both PLTE and tRNS chunks for TrueColor
Prior to this commit, png.Decode would allow TrueColor PNG images that
have one but not both of PLTE and tRNS chunks.

Fixes #54142

Change-Id: I259c1fff86a0aa5640dbadf7ad834e05fbd1430c
Reviewed-on: https://go-review.googlesource.com/c/go/+/424916
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Nigel Tao (INACTIVE; USE @golang.org INSTEAD) <nigeltao@google.com>
2022-08-29 15:11:31 +00:00
cuiweixie
a1c9783ca1 testing: convert numFailed to atomic type
Change-Id: Ic3464e95ad8901df5477d7717760b8c6d08ce97b
Reviewed-on: https://go-review.googlesource.com/c/go/+/426078
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-29 14:52:44 +00:00
ianwoolf
863d57cc7d cmd/go/internal/modload: return error when duplicate module paths among modules in go.work
Fixes #54048

Change-Id: I27350af451ff50532856092f2d99b6cc6dc6743d
Reviewed-on: https://go-review.googlesource.com/c/go/+/419557
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-29 14:48:48 +00:00
David Chase
7f92ccea5c debug/pe: check size in uint64 to avoid overflow
uint32(sz) != n*uint32(ddSz) can go wrong if
the RHS overflows, so do it in wider precision.

Fixes #54640.

Change-Id: I776563330e46de6cdacd4055f6ff08e7de67797f
Reviewed-on: https://go-review.googlesource.com/c/go/+/425364
Reviewed-by: Dan Kortschak <dan@kortschak.io>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-29 01:35:52 +00:00
Cuong Manh Le
846c378b8c cmd/cgo: add and use runtime/cgo.Incomplete instead of //go:notinheap
Updates #46731

Change-Id: Ia83f27c177cc2f57e240cb5c6708d4552423f5be
Reviewed-on: https://go-review.googlesource.com/c/go/+/421879
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-28 16:04:49 +00:00
Wayne Zuo
a6219737e3 cmd/compile: intrinsify Sub64 on riscv64
After this CL, the performance difference in crypto/elliptic
benchmarks on linux/riscv64 are:

name                 old time/op    new time/op    delta
ScalarBaseMult/P256    1.64ms ± 1%    1.60ms ± 1%   -2.36%  (p=0.008 n=5+5)
ScalarBaseMult/P224    1.53ms ± 1%    1.47ms ± 2%   -4.24%  (p=0.008 n=5+5)
ScalarBaseMult/P384    5.12ms ± 2%    5.03ms ± 2%     ~     (p=0.095 n=5+5)
ScalarBaseMult/P521    22.3ms ± 2%    13.8ms ± 1%  -37.89%  (p=0.008 n=5+5)
ScalarMult/P256        4.49ms ± 2%    4.26ms ± 2%   -5.13%  (p=0.008 n=5+5)
ScalarMult/P224        4.33ms ± 1%    4.09ms ± 1%   -5.59%  (p=0.008 n=5+5)
ScalarMult/P384        16.3ms ± 1%    15.5ms ± 2%   -4.78%  (p=0.008 n=5+5)
ScalarMult/P521         101ms ± 0%      47ms ± 2%  -53.36%  (p=0.008 n=5+5)

Change-Id: I31cf0506e27f9d85f576af1813630a19c20dda8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/420095
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-27 05:43:59 +00:00
Wayne Zuo
969f48a3a2 cmd/compile: intrinsify Add64 on riscv64
According to RISCV instruction set manual v2.2 Sec 2.4, we can
implement overflowing check for unsigned addition cheaply using
SLTU instructions.

After this CL, the performance difference in crypto/elliptic
benchmarks on linux/riscv64 are:

name                 old time/op    new time/op    delta
ScalarBaseMult/P256    1.93ms ± 1%    1.64ms ± 1%  -14.96%  (p=0.008 n=5+5)
ScalarBaseMult/P224    1.80ms ± 2%    1.53ms ± 1%  -14.89%  (p=0.008 n=5+5)
ScalarBaseMult/P384    6.15ms ± 2%    5.12ms ± 2%  -16.73%  (p=0.008 n=5+5)
ScalarBaseMult/P521    25.9ms ± 1%    22.3ms ± 2%  -13.78%  (p=0.008 n=5+5)
ScalarMult/P256        5.59ms ± 1%    4.49ms ± 2%  -19.79%  (p=0.008 n=5+5)
ScalarMult/P224        5.42ms ± 1%    4.33ms ± 1%  -20.01%  (p=0.008 n=5+5)
ScalarMult/P384        19.9ms ± 2%    16.3ms ± 1%  -18.15%  (p=0.008 n=5+5)
ScalarMult/P521        97.3ms ± 1%   100.7ms ± 0%   +3.48%  (p=0.008 n=5+5)

Change-Id: Ic4c82ced4b072a4a6575343fa9f29dd09b0cabc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/420094
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-27 05:43:32 +00:00
Jianwei Mao
a2d2e6e7cb net: add FlagRunning to exactly reflect the states of an interface.
Correctly set this flag while parsing the syscall result.

The FlagUp flag can not distinguish the following situations:
1. interface is plugged, automatically up, and in running(UP) state
2. interface is not plugged, administratively or manually set to up,
but in DOWN state

So, We can't distinguish the state of a NIC by the FlagUp flag alone.

Fixes #53482

Change-Id: I43796bea1a7f72d1fddfef914efe603c81995e1b
GitHub-Last-Rev: 686b5d888e
GitHub-Pull-Request: golang/go#53484
Reviewed-on: https://go-review.googlesource.com/c/go/+/413454
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ryan Schuster <shuey19831@gmail.com>
Reviewed-by: Jianwei Mao <maojianwei2020@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
2022-08-27 05:42:03 +00:00
Paul E. Murphy
a0948493ac debug/elf: fix reloc number of R_PPC64_SECTOFF_LO_DS
R_PPC64_SECTOFF_LO_DS is defined as reloc 62 on all PPC64 ELF ABIs.

Fixes #53356

Change-Id: I5fabf6be32f3310c5aed47d4d654e05fb7bc9de0
Reviewed-on: https://go-review.googlesource.com/c/go/+/411915
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-27 02:36:28 +00:00
ianwoolf
333681d6a8 net: Resolver.LookupIP return error for empty string
Fixes #53995

Change-Id: Ib0de237b57382feb6b8070f2310945aef6c7db01
Reviewed-on: https://go-review.googlesource.com/c/go/+/419734
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
2022-08-26 22:52:50 +00:00
cuiweixie
acabf87127 reflect: add Value.{Comparable,Equal}
For #46746

Change-Id: I879124974cdb55932cd9d07d3b384d49d5059857
Reviewed-on: https://go-review.googlesource.com/c/go/+/423794
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-26 20:56:48 +00:00
Lynn Boger
897ad2fe90 cmd/compile: fix score for Select{0,1} with type flags
A recent change was made for ppc64x to treat ANDCCconst as
a tuple, allowing ANDconst to be removed from the list
of ops. Included in that change were some improvements to the
rules to avoid some extra code, mainly the elimination of a
cmp 0 following an andi. and in some cases the following
isel. While those changes worked for most cases, in a few
cases some extra unnecessary code was generated.

Currently the snippet appears in archive/zip.(*FileHeader).Mode:

        ANDCC R4,$1,R5                       // andi. r5,r4,1
        ANDCC R4,$16,R5                      // andi. r5,r4,16
        CMPW R5,R0                           // cmpw r5,r0
        ADDIS $0,$-32768,R5                  // lis r5,-32768
        OR R5,$511,R5                        // ori r5,r5,511
        MOVD $438,R6                         // li r6,438
        ISEL $2,R6,R5,R5                     // isel r5,r6,r5,eq
        MOVD $-147,R6                        // li r6,-147
        AND R6,R5,R6                         // and r6,r5,r6
        ANDCC R4,$1,R4                       // andi. r4,r4,1
        ISEL $2,R5,R6,R4                     // isel r4,r5,r6,eq

The first ANDCC is never used and should not be there.
From the ssa.html file, the scheduler is not putting the Select1
close to the ISEL, which results in the flag being clobbered
before it can be used. By changing the score for a Select0 or Select1
with type Flags, the extra ANDCC does not occur.

Change-Id: I82f4bc7c02afb1c2b1c048dc6995e0b3f9363fb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/424294
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
2022-08-26 19:15:02 +00:00
cuiweixie
3d6ba27f4f net/http: don't panic on very large MaxBytesReaderLimit
Fixes #54408

Change-Id: I454199ae5bcd087b8fc4169b7622412105e71113
GitHub-Last-Rev: a33fe7e206
GitHub-Pull-Request: golang/go#54415
Reviewed-on: https://go-review.googlesource.com/c/go/+/423314
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: xie cui <523516579@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: hopehook <hopehook@qq.com>
2022-08-26 18:17:27 +00:00
Archana R
9e810997c0 runtime: add address sanitizer support for ppc64le
updates #44853

Change-Id: I71905ee1bcb99ce7300bbed2daad3617d2643c53
Reviewed-on: https://go-review.googlesource.com/c/go/+/408814
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Archana Ravindar <aravind5@in.ibm.com>
2022-08-26 18:13:33 +00:00
Lynn Boger
62125c9b79 cmd/compile: remove branch in atomicCas{32,64} sequence on ppc64x.
This removes one of the branches in the atomicCas sequences for
ppc64/ppc64le.

Change-Id: Ibb46fbfdce052889c69e3da298f28caff540d99b
Reviewed-on: https://go-review.googlesource.com/c/go/+/422014
Reviewed-by: Archana Ravindar <aravind5@in.ibm.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
2022-08-26 18:09:56 +00:00
Alex Studer
afd792feb5 net/http: mention io.Seeker requirement in FS documentation
Both FileServer and NewFileTransport can try to seek a file, specifically
when MIME type sniffing is performed. This can be somewhat surprising to an
implementer of an fs.FS, as their filesystem will appear to work until a
user tries to access a file with an unrecognized extension (which requires
type sniffing and therefore seeking). With FileServer, this results in a
"seeker can't seek" message, which is not very clear for the developer.

The issue arises because fs.FS does not require Seek, while http.FileSystem
does. Therefore, this change adds a line to the documentation of net/http's
adapter function mentioning the requirement.

Change-Id: Ieb955b7a7f34e2be39dd696cb712513c70100b3a
GitHub-Last-Rev: fddccdae36
GitHub-Pull-Request: golang/go#48781
Reviewed-on: https://go-review.googlesource.com/c/go/+/353874
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-26 18:05:21 +00:00
Akshay Shah
4d13aabdf6 net/http: add errors.As support for x/net/http2.StreamError
To make it easier to extract the HTTP/2 error code (if any) from
net/http errors, implement an As method on the vendored copy of
golang.org/x/net/http2.StreamError. The new As method lets users work
with the vendored error type as though it were the x/net/http2
StreamError.

Fixes #53896.

Change-Id: Ib18eb428adc05a3c0e19a946ece936e2378e1c7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/425104
Run-TryBot: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
2022-08-26 18:03:42 +00:00
Cuong Manh Le
bcd1ac7120 runtime: drop padding alignment field for timeHistogram
After CL 419449, timeHistogram always have 8-byte alignment.

Change-Id: I93145502bcafa1712b811b1a6d62da5d54d0db42
Reviewed-on: https://go-review.googlesource.com/c/go/+/425777
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-26 18:01:35 +00:00
Paschalis Tsilias
dba9323f76 mime: allow duplicate media type parameters with equivalent values
Fixes #48866

Change-Id: I2bd2c806e44eb4064b1fb9a6509d79cecbbef013
Reviewed-on: https://go-review.googlesource.com/c/go/+/363094
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Tim King <taking@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
2022-08-26 17:58:37 +00:00
Andy Pan
296c40dbbe runtime: mark all methods of atomic types with go:nosplit
Atomic types may be used anywhere in the runtime,
so they must omit its usual stack overflow checks to avoid errors from stack splits.

Change-Id: Icb497334c860bcaa284a2d5a3edc47ee89844301
Reviewed-on: https://go-review.googlesource.com/c/go/+/425484
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-26 17:48:20 +00:00
Andy Pan
c8bb3cff9e internal/poll: optimize the maximum amount of bytes that can be transferred by one splice(2) call
Fixes #40222

name                          old time/op    new time/op    delta
Splice/tcp-to-tcp/1024-4        5.16µs ± 1%    5.17µs ± 4%     ~     (p=0.481 n=10+10)
Splice/tcp-to-tcp/2048-4        5.46µs ± 2%    5.48µs ± 2%     ~     (p=0.617 n=10+10)
Splice/tcp-to-tcp/4096-4        6.07µs ± 3%    6.09µs ± 5%     ~     (p=0.927 n=10+10)
Splice/tcp-to-tcp/8192-4        7.07µs ± 5%    7.16µs ± 3%     ~     (p=0.324 n=10+10)
Splice/tcp-to-tcp/16384-4       8.82µs ±10%    8.83µs ±11%     ~     (p=1.000 n=10+10)
Splice/tcp-to-tcp/32768-4       12.3µs ±12%    12.7µs ± 4%     ~     (p=0.268 n=10+9)
Splice/tcp-to-tcp/65536-4       22.1µs ± 3%    22.0µs ± 3%     ~     (p=0.912 n=10+10)
Splice/tcp-to-tcp/131072-4      40.0µs ± 4%    39.9µs ± 4%     ~     (p=1.000 n=9+8)
Splice/tcp-to-tcp/262144-4      69.1µs ± 3%    67.9µs ± 2%   -1.67%  (p=0.010 n=9+10)
Splice/tcp-to-tcp/524288-4       128µs ± 3%     124µs ± 2%   -2.67%  (p=0.001 n=9+10)
Splice/tcp-to-tcp/1048576-4      242µs ± 3%     242µs ± 2%     ~     (p=0.912 n=10+10)
Splice/unix-to-tcp/1024-4       1.97µs ± 3%    1.96µs ± 2%     ~     (p=0.342 n=10+10)
Splice/unix-to-tcp/2048-4       2.19µs ± 2%    2.21µs ± 2%     ~     (p=0.150 n=9+10)
Splice/unix-to-tcp/4096-4       2.52µs ± 5%    2.50µs ± 1%     ~     (p=0.393 n=10+10)
Splice/unix-to-tcp/8192-4       3.27µs ± 4%    3.24µs ± 7%     ~     (p=0.968 n=9+10)
Splice/unix-to-tcp/16384-4      4.68µs ± 9%    4.79µs ± 8%     ~     (p=0.739 n=10+10)
Splice/unix-to-tcp/32768-4      7.82µs ±12%    7.76µs ±12%     ~     (p=0.912 n=10+10)
Splice/unix-to-tcp/65536-4      17.9µs ± 3%    17.3µs ±10%     ~     (p=0.661 n=9+10)
Splice/unix-to-tcp/131072-4     35.9µs ± 1%    31.3µs ± 4%  -12.88%  (p=0.000 n=10+9)
Splice/unix-to-tcp/262144-4     72.4µs ± 3%    55.4µs ± 2%  -23.55%  (p=0.000 n=10+10)
Splice/unix-to-tcp/524288-4      146µs ± 3%     113µs ± 1%  -22.87%  (p=0.000 n=9+9)
Splice/unix-to-tcp/1048576-4     288µs ± 3%     223µs ± 3%  -22.49%  (p=0.000 n=10+9)

name                          old speed      new speed      delta
Splice/tcp-to-tcp/1024-4       198MB/s ± 1%   198MB/s ± 4%     ~     (p=0.481 n=10+10)
Splice/tcp-to-tcp/2048-4       375MB/s ± 2%   374MB/s ± 2%     ~     (p=0.631 n=10+10)
Splice/tcp-to-tcp/4096-4       674MB/s ± 3%   673MB/s ± 5%     ~     (p=0.912 n=10+10)
Splice/tcp-to-tcp/8192-4      1.16GB/s ± 6%  1.15GB/s ± 3%     ~     (p=0.315 n=10+10)
Splice/tcp-to-tcp/16384-4     1.86GB/s ±10%  1.84GB/s ±13%     ~     (p=0.720 n=10+9)
Splice/tcp-to-tcp/32768-4     2.68GB/s ±13%  2.57GB/s ± 7%     ~     (p=0.165 n=10+10)
Splice/tcp-to-tcp/65536-4     2.97GB/s ± 3%  2.98GB/s ± 3%     ~     (p=0.912 n=10+10)
Splice/tcp-to-tcp/131072-4    3.28GB/s ± 4%  3.29GB/s ± 4%     ~     (p=1.000 n=9+8)
Splice/tcp-to-tcp/262144-4    3.80GB/s ± 3%  3.86GB/s ± 2%   +1.70%  (p=0.010 n=9+10)
Splice/tcp-to-tcp/524288-4    4.10GB/s ± 3%  4.21GB/s ± 2%   +2.74%  (p=0.001 n=9+10)
Splice/tcp-to-tcp/1048576-4   4.34GB/s ± 3%  4.33GB/s ± 2%     ~     (p=0.912 n=10+10)
Splice/unix-to-tcp/1024-4      519MB/s ± 3%   523MB/s ± 2%     ~     (p=0.353 n=10+10)
Splice/unix-to-tcp/2048-4      934MB/s ± 2%   926MB/s ± 2%     ~     (p=0.156 n=9+10)
Splice/unix-to-tcp/4096-4     1.63GB/s ± 5%  1.64GB/s ± 1%     ~     (p=0.393 n=10+10)
Splice/unix-to-tcp/8192-4     2.51GB/s ± 3%  2.53GB/s ± 7%     ~     (p=0.968 n=9+10)
Splice/unix-to-tcp/16384-4    3.52GB/s ± 8%  3.43GB/s ± 8%     ~     (p=0.739 n=10+10)
Splice/unix-to-tcp/32768-4    4.21GB/s ±14%  4.24GB/s ±13%     ~     (p=0.912 n=10+10)
Splice/unix-to-tcp/65536-4    3.65GB/s ± 5%  3.81GB/s ±11%     ~     (p=0.436 n=10+10)
Splice/unix-to-tcp/131072-4   3.65GB/s ± 1%  4.19GB/s ± 4%  +14.81%  (p=0.000 n=10+9)
Splice/unix-to-tcp/262144-4   3.62GB/s ± 3%  4.73GB/s ± 2%  +30.78%  (p=0.000 n=10+10)
Splice/unix-to-tcp/524288-4   3.59GB/s ± 3%  4.66GB/s ± 1%  +29.64%  (p=0.000 n=9+9)
Splice/unix-to-tcp/1048576-4  3.65GB/s ± 3%  4.70GB/s ± 3%  +29.01%  (p=0.000 n=10+9)

name                          old alloc/op   new alloc/op   delta
Splice/tcp-to-tcp/1024-4         0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/2048-4         0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/4096-4         0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/8192-4         0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/16384-4        0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/32768-4        0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/65536-4        0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/131072-4       0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/262144-4       0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/524288-4       0.00B          0.00B          ~     (all equal)
Splice/tcp-to-tcp/1048576-4      0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/1024-4        0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/2048-4        0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/4096-4        0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/8192-4        0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/16384-4       0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/32768-4       0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/65536-4       0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/131072-4      0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/262144-4      0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/524288-4      0.00B          0.00B          ~     (all equal)
Splice/unix-to-tcp/1048576-4     0.00B          0.00B          ~     (all equal)

name                          old allocs/op  new allocs/op  delta
Splice/tcp-to-tcp/1024-4          0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/2048-4          0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/4096-4          0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/8192-4          0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/16384-4         0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/32768-4         0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/65536-4         0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/131072-4        0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/262144-4        0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/524288-4        0.00           0.00          ~     (all equal)
Splice/tcp-to-tcp/1048576-4       0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/1024-4         0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/2048-4         0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/4096-4         0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/8192-4         0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/16384-4        0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/32768-4        0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/65536-4        0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/131072-4       0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/262144-4       0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/524288-4       0.00           0.00          ~     (all equal)
Splice/unix-to-tcp/1048576-4      0.00           0.00          ~     (all equal)

Change-Id: I899c1fdcb3f7b9997faf2b0d2336016a3f1fd3ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/425051
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-26 17:47:23 +00:00
Cuong Manh Le
a52f4952cb runtime: remove gcCPULimiterState padding for atomic fields alignment
assistTimePool and lastUpdate are now atomic.Int64, so they are
guaranteed to have 64-bit alignment, even on 32-bit platforms.

Change-Id: Ib6062a47c3a92d46d43899e1ae9d119e7f5b8bb0
Reviewed-on: https://go-review.googlesource.com/c/go/+/425460
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-26 17:46:00 +00:00
hopehook
78aef56062 cmd/go/internal/modload: convert atomicLoadPkgFlags.bits to atomic type
Change-Id: I9e59530953439dec6f4524c5a7adc75c98c12b8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/425456
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-08-26 17:45:20 +00:00
hopehook
48ecc152e4 cmd/go/internal/trace: convert traceStarted to atomic type
Change-Id: Ia4214a29775f1178273b9b7dc84c0420bfa968de
Reviewed-on: https://go-review.googlesource.com/c/go/+/425457
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-26 17:44:58 +00:00
Dan Kortschak
297e3de7a1 debug/macho: use saferio to read segment and section data
Avoid allocating large amounts of memory for corrupt input.

No test case because the problem can only happen for invalid data.
Let the fuzzer find cases like this.

Change-Id: Ib09d5fea54aabcb6941e541b42689222fba69632
Reviewed-on: https://go-review.googlesource.com/c/go/+/425303
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Dan Kortschak <dan@kortschak.io>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: hopehook <hopehook@qq.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-26 17:44:36 +00:00
Zeke Lu
6ba2674ddc cmd/go/internal/imports: include ToolTags in the Tags map
This fixes a regression introduced when the "race" mode tag was moved to
the ToolTags field in CL 358539.

Fixes #54468

Change-Id: I107771948a4fe9d743cc13d1c15f324212b08e03
GitHub-Last-Rev: d211e351ef
GitHub-Pull-Request: golang/go#54618
Reviewed-on: https://go-review.googlesource.com/c/go/+/425154
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-26 17:43:59 +00:00
Ludi Rehak
f50e47308d cmd/go/internal/par: change cacheEntry.done type to atomic.Bool
Change-Id: I95c941f83f74d57dfdd2d6803c9059691fb649b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/422176
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: hopehook <hopehook@qq.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
2022-08-26 17:41:34 +00:00
ianwoolf
f1f9e45143 cmd/test2json: add signal handler
Updates #53563

Change-Id: I35a3fd56718e198f68cbf73075a78b2fbc66bd7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/419295
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ryan Schuster <shuey19831@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
2022-08-26 17:38:40 +00:00
Joe Tsai
bc1d0d8eb1 reflect: add Value.SetZero
The v.SetZero method is a faster equivalent of v.Set(Zero(v.Type())).

Performance:

	                     Direct         CachedZero     NewZero
	SetZero/Bool         2.20ns ± 0%    8.97ns ± 5%    11.4ns ± 1%
	SetZero/Int          3.08ns ± 1%    9.06ns ± 1%    11.5ns ± 0%
	SetZero/Uint         2.88ns ± 1%    9.04ns ± 1%    11.7ns ± 5%
	SetZero/Float        2.65ns ± 2%    9.05ns ± 1%    11.5ns ± 1%
	SetZero/Complex      2.68ns ± 3%    9.31ns ± 1%    11.7ns ± 1%
	SetZero/Array        6.69ns ± 4%    9.32ns ± 1%    11.8ns ± 1%
	SetZero/Chan         3.31ns ± 1%    6.19ns ± 1%    8.20ns ± 1%
	SetZero/Func         3.32ns ± 1%    6.20ns ± 0%    8.24ns ± 1%
	SetZero/Interface    2.66ns ± 1%    9.31ns ± 1%    11.8ns ± 1%
	SetZero/Map          3.31ns ± 1%    6.21ns ± 2%    8.19ns ± 1%
	SetZero/Pointer      3.30ns ± 1%    6.22ns ± 1%    8.17ns ± 1%
	SetZero/Slice        2.90ns ± 4%    9.13ns ± 1%    11.6ns ± 1%
	SetZero/String       3.11ns ± 1%    9.30ns ± 1%    11.8ns ± 2%
	SetZero/Struct       6.37ns ± 1%    9.18ns ± 4%    11.5ns ± 1%

where:

	* Direct is measuring Value.SetZero
	* CachedZero is measuring Value.Set with a cached Zero value
	* NewZero is measuring Value.Set with a new Zero value

Fixes #52376

Change-Id: I793ca723aa97627824c5f5b356b2da30c8e46d71
Reviewed-on: https://go-review.googlesource.com/c/go/+/411476
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Dan Kortschak <dan@kortschak.io>
2022-08-26 17:15:08 +00:00
Andy Pan
e0ec1d6770 runtime: convert forcegcstate.idle to internal atomic type
Note that this changes a few unsynchronized operations of forcegcstate.idle to synchronized operations.

Updates #53821

Change-Id: I041654cc84a188fad45e2df7abce3a434f9a1f15
Reviewed-on: https://go-review.googlesource.com/c/go/+/425361
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-26 16:35:29 +00:00
hopehook
951d2c657d runtime: convert g.selectDone to atomic type
On the write side, g.selectDone has been converted
from non-atomic to atomic access.

For #53821.

Change-Id: Iac46bc6acce7eed51dfd990285dd57f0d58b4ae2
Reviewed-on: https://go-review.googlesource.com/c/go/+/425414
Run-TryBot: hopehook <hopehook@qq.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-26 15:36:36 +00:00
hopehook
7a1ae605eb runtime: convert notifyList.wait to atomic type
For #53821

Change-Id: Ib096332fe6111bbcd2f5c4cbb29c2fef7a808e7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/425784
Run-TryBot: hopehook <hopehook@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-08-26 15:36:07 +00:00
hopehook
2af9ee0727 runtime: convert dlogger.owned to atomic type
Note that this changes a non-atomic operation to atomic operation.

For #53821

Change-Id: I798914f505c8d7f85f9d7629fdc6493363a20aa1
Reviewed-on: https://go-review.googlesource.com/c/go/+/425782
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: hopehook <hopehook@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-26 15:35:46 +00:00
hopehook
2883af63c2 runtime: convert p.statsSeq to internal atomic type
For #53821.

Change-Id: I1cab3671a29c218b8a927aba9064e63b65900173
Reviewed-on: https://go-review.googlesource.com/c/go/+/425416
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: hopehook <hopehook@qq.com>
2022-08-26 15:35:13 +00:00
Cherry Mui
1211a62bdc cmd/compile: align stack offset to alignment larger than PtrSize
In typebits.Set we check that the offset is a multiple of the
alignment, which makes perfect sense. But for values like
atomic.Int64, which has 8-byte alignment even on 32-bit platforms
(i.e. the alignment is larger than PtrSize), if it is on stack it
may be under-aligned, as the stack frame is only PtrSize aligned.

Normally we would prevent such values on stack, as the escape
analysis force values with higher alignment to heap. But for a
composite literal assignment like x = AlignedType{...}, the
compiler creates an autotmp for the RHS then copies it to the LHS.
The autotmp is on stack and may be under-aligned. Currently this
may cause an ICE in the typebits.Set check.

This CL makes it align the _offset_ of the autotmp to 8 bytes,
which satisfies the check. Note that this is actually lying: the
actual address at run time may not necessarily be 8-byte
aligned as we only align SP to 4 bytes.

The under-alignment is probably okay. The only purpose for the
autotmp is to copy the value to the LHS, and the copying code we
generate (at least currently) doesn't care the alignment beyond
stack alignment.

Fixes #54638.

Change-Id: I13c16afde2eea017479ff11dfc24092bcb8aba6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/425256
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-26 15:24:31 +00:00
cuiweixie
d7a3fa120d reflect: FuncOf support more than 50 arguments
Fixes #54669

Change-Id: I34cbe729d187437ddeafbaa910af6ed001b2603f
Reviewed-on: https://go-review.googlesource.com/c/go/+/425461
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-26 14:32:13 +00:00
Robert Griesemer
2eba2ff8a1 go/types: provide a better error message for [...] array types
This matches types2 behavior.

For #54511.

Change-Id: Iea906e9fec7e334b7aa7f481de87373fa93d1c7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/425715
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-26 03:34:25 +00:00
Robert Griesemer
27006657fa go/types: avoid declared but not used error for a couple of cases
The change in typexpr.go matches types2 behavior.

For #54511.

Change-Id: I79c922a94f2ee0440c1814140935c321439c7d25
Reviewed-on: https://go-review.googlesource.com/c/go/+/425714
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2022-08-26 03:34:24 +00:00
Andy Pan
aab8d2b448 runtime: convert netpollWaiters to internal atomic type
Updates #53821

Change-Id: I8776382b3eb0b7752cfc0d9287b707039d3f05c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/425358
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: hopehook <hopehook@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-08-25 21:52:20 +00:00
Robert Griesemer
73a55c1704 go/types: remove support for "ERROR HERE" error markers in tests
There are only two tests that rely on the "ERROR HERE" markers;
yet those tests are trivialy adjustable (by adding an explicit
semicolon) such that they can just use the "ERROR" markers.

For #54511.

Change-Id: Idbb96ca8d35ae2584d195a4ac7c92640b8b492c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/425674
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2022-08-25 21:07:24 +00:00
hitzhangjie
04eb35998a cmd/trace: display goroutines (PC=0) with clearer description
This PR fixes: #54425 #49994

Change-Id: Id60a3ba6930f8e29b12b6d8f80945decd2ce31bc
GitHub-Last-Rev: 60a040aa2f
GitHub-Pull-Request: golang/go#54575
Reviewed-on: https://go-review.googlesource.com/c/go/+/425042
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-25 20:44:19 +00:00
Michael Anthony Knyszek
56bdf7f7d9 runtime: update gctrace docs and print lastStackScan instead of max
This change updates the gctrace docs to include stacks and globals in
the format line, and prints lastStackScan for "# MB stacks" instead of
maxStackScan, which is more accurate.

Fixes #54649.

Change-Id: Ibff2c390c9c9bf2b24b5b4e98ca346cc98d7cb2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/425366
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-25 20:37:28 +00:00
Filippo Valsorda
f64f12f0b3 crypto/x509: don't panic marshaling invalid ECDSA keys
MarshalPKIXPublicKey, CreateCertificate, CreateCertificateRequest,
MarshalECPrivateKey, and MarshalPKCS8PrivateKey started raising a panic
when encoding an invalid ECDSA key in Go 1.19. Since they have an error
return value, they should return an error instead.

Fixes #54288

Change-Id: Iba132cd2f890ece36bb7d0396eb9a9a77bdb81df
Reviewed-on: https://go-review.googlesource.com/c/go/+/422298
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-25 19:17:14 +00:00
Robert Griesemer
b9bf824655 go/parser: match go/defer error message of syntax package
Adjust corresponding type checker tests accordingly.

For #54511.

Change-Id: Ieaf29f26c0877973fc0acbde35292cd69a4b709c
Reviewed-on: https://go-review.googlesource.com/c/go/+/425007
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-25 19:10:01 +00:00
Paschalis Tsilias
95a786da12 path/filepath, io/fs: add SkipAll
Fixes #47209

Change-Id: If75b0dd38f2c30a23517205d80c7a6683a5c921c
Reviewed-on: https://go-review.googlesource.com/c/go/+/363814
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-08-25 18:50:37 +00:00
Matthew Dempsky
6a801d3082 cmd/compile/internal/noder: fix inlined function literal positions
When inlining function calls, we rewrite the position information on
all of the nodes to keep track of the inlining context. This is
necessary so that at runtime, we can synthesize additional stack
frames so that the inlining is transparent to the user.

However, for function literals, we *don't* want to apply this
rewriting to the underlying function. Because within the function
literal (when it's not itself inlined), the inlining context (if any)
will have already be available at the caller PC instead.

Unified IR was already getting this right in the case of user-written
statements within the function literal, which is what the unit test
for #46234 tested. However, it was still using inline-adjusted
positions for the function declaration and its parameters, which
occasionally end up getting used for generated code (e.g., loading
captured values from the closure record).

I've manually verified that this fixes the hang in
https://go.dev/play/p/avQ0qgRzOgt, and spot-checked the
-d=pctab=pctoinline output for kube-apiserver and kubelet and they
seem better.

However, I'm still working on a more robust test for this (hence
"Updates" not "Fixes") and internal assertions to verify that we're
emitting correct inline trees. In particular, there are still other
cases (even in the non-unified frontend) where we're producing
corrupt (but at least acyclic) inline trees.

Updates #54625.

Change-Id: Iacfd2e1eb06ae8dc299c0679f377461d3d46c15a
Reviewed-on: https://go-review.googlesource.com/c/go/+/425395
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-25 18:46:22 +00:00
hopehook
396b153ec4 testing: add Elapsed method to testing.B
Elapsed returns the measured elapsed time of the benchmark,
but does not change the running state of the timer.

Fixes #43620.

Change-Id: Idd9f64c4632518eec759d2ffccbf0050d84fcc03
Reviewed-on: https://go-review.googlesource.com/c/go/+/420254
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: hopehook <hopehook@qq.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-08-25 17:58:32 +00:00
Robert Griesemer
83b5fe6351 go/types: match types2 string when printing composite literals
Given a composite literal type S, rather than always printing
(S literal) for a composite literals, print S{} if the literal
has no elements, and print S{…} as a short form (suitable for
error messages) if there are elements. This matches types2 and
also Go1.17 compiler behavior (except that the original compiler
would print ... rather than …). Using … rather than ... makes
it clearer that we don't have real Go syntax, and it's also more
compact.

For #54511.

Change-Id: I5991e8060232f16ecbf4a1fe4ae091598fc76b68
Reviewed-on: https://go-review.googlesource.com/c/go/+/425006
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2022-08-25 17:31:33 +00:00