1
0
mirror of https://github.com/golang/go synced 2024-11-08 09:06:15 -07:00
Commit Graph

38267 Commits

Author SHA1 Message Date
Brad Fitzpatrick
c544e0fbdb strings: select Replacer algorithm and build machine lazily
Saves 22KB of memory in stdlib packages.

Updates #26775

Change-Id: Ia19fe7aff61f6e2ddd83cd35969d7ff94526591f
Reviewed-on: https://go-review.googlesource.com/127661
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-21 02:50:58 +00:00
Muhammad Falak R Wani
9087d13ec3 cmd/objdump: defer closing the file after opening
Remove the os.Exit(0) to honor the deferred closing of the file.

Change-Id: Iaa9304d8203c8fec0ec728af669a94eadd36905c
Reviewed-on: https://go-review.googlesource.com/118915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 02:45:00 +00:00
Russ Cox
a0212aa627 cmd/go: revert "add graphviz output to graph command"
This reverts commit 723479bc30.

Reason for revert: other tools should convert the graph output to graphviz.

Change-Id: Ide5b8f0b061aaff74bb6ba4c2a8f8768d1fbc05a
Reviewed-on: https://go-review.googlesource.com/130295
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-21 02:44:04 +00:00
Russ Cox
27ed675b4b cmd/go: fix 'go help go.mod' example
Dropped the example referred to in the text
when copying this text out of 'go help mod fix'.

Fixes #27083.

Change-Id: I63dfa3033fa2b2408019eef9d8b5a055aa803c57
Reviewed-on: https://go-review.googlesource.com/130140
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-21 02:41:59 +00:00
Russ Cox
df6aedb630 cmd/go: fix list -compiled of package with only tests
Fixes #27097.

Change-Id: I6aa48a1c58a21fd320b0e9dcd1f86c90172f0182
Reviewed-on: https://go-review.googlesource.com/130139
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-21 02:41:58 +00:00
Russ Cox
c652a1b9c0 cmd/go: fix modload response for std-vendored packages
This fixes a failure when using Go 1.11 to build App Engine code.

Change-Id: I008e8cf5ad4c568676d904deddff031a166f2d5d
Reviewed-on: https://go-review.googlesource.com/130138
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-21 02:41:56 +00:00
Russ Cox
46033d7639 cmd/go: add go.sum entries to go mod download -json output
Clients of 'go mod download', particularly proxies, may need
the hashes of the content they downloaded, for checking against
go.sum entries or recording elsewhere.

Change-Id: Ic36c882cefc540678e1bc5a3dae1e865d181aa69
Reviewed-on: https://go-review.googlesource.com/129802
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-08-21 02:41:55 +00:00
Tim Cooper
dc272a4393 encoding/json: call reflect.TypeOf with nil pointers rather than allocating
Updates #26775

Change-Id: I83c9eeda59769d2f35e0cc98f3a8579861d5978b
Reviewed-on: https://go-review.googlesource.com/119715
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-21 02:38:02 +00:00
Tim Cooper
3333b6407d net/http: use internal/race
Change-Id: Iaa5ded13e8ab4753e2e3d04c9fff203d854208ba
Reviewed-on: https://go-review.googlesource.com/119435
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 02:37:19 +00:00
isharipo
bc276c585b cmd/link/internal/ld: avoid Reloc copies in range loops
Copying sym.Reloc in loops hurts performance as
it has 48 byte size (on 64-bit platforms).

