1
0
mirror of https://github.com/golang/go synced 2024-10-01 11:28:34 -06:00
Commit Graph

31199 Commits

Author SHA1 Message Date
Michael Matloob
91ad2a2194 runtime/pprof: add definitions of profile label types
This change defines WithLabels, Labels, Label, and ForLabels.
This is the first step of the profile labels implemention for go 1.9.

Updates #17280

Change-Id: I2dfc9aae90f7a4aa1ff7080d5747f0a1f0728e75
Reviewed-on: https://go-review.googlesource.com/34198
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-02-06 15:43:06 +00:00
Josh Bleecher Snyder
47d2a4dafa cmd/compile: remove walkmul
Replace with generic rewrite rules.

Change-Id: I3ee32076cfd9db5801f1a7bdbb73a994255884a9
Reviewed-on: https://go-review.googlesource.com/36323
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-06 07:21:14 +00:00
Ian Lance Taylor
6aee6b895c runtime: remove markBits.clearMarkedNonAtomic
It's not used, it's never been used, and it doesn't do what its doc
comment says it does.

Fixes #18941.

Change-Id: Ia89d97fb87525f5b861d7701f919e0d6b7cbd376
Reviewed-on: https://go-review.googlesource.com/36322
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-06 04:45:55 +00:00
Alexey Palazhchenko
172311ce10 time: Fix typo in Time.String() description.
Refs #12914.

Change-Id: Iadac4cbef70db6a95b47f86eaffcfc63bfdb8e90
Reviewed-on: https://go-review.googlesource.com/36334
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-05 21:14:45 +00:00
Cherry Zhang
b53f0f8c96 cmd/compile: do not fold large offset on ARM64
Fixes #18933.

Change-Id: I8bb98e95bb4486a086d93bcf99e3a37488e77b03
Reviewed-on: https://go-review.googlesource.com/36318
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-04 16:46:11 +00:00
Yasuhiro Matsumoto
34b455da44 path/filepath: ignore dot for Dir(\\server\share)
Dir(`\\server\share`) returns `\\server\share.`. Change Dir so it
returns `\\server\share` instead.

Fixes #18783

Change-Id: I9e0dd71ea6aea85e6c6114aaa4bb3bea3270d818
Reviewed-on: https://go-review.googlesource.com/35690
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-04 07:24:20 +00:00
Alex Brainman
769be04feb cmd/nm: skip TestInternalLinkerCgoFile if no internal linking is supported
Fixes build.

Change-Id: I2fee624c8a4b228bb9f2889e241ea016a317bb11
Reviewed-on: https://go-review.googlesource.com/36373
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-02-04 06:53:29 +00:00
Alex Brainman
c7a7c5a9b4 cmd/link: do not prefix external symbols with underscore on windows/386/cgo
CL 18057 added underscore to most external pe symbols
on windows/386/cgo. The CL changed runtime.epclntab and
runtime.pclntab pe symbols into _runtime.pclntab and
_runtime.epclntab, and now cmd/nm cannot find them.
Revert correspondent CL 18057 changes, because most pe
symbols do not need underscore prefix.

This CL also removes code that added obj.SHOSTOBJ symbols
explicitly, because each of those was also added via
genasmsym call. These created duplicate pe symbols (like
_GetProcAddress@8 and __GetProcAddress@8), and external
linker would complain.

This CL adds new test in cmd/nm to verify go programs
built with cgo.

Fixes #18416

