Cherry Mui [Wed, 18 May 2022 19:15:33 +0000 (15:15 -0400)]
runtime: relax the threshold for TestPingPongHog
The test checks that the scheduling of the goroutines are within
a small factor, to ensure the scheduler handing off the P
correctly. There have been flaky failures on the builder (probably
due to OS scheduling delays). Increase the threshold to make it
less flaky. The gap would be much bigger if the scheduler doesn't
work correctly.
For the long term maybe it is better to test it more directly
with the scheduler, e.g. with scheduler instrumentation.
May fix #52207.
Change-Id: I50278b70ab21b7f04761fdc8b38dd13304c67879
Reviewed-on: https://go-review.googlesource.com/c/go/+/407134
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Tatiana Bradley [Thu, 12 May 2022 18:58:29 +0000 (14:58 -0400)]
crypto/tls: randomly generate ticket_age_add
As required by RFC 8446, section 4.6.1, ticket_age_add now holds a
random 32-bit value. Before this change, this value was always set
to 0.
This change also documents the reasoning for always setting
ticket_nonce to 0. The value ticket_nonce must be unique per
connection, but we only ever send one ticket per connection.
Volker dobler [Thu, 10 Jun 2021 09:54:58 +0000 (11:54 +0200)]
net/http/cookiejar: allow cookies with an IP address in the domain attribute
A set domain attribute in a cookie in a Set-Cookie header is intended to
create a domain cookie, i.e. a cookie that is not only sent back to the
domain the Set-Cookie was received from, but to all subdomains thereof
too. Sometimes people set this domain attribute to an IP address. This
seems to be allowed by RFC 6265 albeit it's not really sensible as there
are no "subdomains" of an IP address.
Contemporary browsers allow such cookies, currently Jar forbids them.
This CL allows to persist such cookies in the Jar and send them back
again in subsequent requests. Jar allows those cookies that all
contemporary browsers allow (not all browsers behave the same and none
seems to conform to RFC 6265 in regards to these cookies, see below).
The following browsers in current version) were tested:
- Chrome (Mac and Windows)
- Firefox (Mac and Windows)
- Safari (Mac)
- Opera (Mac)
- Edge (Windows)
- Internet Explorer (Windows)
- curl (Mac, Linux)
All of them allow a cookie to be set via the following HTTP header if
the request was made to e.g. http://35.206.97.83/ :
Set-Cookie: a=1; domain=35.206.97.83
They differ in handling a leading dot "." before the IP address as in
Set-Cookie: a=1; domain=.35.206.97.83
sets a=1 only in curl and in Internet Explorer, the other browsers just
reject such cookies.
As far as these internals can be observed the browsers do not treat such
cookies as domain cookies but as host cookies. RFC 6265 would require to
treat them as domain cookies; this is a) nonsensical and b) doesn't make
an observable difference. As we do not expose Jar entries and their
HostOnly flag it probably is still okay to claim that Jar implements a
RFC 6265 cookie jar.
RFC 6265 would allow cookies with dot-prefixed domains like
domain=.35.206.97.83 but it seems as if this feature of RFC 6265 is not
used in real life and not requested by users of package cookiejar (probably
because it doesn't work in browsers) so we refrain from documenting this
detail.
Fixes #12610
Change-Id: Ibd883d85bde6b958b732cbc3618a1238ac4fc84a
Reviewed-on: https://go-review.googlesource.com/c/go/+/326689
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Damien Neil <dneil@google.com>
Cherry Mui [Wed, 18 May 2022 16:50:49 +0000 (12:50 -0400)]
cmd/compile/internal/test: make TestIntendedInlining faster
There is no need to build with -a. The go command should do the
right thing to pass the flags. Also, we only care packages
mentioned on the command line, so no need to add -gcflags=all=....
May fix #52081.
Change-Id: Idabcfe285c90ed5d25ea6d42abd7617078d3283a
Reviewed-on: https://go-review.googlesource.com/c/go/+/407015 Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
When running TestHostname, the location of the hostname binary
is hardcoded as /bin/hostname. However, on some systems the actual
location is /usr/bin/hostname.
Change this behaviour to perform a lookup for hostname in PATH,
and skip the test when it cannot be found there.
Fixes #52402
Change-Id: I5418bf77258f5ffb2a9f834b8c68d8a7b7a452d7
GitHub-Last-Rev: 750f36fcf9d4b26b75e91b895d6f7c6a275536ee
GitHub-Pull-Request: golang/go#52403
Reviewed-on: https://go-review.googlesource.com/c/go/+/400794
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Carlo Alberto Ferraris [Thu, 21 Apr 2022 08:49:12 +0000 (17:49 +0900)]
reflect: deprecate (Slice|String)Header
As discussed in CL 401434 there are substantial misuses of these in the
wild, and they are a potential source of unsafety even for code that
does not use them directly.
We should either keep them as-is and document when/how they can be used
safely, or deprecate them so that uses will eventually die out.
After some discussion, it was decided to deprecate them outright.
Since the docs already mentioned that they may be unstable across
releases, it should be possible to get rid of them completely later on.
Change-Id: I3b75819409177b5a286c1e9861a2edb6fd1301b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/401434
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: 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>
John Bampton [Tue, 17 May 2022 23:37:44 +0000 (23:37 +0000)]
all: fix spelling
Change-Id: I63eb42f3ce5ca452279120a5b33518f4ce16be45
GitHub-Last-Rev: a88f2f72bef402344582ae997a4907457002b5df
GitHub-Pull-Request: golang/go#52951
Reviewed-on: https://go-review.googlesource.com/c/go/+/406843
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Cherry Mui [Tue, 17 May 2022 21:52:43 +0000 (17:52 -0400)]
runtime: deflake TestCgoPprofThread
In TestCgoPprofThread, the (fake) cgo traceback function pretends
all C CPU samples are in cpuHogThread. But if a profiling signal
lands in C code but outside of that thread, e.g. before/when the
thread is created, we will get a sample which looks like Go calls
into cpuHogThread. This CL makes the cgo traceback function only
return cpuHogThread PCs when a signal lands on that thread.
May fix #52726.
Change-Id: I21c40f974d1882508626faf3ac45e8347fec31c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/406934
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Tobias Klauser [Tue, 17 May 2022 22:08:49 +0000 (00:08 +0200)]
net/netip: fix type name in z0, z4, z6noz comment
This was copied from the respective comment in package inet.af/netaddr
where the type is named IP. In net/netip the type is named Addr. Adjust
the comment accordingly.
Change-Id: Ib2d1667e6b8f474b3589dea0b37d5e05e58f2e05
Reviewed-on: https://go-review.googlesource.com/c/go/+/406755 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Matthew Dempsky [Tue, 17 May 2022 22:26:18 +0000 (15:26 -0700)]
cmd/compile/internal/noder: remove TODO about position handling
types2 uses nopos as the position for predeclared objects, so it's
expected that we'll see !pos.IsKnown() when translating types2
representations into IR.
Change-Id: I8708c2e9815e3dd27da8066c67c73f5586ac4617
Reviewed-on: https://go-review.googlesource.com/c/go/+/406896
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
John Bampton [Tue, 17 May 2022 21:25:43 +0000 (21:25 +0000)]
all: fix spelling
Change-Id: Iee18987c495d1d4bde9da888d454eea8079d3ebc
GitHub-Last-Rev: ff5e01599ddf7deb3ab6ce190ba92eb02ae2cb15
GitHub-Pull-Request: golang/go#52949
Reviewed-on: https://go-review.googlesource.com/c/go/+/406915
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: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Robert Findley [Thu, 24 Mar 2022 16:41:25 +0000 (12:41 -0400)]
go/types, types2: set an origin object for vars and funcs
Historically, Objects in go/types were canonical, meaning each entity
was represented by exactly one variable and could thus be identified by
its address. With object instantiation this is no longer the case: Var
and Func objects must be copied to hold substituted type information,
and there may be more than one Var or Func variable representing the
same source-level entity.
This CL adds Origin methods to *Var and *Func, so users can efficiently
navigate to the corresponding canonical object on the generic type.
Fixes #51682
Change-Id: Ia49e15bd6515e1db1eb3b09b88ba666659601316
Reviewed-on: https://go-review.googlesource.com/c/go/+/395535 Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Bryan C. Mills [Tue, 17 May 2022 20:26:49 +0000 (16:26 -0400)]
vendor: revert stray edit from CL 406835
In reviewing CL 406835, I missed that one of the edited files was in
src/vendor. This change reverts that file, fixing the failing
moddeps test on the longtest builders.
Xiaodong Liu [Wed, 1 Dec 2021 07:48:53 +0000 (15:48 +0800)]
runtime: load/save TLS variable g 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: I5e09759ce9201596e89a01fc4a6f7fd7e205449f
Reviewed-on: https://go-review.googlesource.com/c/go/+/368074 Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@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>
John Bampton [Tue, 17 May 2022 19:29:03 +0000 (19:29 +0000)]
runtime: fix code span element
Change-Id: I99c593573b3bec560ab3af49ac2f486ee442ee1c
GitHub-Last-Rev: e399ec50f9dde9229e05f801fd752694cc661822
GitHub-Pull-Request: golang/go#52946
Reviewed-on: https://go-review.googlesource.com/c/go/+/406837
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Xiaodong Liu [Mon, 15 Nov 2021 12:59:24 +0000 (20:59 +0800)]
internal/syscall/unix: loong64 use generic syscall
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: I5988bf3efed37b03b9193f1089dfece060ccba99
Reviewed-on: https://go-review.googlesource.com/c/go/+/363934
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Xiaodong Liu [Sun, 15 Aug 2021 08:31:52 +0000 (16:31 +0800)]
internal/bytealg: support basic byte 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: I4ac6d38dc632abfa0b698325ca0ae349c0d7ecd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/342316 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Tobias Klauser [Tue, 17 May 2022 06:13:47 +0000 (08:13 +0200)]
compress/flate: remove var newH
After CL 404696 hewH is no longer used outide the loop and val can be
used inside the loop instead. This leads to another slight improvement
in some benchmarks (only non-zero results reported):
Xiaodong Liu [Mon, 15 Nov 2021 12:53:47 +0000 (20:53 +0800)]
internal/{cpu, goarch}: add constant definition 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: I39d42e5959391e47bf621b3bdd3d95de72f023cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/342318 Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Rob Pike [Sun, 15 May 2022 00:11:56 +0000 (10:11 +1000)]
fmt: add Append, Appendln, Appendf
These are straightforward variants of the existing Sprintf etc.,
but append the resulting bytes to a provided buffer rather than
returning a string.
Internally, there is potentially some allocation because the package
uses a pool of buffers to build its output. We make no attempt to
override that, so the result is first printed into the pool and
then copied to the output. Since it is a managed pool, asymptotically
there should be no extra allocation.
Fixes #47579
RELNOTE=yes
Change-Id: Icef797f9b6f0c84d03e7035d95c06cdb819e2649
Reviewed-on: https://go-review.googlesource.com/c/go/+/406177 Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Xiaodong Liu [Sun, 15 Aug 2021 09:06:29 +0000 (17:06 +0800)]
cmd/nm, cmd/objdump, cmd/pprof: disassembly is not supported 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: Ic96e4f0c46d9a6b8cd020e899f32c40681daf9c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/342323
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Cuong Manh Le [Tue, 17 May 2022 08:38:35 +0000 (15:38 +0700)]
test,misc: fix builders that do not support plugin
CL 406358 added test that use -buildmode=plugin. But plugin mode only
supports on some os/arch pairs, so this CL moving the test to
misc/cgo/testplugin directory instead.
Updates #52937
Change-Id: Iad049443c1f6539f6af1988bebd4dff56c6e1bf9
Reviewed-on: https://go-review.googlesource.com/c/go/+/406774 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Xiaodong Liu [Sun, 15 Aug 2021 08:25:46 +0000 (16:25 +0800)]
cmd/link: support linker for linux/loong64
The basic arch-specific hooks are implemented, which
are used for internal and external linker.
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: I4680eb0635dd0fa3d6ea8348a2488da9c7e33d3b
Reviewed-on: https://go-review.googlesource.com/c/go/+/349514 Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Kévin Dunglas [Tue, 17 May 2022 16:05:20 +0000 (16:05 +0000)]
net/http: allow sending 1xx responses
Currently, it's not possible to send informational responses such as
103 Early Hints or 102 Processing.
This patch allows calling WriteHeader() multiple times in order
to send informational responses before the final one.
If the status code is in the 1xx range, the current content of the header map
is also sent. Its content is not removed after the call to WriteHeader()
because the headers must also be included in the final response.
The Chrome and Fastly teams are starting a large-scale experiment to measure
the real-life impact of the 103 status code.
Using Early Hints is proposed as a (partial) alternative to Server Push,
which are going to be removed from Chrome:
https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/21anpFhxAQAJ
Being able to send this status code from servers implemented using Go would
help to see if implementing it in browsers is worth it.
Fixes #26089
Fixes #36734
Updates #26088
Change-Id: Ib7023c1892c35e8915d4305dd7f6373dbd00a19d
GitHub-Last-Rev: 06d749d3454aa35c177a50ce4a25715df21fd742
GitHub-Pull-Request: golang/go#42597
Reviewed-on: https://go-review.googlesource.com/c/go/+/269997 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
hopehook [Tue, 10 May 2022 04:30:43 +0000 (12:30 +0800)]
time: add Time.ZoneBounds
The method Location.lookup returns the "start" and "end" times bracketing seconds when that zone is in effect.
This CL does these things:
1. Exported the "start" and "end" times as time.Time form
2. Keep the "Location" of the returned times be the same as underlying time
Fixes #50062.
Change-Id: I88888a100d0fc68f4984a85c75a85a83aa3e5d80
Reviewed-on: https://go-review.googlesource.com/c/go/+/405374
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Cuong Manh Le [Sun, 15 May 2022 01:05:41 +0000 (08:05 +0700)]
cmd/compile: tighten the condition for inlining shape/non-shape function
CL 395854 made inline pass to not inlining function with shape params,
but pass no shape arguments. This is intended to be the reverse case of
CL 361260.
However, CL 361260 is using wider condition than necessary. Though it
only needs to check against function parameters, it checks whether the
function type has no shape. It does not cause any issue, because
!fn.Type().HasShape() implies !fn.Type().Params().HasShape().
But for the reverse case, it's not true. Function may have shape type,
but has no shape arguments. Thus, we must tighten the condition to
explicitly check against the function parameters only.
Fixes #52907
Change-Id: Ib87e87ff767c31d99d5b36aa4a6c1d8baf32746d
Reviewed-on: https://go-review.googlesource.com/c/go/+/406475
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Matthew Dempsky [Tue, 17 May 2022 00:03:59 +0000 (17:03 -0700)]
cmd/compile: skip exporting generic functions for -buildmode=plugin
Generic functions require instantiation, which package plugin doesn't
support, and likely never will. So instead, we can just skip writing
out any generic functions, which avoids an ICE in the plugin
generation code.
This issue doesn't affect GOEXPERIMENT=unified, because it avoids
leaking any non-instantiated types/functions to the rest of the
compiler backend.
Fixes #52937.
Change-Id: Ie35529c5c241e46b77fcb5b8cca48bb99ce7bfcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/406358
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Matthew Dempsky [Fri, 18 Mar 2022 02:50:47 +0000 (19:50 -0700)]
cmd/compile/internal/types: use Type.LinkString in TypeHash
Now that Type.LinkString always returns a fully unique string ID, we
can use it in TypeHash to avoid collisions between instantiations of
the same generic type.
Updates #51734.
Change-Id: I38cb396c88259be7afa44bd4333124ca98666c3f
Reviewed-on: https://go-review.googlesource.com/c/go/+/393716 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Dmitri Shuralyov [Mon, 16 May 2022 21:53:36 +0000 (17:53 -0400)]
all: update vendored golang.org/x dependencies for Go 1.19 release
The Go 1.19 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.
This CL updates the rest of the modules with x/build/cmd/updatestd.
For #36905.
Change-Id: I4751ca477365b036a8e5ad6a9256293b44ddcd2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/406356 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Dmitri Shuralyov [Mon, 16 May 2022 21:49:01 +0000 (17:49 -0400)]
all: update vendored golang.org/x/{arch,sys,term} for Go 1.19 release
The Go 1.19 code freeze has recently started. This is a time to update
all golang.org/x/... module versions that contribute packages to the
std and cmd modules in the standard library to latest master versions.
This CL updates only the lower-level modules arch, sys, term for better
bisection. The next CL will update further ones.
For #36905.
Change-Id: I15f6f8b015f8e425571f4f072d6942c806c6ec3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/406355 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Rob Pike [Sun, 15 May 2022 03:14:49 +0000 (13:14 +1000)]
text/template/parse: make atTerminator more efficient
The change https://go.dev/cl/398475 was too complicated and expensive.
Since the whole string is always available, all that's needed
is a call to strings.HasPrefix.
While we're here, change the way lexer.backup works
so it can be called repeatedly to back up more than one
rune, in case that becomes necessary. This change also
requires less state to maintain, as lexer.width was only
there for backup, and prevented multiple steps.
Fixes #52191
Change-Id: I43b64fc66edeb8ba73ba5aa72f3b727c377dc067
Reviewed-on: https://go-review.googlesource.com/c/go/+/406476 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Matthew Dempsky [Thu, 12 May 2022 22:43:48 +0000 (15:43 -0700)]
cmd/compile/internal/typecheck: remove "name" handling in iimport.go
This hack is no longer needed since CL 393715, because LocalPkg.Prefix
is set correctly, so when we write out instantiated objects/types into
the export data, they'll already have a proper name.
Updates #51734.
Change-Id: I26cfa522f1bfdfd162685509757f51093b8b92e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/406318
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Historically, the compiler set types.LocalPkg.Path to "", so a lot of
compiler code checks for this, and then falls back to using
base.Ctxt.Pkgpath instead.
Since CL 393715, we now initialize types.LocalPkg.Path to
base.Ctxt.Pkgpath, so these code paths can now simply rely on Pkg.Path
always being meaningful.
Updates #51734.
Change-Id: I0aedbd7cf8e14edbfef781106a9510344d468f2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/406317
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Matthew Dempsky [Mon, 16 May 2022 19:14:14 +0000 (12:14 -0700)]
test: fix issue20014 for noopt builder
This test is currently overly sensitive to compiler optimizations,
because inlining can affect the order in which cmd/link emits field
references. The order doesn't actually matter though, so this CL just
tweaks the test to sort the tracked fields before printing them.
Updates #51734.
Change-Id: I3b65ca265856b2e1102f40406d5ce34610c70d40
Reviewed-on: https://go-review.googlesource.com/c/go/+/406674
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Rhys Hiltner [Mon, 16 May 2022 16:47:08 +0000 (09:47 -0700)]
runtime/pprof: slow new goroutine launches in test
The goroutine profiler tests include one that launches a steady stream
of goroutines. That creates a scheduler busy loop that can prevent
forward progress in the rest of the program. Slow down the launches a
bit so other goroutines have a chance to run.
Matthew Dempsky [Thu, 17 Mar 2022 20:27:40 +0000 (13:27 -0700)]
cmd/compile: set LocalPkg.Path to -p flag
Since CL 391014, cmd/compile now requires the -p flag to be set the
build system. This CL changes it to initialize LocalPkg.Path to the
provided path, rather than relying on writing out `"".` into object
files and expecting cmd/link to substitute them.
However, this actually involved a rather long tail of fixes. Many have
already been submitted, but a few notable ones that have to land
simultaneously with changing LocalPkg:
1. When compiling package runtime, there are really two "runtime"
packages: types.LocalPkg (the source package itself) and
ir.Pkgs.Runtime (the compiler's internal representation, for synthetic
references). Previously, these ended up creating separate link
symbols (`"".xxx` and `runtime.xxx`, respectively), but now they both
end up as `runtime.xxx`, which causes lsym collisions (notably
inittask and funcsyms).
2. test/codegen tests need to be updated to expect symbols to be named
`command-line-arguments.xxx` rather than `"".foo`.
3. The issue20014 test case is sensitive to the sort order of field
tracking symbols. In particular, the local package now sorts to its
natural place in the list, rather than to the front.
Thanks to David Chase for helping track down all of the fixes needed
for this CL.
Updates #51734.
Change-Id: Iba3041cf7ad967d18c6e17922fa06ba11798b565
Reviewed-on: https://go-review.googlesource.com/c/go/+/393715 Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Bryan C. Mills [Mon, 16 May 2022 15:41:12 +0000 (11:41 -0400)]
runtime/pprof: eliminate arbitrary deadline in testCPUProfile
The testCPUProfile helper function iterates until the profile contains
enough samples. However, in general very slow builders may need longer
to complete tests, and may have less-responsive schedulers (leading to
longer durations required to collect profiles with enough samples).
To compensate, slower builders generally run tests with longer timeouts.
Since this test helper already dynamically scales the profile duration
based on the collected samples, allow it to continue to retry and
rescale until it would exceed the test's deadline.
Matthew Dempsky [Sat, 14 May 2022 00:00:00 +0000 (17:00 -0700)]
go/importer: disable TestForCompiler/LookupCustom for GOEXPERIMENT=unified
The TestForCompiler/LookupCustom test tries to read in the export data
for "math/big", but with a package path of "math/bigger" instead. This
has historically worked because the export data formats were designed
to not assume the package's own path, but I expect we can safely
remove support for this now.
However, since that would be a user-visible change, for now just
disable the test for GOEXPERIMENT=unified so we can land CL 393715. We
can revisit whether it's actually safe to break that go/importer use
case later.
Updates #51734.
Change-Id: I5e89314511bd1352a9f5e14a2e218a5ab00cab3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/406319
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Matthew Dempsky [Fri, 13 May 2022 23:06:53 +0000 (16:06 -0700)]
runtime: mark panicshift and panicdivide as //go:yeswritebarrierrec
When compiling package runtime, cmd/compile logically has two copies
of package runtime: the actual source files being compiled, and the
internal description used for emitting compiler-generated calls.
Notably, CL 393715 will cause the compiler's write barrier validation
to start recognizing that compiler-generated calls are actually calls
to the corresponding functions from the source package. And today,
there are some code paths in nowritebarrierrec code paths that
actually end up generating code to call panicshift or panicdivide.
In preparation, this CL marks those functions as
//go:yeswritebarrierrec. We probably want to actually cleanup those
code paths to avoid these calls actually (e.g., explicitly convert
shift count expressions to an unsigned integer type). But for now,
this at least unblocks CL 393715 while preserving the status quo.
Updates #51734.
Change-Id: I01f89adb72466c0260a9cd363e3e09246e39cff9
Reviewed-on: https://go-review.googlesource.com/c/go/+/406316 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Xiaodong Liu [Sun, 15 Aug 2021 07:25:14 +0000 (15:25 +0800)]
cmd/asm/internal: assembler end-to-end test 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: I93d8be36e44e516df70b25e20d9c0695a05510d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/349510 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>
Cuong Manh Le [Sat, 14 May 2022 09:15:26 +0000 (16:15 +0700)]
cmd/compile: fix inlining function has shape in type
CL 395854 made inline pass to not inlining function with shape params,
but pass no shape arguments. But it does not consider the case where
function has shape params, but passing zero arguments. In this case, the
un-safe interface conversion that may be applied to a shape argument can
not happen, so it's safe to inline the function.
Fixes #52907
Change-Id: Ifa7b23709bb47b97e27dc1bf32343d92683ef783
Reviewed-on: https://go-review.googlesource.com/c/go/+/406176
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
hopehook [Wed, 11 May 2022 14:42:00 +0000 (22:42 +0800)]
encoding/csv: add Reader.InputOffset method
Fixes #43401.
Change-Id: I2498e77e41d845130d95012bc8623bfb29c0dda1
Reviewed-on: https://go-review.googlesource.com/c/go/+/405675
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Cuong Manh Le [Fri, 25 Mar 2022 16:29:44 +0000 (23:29 +0700)]
cmd/compile: don't inline fn with shape params, but passed no shape arg
This is the same fix as CL 36126, but for the reverse case, function
with shape params but passed no shape arg. The same conversion problem
may occur in this case, see details explanation there.
Fixes #51909
Fixes #51925
Change-Id: Ib0c1973c7511d85b4918a252c80060f1864180cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/395854
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Jinzhu [Fri, 13 May 2022 23:11:16 +0000 (23:11 +0000)]
database/sql: follow convention for field naming
Change-Id: I161072698dad8f184b46c6e627bbfbcb18a1b5c6
GitHub-Last-Rev: 7c8d2412806e6017e7129a5535adace396e6be30
GitHub-Pull-Request: golang/go#52770
Reviewed-on: https://go-review.googlesource.com/c/go/+/404934 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: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Michael Anthony Knyszek [Fri, 13 May 2022 15:30:03 +0000 (15:30 +0000)]
runtime: account for idle mark time in the GC CPU limiter
Currently the GC CPU limiter doesn't account for idle application time
at all. This means that the GC could start thrashing, for example if the
live heap exceeds the max heap set by the memory limit, but the limiter
will fail to kick in when there's a lot of available idle time. User
goroutines will still be assisting at a really high rate because of
assist pacing rules, but the GC CPU limiter will fail to kick in because
the actual fraction of GC CPU time will be low if there's a lot of
otherwise idle time (for example, on an overprovisioned system).
Luckily, that idle time is usually eaten up entirely by idle mark
workers, at least during the GC cycle. And in these cases where we're
GCing continuously, that's all of our idle time. So we can take idle
mark work time and subtract it from the mutator time accumulated in the
GC CPU limiter, and that will give us a more accurate picture of how
much CPU is being spent by user goroutines on GC. This will allow the GC
CPU limiter to kick in, and reduce the impact of the thrashing.
There is a corner case here if the idle mark workers are disabled, for
example for the periodic GC, but in the case of the periodic GC, I don't
think it's possible for us to be thrashing at all, so it doesn't really
matter.
Fixes #52890.
Change-Id: Ie133a7d1f89b603434b415d51eb8733c2708a858
Reviewed-on: https://go-review.googlesource.com/c/go/+/405898 Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Xiaodong Liu [Thu, 25 Nov 2021 06:20:39 +0000 (14:20 +0800)]
cmd/compile/internal: fix test error on loong64
For TestLogOpt test case, add loong64 support to test the host
architecture and os.
The Ctz64 is not intrinsified on loong64 for TestIntendedInlining.
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: I42280e89a337dbfde55a01a134820f8ae94f6b47
Reviewed-on: https://go-review.googlesource.com/c/go/+/400237 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>
Matthew Dempsky [Thu, 12 May 2022 22:47:21 +0000 (15:47 -0700)]
cmd/compile/internal/ir: remove PkgFuncName assumption that LocalPkg.Path == ""
Prep refactoring for CL 393715, after which LocalPkg.Path will no
longer be the empty string. Instead of testing `pkg.Path == ""`, we
can just test `pkg == LocalPkg`.
Updates #51734.
Change-Id: I74fff7fb383e275c9f294389d30b2220aced19e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/406059 Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Matthew Dempsky [Tue, 10 May 2022 23:26:41 +0000 (16:26 -0700)]
cmd/compile/internal/types: remove Type.sym and rename Type.nod to Type.obj
Now that Ntype is gone, we no longer require separate sym and nod
fields for Type. It's now always the case that t.sym == t.nod.Sym(),
or that t.sym and t.nod are both nil.
While here, rename nod to obj, to better reflect that in fact it's
always an object (i.e., *ir.Name), not merely a type literal (which no
longer exists in package ir).
Change-Id: Iba4c1590ca585b816ff6b70947ad2a1109918955
Reviewed-on: https://go-review.googlesource.com/c/go/+/405656
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Matthew Dempsky [Tue, 10 May 2022 23:06:16 +0000 (16:06 -0700)]
cmd/compile/internal/types: change NewTypeParam to match New{Basic,Named}
NewBasic and NewNamed take an Object (i.e., *ir.Name), so that callers
don't need to call SetNod. This CL changes NewTypeParam to follow the
same convention. Following up on recent Ntype removal, this allows
getting rid of Type.SetNod entirely.
While here, Type.SetSym is unused too.
Change-Id: Ibe0f5747e2ab4a9512b65142b6d3006704b60bd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/405654
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Cuong Manh Le [Fri, 13 May 2022 12:04:59 +0000 (19:04 +0700)]
cmd/compile/internal/ir: remove NilExpr.Sym_
Historically, the compiler used to use a name node to represent "nil".
Now, "nil" is represented by NilExpr, so it's not necessary to associate
a Sym with it anymore.
Matthew Dempsky [Thu, 12 May 2022 22:46:59 +0000 (15:46 -0700)]
cmd/compile/internal/staticdata: remove use of `""` in embed linker symbols
Not strictly necessary for CL 393715, but this is necessary if we want
to remove the logic from cmd/internal/obj for substituting `""` in
linker symbol names.
Updates #51734.
Change-Id: Ib13cb12fa3973389ca0c1c9a9209e00c30dc9431
Reviewed-on: https://go-review.googlesource.com/c/go/+/406058
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Matthew Dempsky [Thu, 12 May 2022 22:46:20 +0000 (15:46 -0700)]
cmd/compile/internal/typecheck: remove iexport assumption of LocalPkg.Path == ""
The indexed export data format encodes the local package's path as "",
because that's historically how we've represented it within
cmd/compile. The format also requires the local package to be first in
the exported list of packages, and was implicitly relying on ""
sorting before other, non-empty package paths.
We can't change the format without breaking existing importers (e.g.,
go/internal/gcimporter), but we can at least remove the dependency on
LocalPkg.Path being "".
Prep refactoring for CL 393715.
Updates #51734.
Change-Id: I6dd4eafd2d538f4e81376948ef9e92fc44a5462a
Reviewed-on: https://go-review.googlesource.com/c/go/+/406057
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com>
This CL moves the call to base.ParseFlags() earlier in compiler
startup. This is necessary so CL 393715 can use base.Ctxt.Pkgpath to
construct types.LocalPkg.
Updates #51734.
Change-Id: I9f5f75dc9d5fd1b1d22e98523efc95e6cec64385
Reviewed-on: https://go-review.googlesource.com/c/go/+/406055 Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Ian Lance Taylor [Fri, 6 May 2022 22:43:48 +0000 (15:43 -0700)]
time: clarify that monotonic clock is not returned by t.Unix
Prompted by CL 403996.
Change-Id: I8b480a9d361863d4770c7c9a4437431424f26994
Reviewed-on: https://go-review.googlesource.com/c/go/+/404695
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
Ville Skyttä [Sat, 7 May 2022 06:37:07 +0000 (06:37 +0000)]
mime: skip globs2 entries that are not simple file extensions
The entries in globs2 can be globs beyond simple *.ext ones. We support only simple extension based matching, so skip entries that do not represent them.
Change-Id: Id5d089cb4067e53beb2471a5e67a59c13880a017
GitHub-Last-Rev: f725a910547ec52d12605760563f158dfb72e4b0
GitHub-Pull-Request: golang/go#51156
Reviewed-on: https://go-review.googlesource.com/c/go/+/385256
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
penglei [Mon, 9 May 2022 08:55:41 +0000 (08:55 +0000)]
cmd/go/internal/mvs: Delete redundant searching for maximum version when building minimal requirement list
mvs.Req performs an unnecessary search for the maximum version when building minimal requirement list. Someone may be confused when reading this piece of code. The comment of the BuildList function also states that the build list contains the maximum version of each module. We just need to create a maximum version cache that maps from path to version, in the beginning of the Req function body.
Michael Anthony Knyszek [Fri, 13 May 2022 15:14:54 +0000 (15:14 +0000)]
runtime/metrics: add the last GC cycle that had the limiter enabled
This metric exports the the last GC cycle index that the GC limiter was
enabled. This metric is useful for debugging and identifying the root
cause of OOMs, especially when SetMemoryLimit is in use.
For #48409.
Change-Id: Ic6383b19e88058366a74f6ede1683b8ffb30a69c
Reviewed-on: https://go-review.googlesource.com/c/go/+/403614
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
David Chase [Fri, 13 May 2022 17:16:58 +0000 (13:16 -0400)]
runtime: tweak js and plan9 to avoid/disable write barrier & gc problems
runtime code for js contains possible write barriers that fail
the nowritebarrierrec check when internal local package naming
conventions are changed. The problem was there all already; this
allows the code to compile, and it seems to work anyway in the
(single-threaded) js/wasm environment. The offending operations
are noted with TODO, which is an improvement.
runtime code for plan9 contained an apparent allocation that was
not really an allocation; rewrite to remove the potential allocation
to avoid nowritebarrierrec problems.
This CL is a prerequisite for a pending code cleanup,
https://go-review.googlesource.com/c/go/+/393715
Updates #51734.
Change-Id: I93f31831ff9b92632137dd7b0055eaa721c81556
Reviewed-on: https://go-review.googlesource.com/c/go/+/405901
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Rhys Hiltner [Mon, 9 May 2022 04:42:51 +0000 (21:42 -0700)]
runtime/pprof: fix allFrames cache
The compiler may choose to inline multiple layers of function call, such
that A calling B calling C may end up with all of the instructions for B
and C written as part of A's function body.
Within that function body, some PCs will represent code from function A.
Some will represent code from function B, and for each of those the
runtime will have an instruction attributable to A that it can report as
its caller. Others will represent code from function C, and for each of
those the runtime will have an instruction attributable to B and an
instruction attributable to A that it can report as callers.
When a profiling signal arrives at an instruction in B (as inlined in A)
that the runtime also uses to describe calls to C, the profileBuilder
ends up with an incorrect cache of allFrames results. That PC should
lead to a location record in the profile that represents the frames
B<-A, but the allFrames cache's view should expand the PC only to the B
frame.
Otherwise, when a profiling signal arrives at an instruction in C (as
inlined in B in A), the PC stack C,B,A can get expanded to the frames
C,B<-A,A as follows: The inlining deck starts empty. The first tryAdd
call proposes PC C and frames C, which the deck accepts. The second
tryAdd call proposes PC B and, due to the incorrect caching, frames B,A.
(A fresh call to allFrames with PC B would return the frame list B.) The
deck accepts that PC and frames. The third tryAdd call proposes PC A and
frames A. The deck rejects those because a call from A to A cannot
possibly have been inlined. This results in a new location record in the
profile representing the frames C<-B<-A (good), as called by A (bad).
The bug is the cached expansion of PC B to frames B<-A. That mapping is
only appropriate for the resulting protobuf-format profile. The cache
needs to reflect the results of a call to allFrames, which expands the
PC B to the single frame B.
For #50996
For #52693
Fixes #52764
Change-Id: I36d080f3c8a05650cdc13ced262189c33b0083b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/404995 Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Rhys Hiltner <rhys@justin.tv> Reviewed-by: Cherry Mui <cherryyz@google.com>
David Chase [Fri, 13 May 2022 16:09:21 +0000 (12:09 -0400)]
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>
David Chase [Thu, 12 May 2022 21:25:04 +0000 (17:25 -0400)]
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.
Xiaodong Liu [Tue, 22 Feb 2022 07:24:47 +0000 (15:24 +0800)]
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>
Xiaodong Liu [Wed, 24 Nov 2021 08:41:33 +0000 (16:41 +0800)]
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>
David Chase [Thu, 12 May 2022 21:12:32 +0000 (17:12 -0400)]
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>
Roland Shoemaker [Thu, 12 May 2022 17:03:25 +0000 (10:03 -0700)]
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.
Michael Anthony Knyszek [Wed, 4 May 2022 19:48:29 +0000 (19:48 +0000)]
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>
Michael Anthony Knyszek [Fri, 6 May 2022 20:17:52 +0000 (20:17 +0000)]
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>
Roland Shoemaker [Fri, 6 May 2022 17:15:49 +0000 (10:15 -0700)]
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.
Paul E. Murphy [Thu, 24 Mar 2022 17:18:30 +0000 (12:18 -0500)]
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>
Paul E. Murphy [Mon, 9 May 2022 15:44:07 +0000 (10:44 -0500)]
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>
Keith Randall [Sat, 28 Aug 2021 22:50:52 +0000 (15:50 -0700)]
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>
Robert Griesemer [Thu, 12 May 2022 20:25:01 +0000 (13:25 -0700)]
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>
Ian Lance Taylor [Thu, 12 May 2022 02:26:14 +0000 (19:26 -0700)]
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>
Xiaodong Liu [Wed, 24 Nov 2021 08:47:08 +0000 (16:47 +0800)]
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>
Roland Shoemaker [Thu, 12 May 2022 17:26:12 +0000 (10:26 -0700)]
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.
Michael Matloob [Tue, 5 Apr 2022 22:47:23 +0000 (18:47 -0400)]
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>
Michael Matloob [Tue, 3 May 2022 21:51:14 +0000 (17:51 -0400)]
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>
Robert Griesemer [Thu, 12 May 2022 03:52:05 +0000 (20:52 -0700)]
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>
Robert Griesemer [Thu, 12 May 2022 01:22:51 +0000 (18:22 -0700)]
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>
Cherry Mui [Fri, 6 May 2022 17:52:23 +0000 (13:52 -0400)]
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>