There are quite many symbols and each of them has more than 1
relocation (so, it's possible to have more than 1kk relocs).
The're also traversed more than once in some code paths.

By using pointers to them, copies are avoided.

For linking "hello world" example from net/http:

	name      old time/op  new time/op  delta
	Linker-4   530ms ± 2%   521ms ± 3%  -1.80%  (p=0.000 n=17+20)

Change-Id: I6518aec69d6adcd137f84b5c089ceab4cb4ea2dd
Reviewed-on: https://go-review.googlesource.com/113636
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 02:29:51 +00:00
Philip Børgesen
97c7e0e0ad encoding/json: eliminate superfluous space in Decoder.Token error messages
The existing Decoder.tokenError implementation creates its error messages by
concatenating "invalid character " + quoteChar(c) + " " + context. All context
values however already start with a space leading to error messages containing
two spaces.

This change removes " " from the concatenation expression.

Fixes #26587

Change-Id: I93d14319396636b2a40d55053bda88c98e94a81a
GitHub-Last-Rev: 6db7e1991b
GitHub-Pull-Request: golang/go#26588
Reviewed-on: https://go-review.googlesource.com/125775
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-21 02:26:17 +00:00
Jan Lehnardt
0ca3203bec syscall: add S_IRWXG and S_IRWXO to FreeBSD types
Companion PR to https://github.com/golang/sys/pull/13

Change-Id: I097fc97912840eb69ca232eded6ba939de0fead9
GitHub-Last-Rev: f8a8f7d96c
GitHub-Pull-Request: golang/go#26675
Reviewed-on: https://go-review.googlesource.com/126621
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 02:18:19 +00:00
Tim Cooper
352583ff77 encoding/hex: pre-allocate Dump buffer
name          old time/op    new time/op    delta
Dump/256-4      7.76µs ± 2%    5.82µs ± 2%  -24.91%  (p=0.008 n=5+5)
Dump/1024-4     28.4µs ± 2%    22.6µs ± 3%  -20.58%  (p=0.008 n=5+5)
Dump/4096-4      112µs ± 2%      88µs ± 0%  -20.80%  (p=0.016 n=5+4)
Dump/16384-4     444µs ± 3%     361µs ± 7%  -18.73%  (p=0.008 n=5+5)

name          old alloc/op   new alloc/op   delta
Dump/256-4      4.00kB ± 0%    1.39kB ± 0%  -65.20%  (p=0.008 n=5+5)
Dump/1024-4     16.2kB ± 0%     5.5kB ± 0%  -66.04%  (p=0.008 n=5+5)
Dump/4096-4     63.9kB ± 0%    20.6kB ± 0%  -67.78%  (p=0.008 n=5+5)
Dump/16384-4     265kB ± 0%      82kB ± 0%  -69.00%  (p=0.008 n=5+5)

name          old allocs/op  new allocs/op  delta
Dump/256-4        7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.008 n=5+5)
Dump/1024-4       9.00 ± 0%      3.00 ± 0%  -66.67%  (p=0.008 n=5+5)
Dump/4096-4       11.0 ± 0%       3.0 ± 0%  -72.73%  (p=0.008 n=5+5)
Dump/16384-4      13.0 ± 0%       3.0 ± 0%  -76.92%  (p=0.008 n=5+5)

Change-Id: I0a0d6de315b979142b05e333880da8a5e52b12ef
Reviewed-on: https://go-review.googlesource.com/116495
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 02:10:52 +00:00
Alan Braithwaite
00379be17e net/http: fix cookie SameSite docs grammar
Change-Id: I76d878343c1cc14b53c700b0476ca050c1f9e6be
GitHub-Last-Rev: 148a45f4b6
GitHub-Pull-Request: golang/go#27107
Reviewed-on: https://go-review.googlesource.com/130235
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 02:08:43 +00:00
Tim Cooper
77c575d2e2 net/http: remove unnecessary return
Change-Id: I93bc5de6bcb23c2639d7c2f3f5252fb6f09ca6e4
Reviewed-on: https://go-review.googlesource.com/126797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 01:59:04 +00:00
Iskander Sharipov
89d533e368 archive/tar: remore redundant parens in type expressions
Simplify `(T)` expressions to  `T` where possible.

Found using https://go-critic.github.io/overview.html#typeUnparen-ref