Change-Id: I68b1be8fb631d95ec69bd485c77c79604fb23f26
Reviewed-on: https://go-review.googlesource.com/35076
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-04 05:56:45 +00:00
Ian Lance Taylor
afa0247c5d buildall.bash: clarify target selection
Avoid confusing use of $(( in non-arithmetic context.

Permit added targets linux-386-387 linux-arm-arm5 to be correctly
matched against pattern argument.

Change-Id: Ib004c926457acb760c7e270fdd2f4095b1787a6d
Reviewed-on: https://go-review.googlesource.com/33492
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-04 04:34:36 +00:00
Matthew Dempsky
6ee8c6a7ce cmd/compile/internal/gc: simplify generating static data
Passes toolstash -cmp.

Change-Id: I4a72e3e130c38868ee8ecef32cad58748aa5be52
Reviewed-on: https://go-review.googlesource.com/36353
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-04 01:29:40 +00:00
Josh Bleecher Snyder
ad784caa74 cmd/compile: move Heapaddr field from Name to Param
No performance impact, just cleanup.

Passes toolstash -cmp.

Change-Id: Ic7957d2686de53a9680c2bdefe926cccccd73a5c
Reviewed-on: https://go-review.googlesource.com/36316
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-04 01:20:18 +00:00
Matthew Dempsky
5c90e1cf8a cmd/compile/internal/ssa: remove Func.StaticData field
Rather than collecting static data nodes to be written out later, just
write them out immediately.

Change-Id: I51708b690e94bc3e288b4d6ba3307bf738a80f64
Reviewed-on: https://go-review.googlesource.com/36352
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2017-02-04 01:09:26 +00:00
Matthew Dempsky
592c97fc8f cmd/dist: ignore .#foo.go files created by Emacs
go/build already ignores them, but they cause make.bash to fail.

Fixes #18931.

Change-Id: Idd5c8c2a6f2309ecd5f0d669660704d6f5612710
Reviewed-on: https://go-review.googlesource.com/36351
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-04 00:15:59 +00:00
Peter Nguyen
7751d56e39 net/rpc/jsonrpc: Update package doc with info about JSON-RPC 2.0
Currently the net/rpc/jsonrpc package only implements JSON-RPC version
1.0. This change updates the package's documentation with link to find
packages for JSON-RPC 2.0.

Fixes #10929

Change-Id: I3b6f1d17738a1759d7b62ab7b3ecef5b248d30ca
Reviewed-on: https://go-review.googlesource.com/36330
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-03 23:09:57 +00:00
Michael Munday
ddf807fce8 cmd/compile: fix type propagation through s390x SSA rules
This CL fixes two issues:

1. Load ops were initially always lowered to unsigned loads, even
   for signed types. This was fine by itself however LoadReg ops
   (used to re-load spilled values) were lowered to signed loads
   for signed types. This meant that spills could invalidate
   optimizations that assumed the original unsigned load.

2. Types were not always being maintained correctly through rules
   designed to eliminate unnecessary zero and sign extensions.

Fixes #18906.

Change-Id: I95785dcadba03f7e3e94524677e7d8d3d3b9b737
Reviewed-on: https://go-review.googlesource.com/36256
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-02-03 21:27:21 +00:00
Russ Cox
178307c3a7 cmd/go: address review comments
Address review comments from earlier CLs.
These are changes I was too scared to try to push
down into the original CLs (thanks, Git).

Change-Id: I0e428fad73d71bd2a7d08178cf2e856de3cef19f
Reviewed-on: https://go-review.googlesource.com/36257
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:32:36 +00:00
Russ Cox
707cadd7fa cmd/go: split out cmd/go/internal/clean,doc,fix,generate,list,run,tool,version,vet
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: Ib22fc435827d4a05a77a5200ac437ce00e2a4da3
Reviewed-on: https://go-review.googlesource.com/36204
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:32:28 +00:00
Russ Cox
76db88ab4d cmd/go: split out cmd/go/internal/bug
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I05629567cc33fef41bc74eba4f7ff66e4851343c
Reviewed-on: https://go-review.googlesource.com/36203
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:32:20 +00:00
Russ Cox
6dad55aa25 cmd/go: split out cmd/go/internal/get
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: Iec17bf2243de129942ae5fba126ec5f217be7303
Reviewed-on: https://go-review.googlesource.com/36202
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:32:12 +00:00
Russ Cox
cc03ba3289 cmd/go: split out cmd/go/internal/web
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I2f349150659b6ddf6be4c675abba38dfe57ff652
Reviewed-on: https://go-review.googlesource.com/36201
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:32:04 +00:00
Russ Cox
6bc9844b63 cmd/go: split out cmd/go/internal/env
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I28b20d53d20dff06eede574eb5c20359db0d3991
Reviewed-on: https://go-review.googlesource.com/36200
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:56 +00:00
Russ Cox
36ce197c85 cmd/go: split out cmd/go/internal/fmt
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I8e325d75f553b5d0b6224b56a705d2e2cb895de4
Reviewed-on: https://go-review.googlesource.com/36199
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:49 +00:00
Russ Cox
4efe9250e5 cmd/go: split out cmd/go/internal/test
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I2d0ccdb84814537ab8b8842aa1b5f5bc0a88a0fc
Reviewed-on: https://go-review.googlesource.com/36198
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:41 +00:00
Russ Cox
3c667ef421 cmd/go: split out cmd/go/internal/work
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: Icdd181098f9f0e81f68bf201e6867cdd8f820300
Reviewed-on: https://go-review.googlesource.com/36197
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:33 +00:00
Russ Cox
eb93b20c2e cmd/go: split out cmd/go/internal/load
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: Ic802483e50598def638f1e2e706d5fdf7822d32d
Reviewed-on: https://go-review.googlesource.com/36196
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:23 +00:00
Russ Cox
461c3e5263 cmd/go: split out cmd/go/internal/buildid
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I20dbc352c3df3c83a75811dd8e78c580a46b2202
Reviewed-on: https://go-review.googlesource.com/36195
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:15 +00:00
Russ Cox
2cab41d5cb cmd/go: split out cmd/go/internal/help
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I4cf05b076d81b780c87a31378523929b5da8964b
Reviewed-on: https://go-review.googlesource.com/36194
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:08 +00:00
Russ Cox
6dc9e31f5e cmd/go: split out cmd/go/internal/base
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I7c5dde6e7fe4f390e6607303b4d42535c674eac3
Reviewed-on: https://go-review.googlesource.com/36193
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:31:00 +00:00
Russ Cox
b60e61ab1b cmd/dist: move cmd/go z files to cmd/go/internal/cfg
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I6ee5b053683034ea9462a9a0a4ea4f5ad24fa5a1
Reviewed-on: https://go-review.googlesource.com/36192
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:30:52 +00:00
Russ Cox
a918864c52 cmd/go: split out cmd/go/internal/cfg
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: Icb3f168ade91e7da5fcab89ac75b768daefff359
Reviewed-on: https://go-review.googlesource.com/36191
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:30:44 +00:00
Russ Cox
762eb40892 cmd/go: split out cmd/go/internal/str
This is one CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I63f578f5ac99c707b599ac5659293c46b275567d
Reviewed-on: https://go-review.googlesource.com/36190
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:30:36 +00:00
Russ Cox
d9e6835b1d cmd/go: break a few dependencies
This CL makes a few naming changes to break dependencies
between different parts of the go command, to make it easier
to split into different packages.

This is the first CL in a long sequence of changes to break up the
go command from one package into a plausible group of packages.

This sequence is concerned only with moving code, not changing
or cleaning up code. There will still be more cleanup after this sequence.

The entire sequence will be submitted together: it is not a goal
for the tree to build at every step.

For #18653.

Change-Id: I69a98b9ea48e61b1e1cda95273d29860b525415f
Reviewed-on: https://go-review.googlesource.com/36129
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 20:30:27 +00:00
Elias Naur
78074f6850 runtime: handle SIGPIPE in c-archive and c-shared programs
Before this CL, Go programs in c-archive or c-shared buildmodes
would not handle SIGPIPE. That leads to surprising behaviour where
writes on a closed pipe or socket would raise SIGPIPE and terminate
the program. This CL changes the Go runtime to handle
SIGPIPE regardless of buildmode. In addition, SIGPIPE from non-Go
code is forwarded.

This is a refinement of CL 32796 that fixes the case where a non-default
handler for SIGPIPE is installed by the host C program.

Fixes #17393

Change-Id: Ia41186e52c1ac209d0a594bae9904166ae7df7de
Reviewed-on: https://go-review.googlesource.com/35960
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-03 20:07:36 +00:00
Josh Bleecher Snyder
b612ab3acb cmd/compile: make liveness more efficient
When the number of variables in a function is very large,
liveness analysis gets less efficient, since every bit vector
is O(number of variables).

Improve the situation by returning a sparse representation
from progeffects. In all scenarios, progeffects either
returns a slice that is shared function-wide, 
and which is usually small, or a slice that is guaranteed
to have at most three values.

Reduces compilation time for the code in #8225 Comment 1 by ~10%.
Minor effects on regular packages (below).

Passes toolstash -cmp.

Updates #8225

name       old time/op      new time/op      delta
Template        215ms ± 2%       212ms ± 4%  -1.31%  (p=0.001 n=30+30)
Unicode        98.3ms ± 3%      98.4ms ± 5%    ~     (p=0.971 n=30+30)
GoTypes         657ms ± 3%       651ms ± 2%  -0.98%  (p=0.001 n=30+27)
Compiler        2.78s ± 2%       2.77s ± 2%  -0.60%  (p=0.006 n=30+30)
Flate           130ms ± 4%       130ms ± 4%    ~     (p=0.712 n=29+30)
GoParser        159ms ± 5%       158ms ± 3%    ~     (p=0.331 n=29+30)
Reflect         406ms ± 3%       404ms ± 3%  -0.69%  (p=0.041 n=29+30)
Tar             117ms ± 4%       117ms ± 3%    ~     (p=0.886 n=30+29)
XML             219ms ± 2%       217ms ± 2%    ~     (p=0.091 n=29+24)

name       old user-ns/op   new user-ns/op   delta
Template   272user-ms ± 3%  270user-ms ± 3%  -1.03%  (p=0.004 n=30+30)
Unicode    138user-ms ± 2%  138user-ms ± 3%    ~     (p=0.902 n=29+29)
GoTypes    891user-ms ± 2%  883user-ms ± 2%  -0.95%  (p=0.000 n=29+29)
Compiler   3.85user-s ± 2%  3.84user-s ± 2%    ~     (p=0.236 n=30+30)
Flate      167user-ms ± 2%  166user-ms ± 4%    ~     (p=0.511 n=28+30)
GoParser   211user-ms ± 4%  210user-ms ± 3%    ~     (p=0.287 n=29+30)
Reflect    539user-ms ± 3%  536user-ms ± 2%  -0.59%  (p=0.034 n=29+30)
Tar        154user-ms ± 3%  155user-ms ± 4%    ~     (p=0.786 n=30+30)
XML        289user-ms ± 3%  288user-ms ± 4%    ~     (p=0.249 n=30+26)

name       old alloc/op     new alloc/op     delta
Template       40.7MB ± 0%      40.8MB ± 0%  +0.09%  (p=0.001 n=30+30)
Unicode        30.8MB ± 0%      30.8MB ± 0%    ~     (p=0.112 n=30+30)
GoTypes         123MB ± 0%       124MB ± 0%  +0.09%  (p=0.000 n=30+30)
Compiler        473MB ± 0%       473MB ± 0%  +0.05%  (p=0.000 n=30+30)
Flate          26.5MB ± 0%      26.5MB ± 0%    ~     (p=0.186 n=29+30)
GoParser       32.3MB ± 0%      32.4MB ± 0%  +0.07%  (p=0.021 n=28+30)
Reflect        84.4MB ± 0%      84.6MB ± 0%  +0.21%  (p=0.000 n=30+30)
Tar            27.3MB ± 0%      27.3MB ± 0%  +0.09%  (p=0.010 n=30+28)
XML            44.7MB ± 0%      44.7MB ± 0%  +0.07%  (p=0.002 n=30+30)

name       old allocs/op    new allocs/op    delta
Template         401k ± 1%        400k ± 1%    ~     (p=0.321 n=30+30)
Unicode          331k ± 1%        331k ± 1%    ~     (p=0.357 n=30+28)
GoTypes         1.24M ± 0%       1.24M ± 1%  -0.19%  (p=0.001 n=30+30)
Compiler        4.27M ± 0%       4.27M ± 0%  -0.13%  (p=0.000 n=30+30)
Flate            252k ± 1%        251k ± 1%  -0.30%  (p=0.005 n=30+30)
GoParser         325k ± 1%        325k ± 1%    ~     (p=0.224 n=28+30)
Reflect         1.06M ± 0%       1.05M ± 0%  -0.34%  (p=0.000 n=30+30)
Tar              266k ± 1%        266k ± 1%    ~     (p=0.333 n=30+30)
XML              416k ± 1%        415k ± 1%    ~     (p=0.144 n=30+29)


Change-Id: I6ba67a9203516373062a2618122306da73333d98
Reviewed-on: https://go-review.googlesource.com/36211
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-02-03 19:41:44 +00:00
Chris Broadfoot
ef2593905d readme: add attribution for the Gopher image
Change-Id: I3b1317f0ab46e03d8c5a0af74c83183710a75055
Reviewed-on: https://go-review.googlesource.com/36214
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2017-02-03 19:39:41 +00:00
Russ Cox
0e3355903d time: record monotonic clock reading in time.Now, for more accurate comparisons
See https://golang.org/design/12914-monotonic for details.

Fixes #12914.

Change-Id: I80edc2e6c012b4ace7161c84cf067d444381a009
Reviewed-on: https://go-review.googlesource.com/36255
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Caleb Spare <cespare@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-03 19:04:52 +00:00
Keith Randall
8179b9b462 cmd/compile: make sure output params are live if there is a defer
If there is a defer, and that defer recovers, then the caller
can see all of the output parameters.  That means that we must
mark all the output parameters live at any point which might panic.

If there is no defer then this is not necessary.  This is implemented.

We could also detect whether there is a recover in any of the defers.
If not, we would need to mark only output params that the defer
actually references (and the closure mechanism already does that).
This is not implemented.

Fixes #18860.

Change-Id: If984fe6686eddce9408bf25e725dd17fc16b8578
Reviewed-on: https://go-review.googlesource.com/36030
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-02-03 15:21:47 +00:00
Josh Bleecher Snyder
12c58bbf81 cmd/compile: optimize (ZeroExt (Const [c]))
These rules trigger 116 times while running make.bash.
And at least for the sample code at
https://github.com/golang/go/issues/18906#issuecomment-277174241
they are providing optimizations not already present
in amd64.

Updates #18906

Change-Id: I410a480f566f5ab176fc573fb5ac74f9cffec225
Reviewed-on: https://go-review.googlesource.com/36217
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-03 06:52:46 +00:00
Josh Bleecher Snyder
61fb2f6d63 cmd/compile: speed up hot phi insertion code
This speeds up compilation of the code in #8225 by 25%-30%.
The complexity of the algorithm is unchanged,
but this shrinks the constant factor so much that it doesn't matter,
even the size of the giant type switch gets scaled up dramatically.

name       old time/op      new time/op      delta
Template        218ms ± 5%       217ms ±10%    ~           (p=0.163 n=27+30)
Unicode        98.2ms ± 6%      97.7ms ±10%    ~           (p=0.150 n=27+29)
GoTypes         654ms ± 5%       650ms ± 5%    ~           (p=0.350 n=30+30)
Compiler        2.70s ± 4%       2.68s ± 3%    ~           (p=0.128 n=30+29)

name       old user-ns/op   new user-ns/op   delta
Template   276user-ms ± 6%  271user-ms ± 7%  -1.83%        (p=0.003 n=29+28)
Unicode    138user-ms ± 5%  137user-ms ± 4%    ~           (p=0.071 n=27+27)
GoTypes    881user-ms ± 4%  877user-ms ± 4%    ~           (p=0.423 n=30+30)
Compiler   3.76user-s ± 4%  3.72user-s ± 2%  -0.84%        (p=0.028 n=30+29)

name       old alloc/op     new alloc/op     delta
Template       40.7MB ± 0%      40.7MB ± 0%    ~           (p=0.936 n=30+30)
Unicode        30.8MB ± 0%      30.8MB ± 0%    ~           (p=0.859 n=28+30)
GoTypes         123MB ± 0%       123MB ± 0%    ~           (p=0.273 n=30+30)
Compiler        472MB ± 0%       472MB ± 0%    ~           (p=0.432 n=30+30)

name       old allocs/op    new allocs/op    delta
Template         401k ± 1%        401k ± 1%    ~           (p=0.859 n=30+30)
Unicode          331k ± 0%        331k ± 1%    ~           (p=0.823 n=28+30)
GoTypes         1.24M ± 0%       1.24M ± 0%    ~           (p=0.286 n=30+30)
Compiler        4.26M ± 0%       4.26M ± 0%    ~           (p=0.359 n=30+30)

Change-Id: Ia850065a9a84c07a5b0b4e23c1758b5679498da7
Reviewed-on: https://go-review.googlesource.com/36112
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-03 05:36:22 +00:00
Keith Randall
69e1634985 runtime: darwin/amd64, don't depend on outarg slots being unmodified
sigtramp was calling sigtrampgo and depending on the fact that
the 3rd argument slot will not be modified on return.  Our calling
convention doesn't guarantee that.  Avoid that assumption.

There's no actual bug here, as sigtrampgo does not in fact modify its
argument slots.  But I found this while working on the dead stack slot
clobbering tool.  https://go-review.googlesource.com/c/23924/

Change-Id: Ia7e791a2b4c1c74fff24cba8169e7840b4b06ffc
Reviewed-on: https://go-review.googlesource.com/36216
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-03 05:08:54 +00:00
Russ Cox
64c5280844 net/http: fix dns hijacking test
The name lookups are unrooted; the test should be unrooted too.
Correctly skips the tests if the DNS config specifies a domain
suffix that has a wildcard entry causing all unrooted names to resolve.

Change-Id: I80470326a5d332f3b8d64663f765fd304c5e0811
Reviewed-on: https://go-review.googlesource.com/36253
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-03 04:40:36 +00:00
Josh Bleecher Snyder
57546d67ec cmd/compile: add reusable []Location to ssa.Config
name       old time/op      new time/op      delta
Template        218ms ± 3%       214ms ± 3%  -1.70%  (p=0.000 n=30+30)
Unicode         100ms ± 3%       100ms ± 4%    ~     (p=0.614 n=29+30)
GoTypes         657ms ± 1%       660ms ± 3%  +0.46%  (p=0.046 n=29+30)
Compiler        2.80s ± 2%       2.80s ± 1%    ~     (p=0.451 n=28+29)
Flate           131ms ± 2%       132ms ± 4%    ~     (p=1.000 n=29+29)
GoParser        159ms ± 3%       160ms ± 5%    ~     (p=0.341 n=28+30)
Reflect         406ms ± 3%       408ms ± 4%    ~     (p=0.511 n=28+30)
Tar             118ms ± 4%       118ms ± 4%    ~     (p=0.827 n=29+30)
XML             222ms ± 6%       222ms ± 3%    ~     (p=0.532 n=30+30)

name       old user-ns/op   new user-ns/op   delta
Template   274user-ms ± 3%  272user-ms ± 3%  -0.87%  (p=0.015 n=29+30)
Unicode    140user-ms ± 4%  140user-ms ± 3%    ~     (p=0.735 n=29+30)
GoTypes    890user-ms ± 1%  897user-ms ± 2%  +0.88%  (p=0.002 n=29+30)
Compiler   3.88user-s ± 2%  3.89user-s ± 1%    ~     (p=0.132 n=30+29)
Flate      168user-ms ± 2%  157user-ms ± 4%  -6.21%  (p=0.000 n=25+28)
GoParser   211user-ms ± 2%  213user-ms ± 5%    ~     (p=0.086 n=28+30)
Reflect    539user-ms ± 2%  541user-ms ± 3%    ~     (p=0.267 n=27+29)
Tar        156user-ms ± 7%  155user-ms ± 5%    ~     (p=0.708 n=30+30)
XML        291user-ms ± 5%  294user-ms ± 3%  +0.83%  (p=0.029 n=29+30)

name       old alloc/op     new alloc/op     delta
Template       40.7MB ± 0%      39.4MB ± 0%  -3.26%  (p=0.000 n=29+26)
Unicode        30.8MB ± 0%      30.7MB ± 0%  -0.40%  (p=0.000 n=28+30)
GoTypes         123MB ± 0%       119MB ± 0%  -3.47%  (p=0.000 n=30+29)
Compiler        472MB ± 0%       455MB ± 0%  -3.60%  (p=0.000 n=30+30)
Flate          26.5MB ± 0%      25.6MB ± 0%  -3.21%  (p=0.000 n=28+30)
GoParser       32.3MB ± 0%      31.4MB ± 0%  -2.98%  (p=0.000 n=29+30)
Reflect        84.4MB ± 0%      82.1MB ± 0%  -2.83%  (p=0.000 n=30+30)
Tar            27.3MB ± 0%      26.5MB ± 0%  -2.70%  (p=0.000 n=29+29)
XML            44.6MB ± 0%      43.1MB ± 0%  -3.49%  (p=0.000 n=30+30)

name       old allocs/op    new allocs/op    delta
Template         401k ± 1%        399k ± 0%  -0.35%  (p=0.000 n=30+28)
Unicode          331k ± 0%        331k ± 1%    ~     (p=0.907 n=28+30)
GoTypes         1.24M ± 0%       1.23M ± 0%  -0.43%  (p=0.000 n=30+30)
Compiler        4.26M ± 0%       4.25M ± 0%  -0.34%  (p=0.000 n=29+30)
Flate            252k ± 1%        251k ± 1%  -0.41%  (p=0.000 n=30+30)
GoParser         325k ± 1%        324k ± 1%  -0.31%  (p=0.000 n=27+30)
Reflect         1.06M ± 0%       1.05M ± 0%  -0.69%  (p=0.000 n=30+30)
Tar              266k ± 1%        265k ± 1%  -0.51%  (p=0.000 n=29+30)
XML              416k ± 1%        415k ± 1%  -0.36%  (p=0.002 n=30+30)

Change-Id: I8f784001324df83b2764c44f0e83a540e5beab34
Reviewed-on: https://go-review.googlesource.com/36212
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-02 22:39:32 +00:00
Cherry Zhang
f69a6defd1 runtime: skip flaky TestGdbPythonCgo on MIPS
It seems the problem is on gdb and the dynamic linker. Skip the
test for now until we figure out what's going on with the system.

Updates #18784.

Change-Id: Ic9320ffd463f6c231b2c4192652263b1cf7f4231
Reviewed-on: https://go-review.googlesource.com/36250
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-02 21:45:42 +00:00
Jaana Burcu Dogan
ecbf908404 doc: consistently link to the SettingGOPATH page
Change-Id: I4fdd81aa7c9b180cb72ec4af3e7d9d803c99ecac
Reviewed-on: https://go-review.googlesource.com/36033
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-02 21:31:33 +00:00
Cherry Zhang
6ad2d6aa92 cmd/compile: simplify IsNonNil ConstNil
Change-Id: I9ed5a2065cef06708e319b16c801da2eff42004e
Reviewed-on: https://go-review.googlesource.com/35497
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-02 21:28:50 +00:00
Cherry Zhang
fddc004537 cmd/compile: remove nil check for Zero/Move on 386, AMD64, S390X
Fixes #18003.

Change-Id: Iadcc5c424c64badecfb5fdbd4dbd9197df56182c
Reviewed-on: https://go-review.googlesource.com/33421
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-02 21:28:38 +00:00
Robert Griesemer
c1363b2d91 cmd/compile: provide line number for cgo directive error (fix a TODO)
Also: Remove double "go:" prefix in related error message.

Fixes #18882.

Change-Id: Ifbbd8e2f7529b43f035d3dbf7ca4a91f212bc6b6
Reviewed-on: https://go-review.googlesource.com/36121
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-02-02 21:24:50 +00:00
Lars Wiegman
e546b295b8 runtime: use mach_absolute_time for runtime.nanotime
The existing darwin/amd64 implementation of runtime.nanotime returns the
wallclock time, which results in timers not functioning properly when
system time runs backwards. By implementing the algorithm used by the
darwin syscall mach_absolute_time, timers will function as expected.

The algorithm is described at
https://opensource.apple.com/source/xnu/xnu-3248.60.10/libsyscall/wrappers/mach_absolute_time.s

Fixes #17610

Change-Id: I9c8d35240d48249a6837dca1111b1406e2686f67
Reviewed-on: https://go-review.googlesource.com/35292
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-02 21:20:40 +00:00
Josh Bleecher Snyder
8958d8ce37 cmd/compile: skip convT2E for empty structs
Fixes #18402

Change-Id: I5af800857fb2e365ce4224eece9171277106ec7d
Reviewed-on: https://go-review.googlesource.com/35562
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-02-02 21:06:28 +00:00
Keith Randall
3d5eb4a6be cmd/compile: better implementation of Slicemask
Use (-x)>>63 instead of ((x-1)>>63)^-1 to get a mask that
is 0 when x is 0 and all ones when x is positive.

Saves one instruction when slicing.

Change-Id: Ib46d53d3aac6530ac481fa2f265a6eadf3df0567
Reviewed-on: https://go-review.googlesource.com/35641
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-02-02 21:05:34 +00:00