Change-Id: Ic5ef335e03898f9fea1ff90fd83956376657fe67
Reviewed-on: https://go-review.googlesource.com/123379
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2018-08-21 01:47:17 +00:00
Daniel Martí
692307aa83 cmd/go: fix modload infinite directory loop
It is possible to enter the parent-walking directory loop in a way that
it will loop forever - if mdir is empty, and d reaches ".". To avoid
this, make sure that the 'd = filepath.Dir(d)' step only happens if the
parent directory is actually different than the current directory.

This fixes some of the tests like TestImport/golang.org_x_net_context,
which were never finishing before.

While at it, also fix TestImport/golang.org_x_net, which seems to have
the wrong expected error. The root of the x/net repo doesn't have a
go.mod file, nor is part of a module itself, so it seems like the
expected error should reflect that.

After these two changes, 'go test cmd/go/internal/modload' passes on my
linux/amd64 machine.

Fixes #27080.

Change-Id: Ie8bab0f9fbc9f447844cbbc64117420d9087db1b
Reviewed-on: https://go-review.googlesource.com/129778
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-21 01:44:48 +00:00
Jeet Parekh
539ff607a7 archive/zip: return error from NewReader when negative size is passed
Fixes #26589

Change-Id: I180883a13cec229093654004b42c48d76ee20272
GitHub-Last-Rev: 2d9879de43
GitHub-Pull-Request: golang/go#26667
Reviewed-on: https://go-review.googlesource.com/126617
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-21 00:34:36 +00:00
Santhosh Kumar Tekuri
0b30cf534a archive/zip: makes receiver name consistent
Change-Id: I4d6f7440747d4f935acddc9a5c5928ed911a2fb0
Reviewed-on: https://go-review.googlesource.com/120515
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 23:12:45 +00:00
Brad Fitzpatrick
85a0192b59 net/http: add Client.CloseIdleConnections
Fixes #26563

Change-Id: I22b0c72d45fab9d3f31fda04da76a8c0b10cd8b6
Reviewed-on: https://go-review.googlesource.com/130115
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-08-20 23:12:01 +00:00
Kevin Burke
d169a429c5 cmd/go: test whether alldocs.go is up to date
A common error is to update the help text for a command in cmd/go, but
fail to update alldocs.go, which actually prints the help text for the
most common commands.

Add a test that the long-form documentation help text matches the
contents of alldocs.go, which will fail the build if we fail to keep
the documentation in sync. We can get fancier with the test output if
this is not sufficient.

Fixes golang/go#26735.

Change-Id: I2509765315eeb0f362633d812343d1324a01b73b
Reviewed-on: https://go-review.googlesource.com/127920
Run-TryBot: Kevin Burke <kev@inburke.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 22:20:09 +00:00
Xia Bin
477b7e5f4d cmd/internal/obj: remove pointless validation
s.Func.Text only can be nil at the moment, otherwise there has
some bugs in compiler's Go rumtime.

Change-Id: Ib2ff9bb977352838e67f2b98a69468f6f350c1f3
Reviewed-on: https://go-review.googlesource.com/123535
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 22:16:46 +00:00
Iskander Sharipov
0fbaf6ca8b math,net: omit explicit true tag expr in switch
Performed `switch true {}` => `switch {}` replacement.

Found using https://go-critic.github.io/overview.html#switchTrue-ref

Change-Id: Ib39ea98531651966a5a56b7bd729b46e4eeb7f7c
Reviewed-on: https://go-review.googlesource.com/123378
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 22:15:59 +00:00
isharipo
328adf9d62 cmd/link: fewer allocs in ld.Arch.Archreloc
Archreloc had this signature:

	func(*Link, *sym.Reloc, *sym.Symbol, *int64) bool

The last *int64 argument is used as out parameter.
Passed valus could be allocated on stack, but escape analysis
fails here, leading to high number of unwanted allocs.

If instead 4th arg is passed by value, and modified values is returned,
no problems with allocations arise:

	func(*Link, *sym.Reloc, *sym.Symbol, int64) (int64, bool)

There are 2 benefits:
1. code becomes more readable.
2. less allocations.

For linking "hello world" example from net/http:

	name      old time/op  new time/op  delta
	Linker-4   530ms ± 2%   520ms ± 2%  -1.83%  (p=0.001 n=17+16)

It's top 1 in alloc_objects from memprofile:

	flat   flat%  sum%       cum    cum%
	229379 33.05% 33.05%     229379 33.05%  cmd/link/internal/ld.relocsym
	...

list relocsym:

	229379     229379 (flat, cum) 33.05% of Total
	229379     229379    183:    var o int64

After the patch, ~230k of int64 allocs (~ 1.75mb) removed.

Passes toolshash-check (toolstash cmp).

Change-Id: I25504fe27967bcff70c4b7338790f3921d15473d
Reviewed-on: https://go-review.googlesource.com/113637
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 22:10:31 +00:00
Ilya Tocar
4201c2077e cmd/compile: omit racefuncentry/exit when they are not needed
When compiling with -race, we insert calls to racefuncentry,
into every function. Add a rule that removes them in leaf functions,
without instrumented loads/stores.
Shaves ~30kb from "-race" version of go tool:

file difference:
go_old 15626192
go_new 15597520 [-28672 bytes]

section differences:
global text (code) = -24513 bytes (-0.358598%)
read-only data = -5849 bytes (-0.167064%)
Total difference -30362 bytes (-0.097928%)

Fixes #24662

Change-Id: Ia63bf1827f4cf2c25e3e28dcd097c150994ade0a
Reviewed-on: https://go-review.googlesource.com/121235
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2018-08-20 22:07:22 +00:00
David Symonds
f76eaeb2c8 cmd/go/internal/get: more efficient path prefix checking code
Splitting the string is unnecessary.

Change-Id: I02796cb91602c1b9bf22721b985cd41b18cc92f2
Reviewed-on: https://go-review.googlesource.com/119936
Run-TryBot: David Symonds <dsymonds@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-08-20 21:54:45 +00:00
nogoegst
a1addf15df bufio: make Reader naming consistent
All the readers are denoted as `b` while for `Reader.Size()` it is `r`.

Change-Id: Ib6f97306c11b3abb2ff30edbc9f9362cad36d080
GitHub-Last-Rev: 992f88b374
GitHub-Pull-Request: golang/go#26205
Reviewed-on: https://go-review.googlesource.com/122156
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 21:51:48 +00:00
Ian Lance Taylor
c9b018918d testing: exit with error if testing.Short is called before flag.Parse
Change-Id: I2fa547d1074ef0931196066678fadd7250a1148d
Reviewed-on: https://go-review.googlesource.com/121936
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 21:51:11 +00:00
Shivansh Rai
d05f31a3c5 internal/poll: Avoid evaluating condition for an unreachable branch
Change-Id: I868dcaf84767d631bc8f1b6ef6bcb3ec18047259
Reviewed-on: https://go-review.googlesource.com/116135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 21:50:00 +00:00
Ilya Tocar
a3593685cf cmd/compile/internal/ssa: remove useless zero extension
We generate MOVBLZX for byte-sized LoadReg, so
(MOVBQZX (LoadReg (Arg))) is the same as
(LoadReg (Arg)). Remove those zero extension where possible.
Triggers several times during all.bash.

Fixes #25378
Updates #15300

Change-Id: If50656e66f217832a13ee8f49c47997f4fcc093a
Reviewed-on: https://go-review.googlesource.com/115617
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2018-08-20 21:38:20 +00:00
Ilya Tocar
c292b32f33 cmd/compile: enable disjoint memmove inlining on amd64
Memmove can use AVX/prefetches/other optional instructions, so
only do it for small sizes, when call overhead dominates.

Change-Id: Ice5e93deb11462217f7fb5fc350b703109bb4090
Reviewed-on: https://go-review.googlesource.com/112517
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <mike.munday@ibm.com>
2018-08-20 21:10:12 +00:00
Jordan Rhee
3000795c83 cmd/dist: support windows/arm
Updates #26148

Change-Id: I4744ebcc77fda3acc1301a1d8857754c0ee797fa
Reviewed-on: https://go-review.googlesource.com/130056
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 20:41:54 +00:00
Jordan Rhee
c589b9ec4e cmd/vet: exclude windows/arm from cmd/vet
Updates #27103

Change-Id: I1f7d198879e5912661e4156a86e13de2698a5473
Reviewed-on: https://go-review.googlesource.com/130055
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 20:41:46 +00:00
Fazlul Shahriar
e8f49aa80e cmd/go/internal/modload: ignore directories when looking for go.mod file in Plan 9
This fixes builds in Plan 9 under /n. Since directories in /n are
automatically created, /n/go.mod always exists.

Fixes #27074

Change-Id: Ie9a1155b7c316bdc27655f5b99172550b413838d
Reviewed-on: https://go-review.googlesource.com/129804
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 19:14:25 +00:00
Shulhan
1ba74448f2 runtime: document all possible values for GOOS and GOARCH
The updated list is taken from "src/go/build/syslist.go".

Reason: one should not do web search to know the possible values of GOOS
and GOARCH.  The search result point to stackoverflow page which
reference the above source and documentation on installation page [1].
It should available offline (as in local godoc), as part of package
documentation.

[1] https://golang.org/doc/install/source#environment

Change-Id: I736804b8ef4dc11e0260fa862999212ab3f7b3fd
Reviewed-on: https://go-review.googlesource.com/129935
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 19:14:00 +00:00
Brad Fitzpatrick
09ec523049 Revert "cmd/dist: support windows/arm"
This reverts commit def3280eb4.

Reason for revert: broke the vetall builder and I (Brad) forgot to run the trybots first. :(

Change-Id: I255bedeb28d13e265f357060e57561e593145275
Reviewed-on: https://go-review.googlesource.com/130015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 19:12:24 +00:00
Austin Clements
a034f310b0 runtime: use gList in closechan
Change-Id: I8148eb17fe9f2cbb659c35d84cdd212b46dc23bf
Reviewed-on: https://go-review.googlesource.com/129401
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2018-08-20 18:19:29 +00:00
Austin Clements
083938df14 runtime: use gList for injectglist
Change-Id: Id5af75eaaf41f43bc6baa6d3fe2b852a2f93bb6f
Reviewed-on: https://go-review.googlesource.com/129400
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2018-08-20 18:19:28 +00:00
Austin Clements
d02169d380 runtime: use gList for work.sweepWaiters
Change-Id: Ibae474a5c9a3528a042ddf19ddb4a88913a87606
Reviewed-on: https://go-review.googlesource.com/129399
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2018-08-20 18:19:27 +00:00
Austin Clements
8e8cc9db0f runtime: use gList for gfree lists
Change-Id: I3d21587e02264fe5da1cc38d98779facfa09b927
Reviewed-on: https://go-review.googlesource.com/129398
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2018-08-20 18:19:26 +00:00
Austin Clements
de990545c3 runtime: use gList in netpoll
netpoll is perhaps one of the most confusing uses of G lists currently
since it passes around many lists as bare *g values right now.
Switching to gList makes it much clearer what's an individual g and
what's a list.

Change-Id: I8d8993c4967c5bae049c7a094aad3a657928ba6c
Reviewed-on: https://go-review.googlesource.com/129397
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2018-08-20 18:19:25 +00:00
Austin Clements
3578918b66 runtime: replace manually managed G dequeues with a type
There are two manually managed G dequeues. Abstract these both into a
shared gQueue type. This also introduces a gList type, which we'll use
to replace several manually-managed G lists in follow-up CLs.

This makes the code more readable and maintainable. gcFlushBgCredit in
particular becomes much easier to follow. It also makes it easier to
introduce more G queues in the future. Finally, the gList type clearly
distinguishes between lists of Gs and individual Gs; currently both
are represented by a *g, which can easily lead to confusion and bugs.

Change-Id: Ic7798841b405d311fc8b6aa5a958ffa4c7993c6c
Reviewed-on: https://go-review.googlesource.com/129396
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2018-08-20 18:19:22 +00:00
Giovanni Bajo
723479bc30 cmd/go: add graphviz output to graph command
This allows to quickly visual inspect dependencies.

Change-Id: Ice326ec69d7d57720f608b04cdf3ece153b8c5f1
Reviewed-on: https://go-review.googlesource.com/127599
Run-TryBot: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 18:14:55 +00:00
Jordan Rhee
18034e6b9f debug/pe: support windows/arm
Enable 'go tool objdump' to disassemble windows/arm images.

Updates #26148

Change-Id: I7d11226f01d92288061f8e25980334b9bd82c41f
Reviewed-on: https://go-review.googlesource.com/125649
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 18:12:47 +00:00
Jordan Rhee
def3280eb4 cmd/dist: support windows/arm
Updates #26148

Change-Id: I407481f9c0f8e3565dcfcbbc53e5aa7427d74680
Reviewed-on: https://go-review.googlesource.com/125646
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 18:08:37 +00:00
Qais Patankar
6570ea3c60 container/heap: clarify that Remove returns the removed element
Change-Id: I63b59c1ca8265e9af7eb3f9210ee1d17925de891
Reviewed-on: https://go-review.googlesource.com/129779
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 18:05:11 +00:00
Michael Munday
edae0ff8c1 math: use s390x mnemonics rather than binary encodings
TMLL, LGDR and LDGR have all been added to the Go assembler
previously, so we don't need to encode them using WORD and BYTE
directives anymore. This is purely a cosmetic change, it does not
change the contents of any object files.

Change-Id: I93f815b91be310858297d8a0dc9e6d8e3f09dd65
Reviewed-on: https://go-review.googlesource.com/129895
Run-TryBot: Michael Munday <mike.munday@ibm.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 17:42:08 +00:00
Ben Hoyt
6c7e199e50 text/scanner: don't allow Float exponents with no mantissa
Previously Scanner would allow float literals like "1.5e" and "1e+"
that weren't actually valid Go float literals, and also not valid
when passed to ParseFloat. This commit fixes that behaviour to match
the documentation ("recognizes all literals as defined by the Go
language specification"), and Scanner emits an error in these cases.

Fixes #26374

Change-Id: I6855402ea43febb448c6dff105b9578e31803c01
Reviewed-on: https://go-review.googlesource.com/129095
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-20 17:01:34 +00:00
Martin Möhrmann
7b9c2c1950 internal/cpu: add and use cpu.CacheLinePad for padding structs
Add a CacheLinePad struct type to internal/cpu that has a size of CacheLineSize.
This can be used for padding structs in order to avoid false sharing.

Updates #25203

Change-Id: Icb95ae68d3c711f5f8217140811cad1a1d5be79a
Reviewed-on: https://go-review.googlesource.com/116276
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-20 15:41:37 +00:00
Ben Shi
84feb4bbb7 cmd/internal/obj/arm64: add register indexed FMOVS/FMOVD
This CL adds register indexed FMOVS/FMOVD.
FMOVS Fx, (Rn)(Rm)
FMOVS Fx, (Rn)(Rm<<2)
FMOVD Fx, (Rn)(Rm)
FMOVD Fx, (Rn)(Rm<<3)
FMOVS (Rn)(Rm), Fx
FMOVS (Rn)(Rm<<2), Fx
FMOVD (Rn)(Rm), Fx
FMOVD (Rn)(Rm<<3), Fx

Change-Id: Id76de6a4be96b64cf79d7e9a1962d9d49cb462f2
Reviewed-on: https://go-review.googlesource.com/123995
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-08-20 15:15:16 +00:00