]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
8 years agodoc: use new Gerrit URL and mention our instance in CONTRIBUTING.md
Andrew Gerrand [Wed, 9 Mar 2016 00:30:24 +0000 (11:30 +1100)]
doc: use new Gerrit URL and mention our instance in CONTRIBUTING.md

Fixes #14662

Change-Id: I8f7d5e8d2dd8dc763e940e061b424427359246e7
Reviewed-on: https://go-review.googlesource.com/20462
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: update issue template
Andrew Gerrand [Fri, 26 Feb 2016 03:35:42 +0000 (14:35 +1100)]
doc: update issue template

Change-Id: Iaa23d27043e6a050075b40072e466623418ba977
Reviewed-on: https://go-review.googlesource.com/19878
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/compile: simplify Iter
Matthew Dempsky [Tue, 8 Mar 2016 23:02:40 +0000 (15:02 -0800)]
cmd/compile: simplify Iter

Passes toolstash -cmp.

Change-Id: I325b02dcc8412ded0dc304d43377c0bdf59c66a8
Reviewed-on: https://go-review.googlesource.com/20405
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc: remove link to empty Go 1.5.3 milestone
Andrew Gerrand [Wed, 9 Mar 2016 00:08:19 +0000 (11:08 +1100)]
doc: remove link to empty Go 1.5.3 milestone

Fixes #14687

Change-Id: I51fd8842d35c82db71cc5b28c4c0550871461eb6
Reviewed-on: https://go-review.googlesource.com/20421
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: remove rtype *uncommonType field
David Crawshaw [Sun, 21 Feb 2016 03:54:15 +0000 (22:54 -0500)]
cmd/compile: remove rtype *uncommonType field

Instead of a pointer on every rtype, use a bit flag to indicate that
the contents of uncommonType directly follows the rtype value when it
is needed.

This requires a bit of juggling in the compiler's rtype encoder. The
backing arrays for fields in the rtype are presently encoded directly
after the slice header. This packing requires separating the encoding
of the uncommonType slice headers from their backing arrays.

Reduces binary size of godoc by ~180KB (1.5%).
No measurable change in all.bash time.
For #6853.

Change-Id: I60205948ceb5c0abba76fdf619652da9c465a597
Reviewed-on: https://go-review.googlesource.com/19790
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: guard the &-to-<<>> opt against small constants
David Chase [Tue, 8 Mar 2016 20:08:25 +0000 (15:08 -0500)]
cmd/compile: guard the &-to-<<>> opt against small constants

Converting an and-K into a pair of shifts for K that will
fit in a one-byte argument is probably not an optimization,
and it also interferes with other patterns that we want to
see fire, like (<< (AND K)) [for small K] and bounds check
elimination for masked indices.

Turns out that on Intel, even 32-bit signed immediates beat
the shift pair; the size reduction of tool binaries is 0.09%
vs 0.07% for only the 8-bit immediates.

RLH found this one working on the new/next GC.

Change-Id: I2414a8de1dd58d680d18587577fbadb7ff4f67d9
Reviewed-on: https://go-review.googlesource.com/20410
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: David Chase <drchase@google.com>

8 years agocmd/compile: relocate a bunch of Type-related code
Matthew Dempsky [Tue, 8 Mar 2016 22:31:22 +0000 (14:31 -0800)]
cmd/compile: relocate a bunch of Type-related code

Some cleaned up documentation, but no code changes.

Change-Id: I145398bb6d118c626ab3873ef75dbb64ebc286e9
Reviewed-on: https://go-review.googlesource.com/20404
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocrypto/tls: test for timeout error using the net.Error interface
Brad Fitzpatrick [Tue, 8 Mar 2016 22:10:28 +0000 (22:10 +0000)]
crypto/tls: test for timeout error using the net.Error interface

Don't do a substring search to test for a timeout error.

Fixes #14722 (maybe)

Change-Id: I4e18c749d6fd92c084a1b0b83a805119e1ae5ff2
Reviewed-on: https://go-review.googlesource.com/20403
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile/internal/ssa: simplify nil checks in opt.
Alexandru Moșoi [Mon, 7 Mar 2016 18:29:15 +0000 (19:29 +0100)]
cmd/compile/internal/ssa: simplify nil checks in opt.

* Simplify the nilcheck generated by
for _, e := range a {}
* No effect on the generated code because these nil checks
don't end up in the generated code.
* Useful for other analysis, e.g. it'll remove one dependecy
on the induction variable.

Change-Id: I6ee66ddfdc010ae22aea8dca48163303d93de7a9
Reviewed-on: https://go-review.googlesource.com/20307
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocmd/compile: cleanup compile function
Matthew Dempsky [Tue, 8 Mar 2016 06:05:49 +0000 (22:05 -0800)]
cmd/compile: cleanup compile function

Make more idiomatic with a defer cleanup, which allows declaring
variables closer to their first use, rather than up front before the
first goto statement.

Also, split the legacy code generation code path into a separate
genlegacy function, analogous to the new genssa.

Passes toolstash -cmp.

Change-Id: I86c22838704f6861b75716ae64ba103b0e73b12f
Reviewed-on: https://go-review.googlesource.com/20353
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/internal/obj: more Optab range simplification
Matthew Dempsky [Tue, 8 Mar 2016 04:30:38 +0000 (20:30 -0800)]
cmd/internal/obj: more Optab range simplification

Same idea as golang.org/cl/20322.

Passes toolstash/buildall.

Change-Id: Ida5960e57ff6e1e8de75c2720f21aeae56a8e415
Reviewed-on: https://go-review.googlesource.com/20352
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: fix old comment references to go.y
Brad Fitzpatrick [Tue, 8 Mar 2016 18:57:19 +0000 (18:57 +0000)]
cmd/compile: fix old comment references to go.y

Change-Id: Iec323998133ef20ff962f06a46d15dd342a82f5f
Reviewed-on: https://go-review.googlesource.com/20390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoos/user: make OS-specific getgrouplist calls
Ross Light [Tue, 8 Mar 2016 00:21:30 +0000 (16:21 -0800)]
os/user: make OS-specific getgrouplist calls

getgrouplist is non-standard and has slightly different semantics on
each platform.  Darwin defines the function in terms of ints instead of
gid_ts.  Solaris only recently supported the call, so stubbing out for
now.

Fixes #14696
Fixes #14709

Change-Id: I5a44538d41594909efb6f3f9610c55d638c36757
Reviewed-on: https://go-review.googlesource.com/20348
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: remove useless declaration of llit
Ian Lance Taylor [Tue, 8 Mar 2016 20:37:35 +0000 (12:37 -0800)]
cmd/compile: remove useless declaration of llit

Accidentally added in https://golang.org/cl/20242.

This is in preparation for transformation by an automated tool.

Passes toolstash -cmp.

Update #14473.

Change-Id: I28c637d220df3ccaa8e368bfbea7282a6e66662e
Reviewed-on: https://go-review.googlesource.com/20402
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: ignore C files when CGO_ENABLED=0
Russ Cox [Thu, 28 Jan 2016 16:44:07 +0000 (11:44 -0500)]
cmd/go: ignore C files when CGO_ENABLED=0

Before, those C files might have been intended for the Plan 9 C compiler,
but that option was removed in Go 1.5. We can simplify the maintenance
of cgo packages now if we assume C files (and C++ and M and SWIG files)
should only be considered when cgo is enabled.

Also remove newly unnecessary build tags in runtime/cgo's C files.

Fixes #14123

Change-Id: Ia5a7fe62b9469965aa7c3547fe43c6c9292b8205
Reviewed-on: https://go-review.googlesource.com/19613
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: fix bug in vmatch1 list traversal nodeSeq change
Ian Lance Taylor [Tue, 8 Mar 2016 19:16:19 +0000 (11:16 -0800)]
cmd/compile: fix bug in vmatch1 list traversal nodeSeq change

Bug accidentally inserted in https://golang.org/cl/20210.  Doesn't seem
to make a difference, but restore original code anyhow.

Update #14473.

Change-Id: I9cf87987ff158e27c7231027819317cdde8c132c
Reviewed-on: https://go-review.googlesource.com/20401
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http/httptest: record trailing headers in ResponseRecorder
Caio Marcelo de Oliveira Filho [Mon, 29 Feb 2016 20:46:48 +0000 (17:46 -0300)]
net/http/httptest: record trailing headers in ResponseRecorder

Trailers() returns the headers that were set by the handler after the
headers were written "to the wire" (in this case HeaderMap) and that
were also specified in a proper header called "Trailer".

Neither HeaderMap or trailerMap (used for Trailers()) are manipulated by
the handler code, instead a third stagingMap is given to the
handler. This avoid a reference kept by handler to affect the recorded
results.

If a handler just modify the header but doesn't call any Write or Flush
method from ResponseWriter (or Flusher) interface, HeaderMap will not be
updated. In this case, calling Flush in the recorder is enough to get
the HeaderMap filled.

Fixes #14531.
Fixes #8857.

Change-Id: I42842341ec3e95c7b87d7e6f178c65cd03d63cc3
Reviewed-on: https://go-review.googlesource.com/20047
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: attach correct line number for fallthru-return
David Chase [Tue, 8 Mar 2016 18:26:44 +0000 (13:26 -0500)]
cmd/compile: attach correct line number for fallthru-return

Fixes #14646.

Change-Id: I0bb82ed6d3533633cd8369ba37aa467948bbe155
Reviewed-on: https://go-review.googlesource.com/20381
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: gofmt
Brad Fitzpatrick [Tue, 8 Mar 2016 19:16:04 +0000 (19:16 +0000)]
cmd/compile: gofmt

Change-Id: I754861147838d0f6c184d8deb8a028062a1d3214
Reviewed-on: https://go-review.googlesource.com/20400
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile, cmd/link: eliminate string merging pass
Russ Cox [Tue, 8 Mar 2016 03:48:07 +0000 (22:48 -0500)]
cmd/compile, cmd/link: eliminate string merging pass

Deleting the string merging pass makes the linker 30-35% faster
but makes jujud (using the github.com/davecheney/benchjuju snapshot) 2.5% larger.
Two optimizations bring the space overhead down to 0.6%.

First, change the default alignment for string data to 1 byte.
(It was previously defaulting to larger amounts, usually pointer width.)

Second, write out the type string for T (usually a bigger expression) as "*T"[1:],
so that the type strings for T and *T share storage.

Combined, these obtain the bulk of the benefit of string merging
at essentially no cost. The remaining benefit from string merging
is not worth the excessive cost, so delete it.

As penance for making the jujud binary 0.6% larger,
the next CL in this sequence trims the reflect functype
information enough to make the jujud binary overall 0.75% smaller
(that is, that CL has a net -1.35% effect).

For #6853.
Fixes #14648.

Change-Id: I3fdd74c85410930c36bb66160ca4174ed540fc6e
Reviewed-on: https://go-review.googlesource.com/20334
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agocmd/newlink: delete
Russ Cox [Tue, 8 Mar 2016 17:47:49 +0000 (12:47 -0500)]
cmd/newlink: delete

cmd/link is clearly the way forward.
The original rationale for cmd/newlink was that it would be a clean Go reimplementation.
But when push came to shove, cmd/link got converted from C instead,
and all the work on build modes and the like is in cmd/link now.
Cleaning up cmd/link is likely a much better plan.

This directory is something to delete from releases and the
testdata is something that breaks every time the .6 format changes.
Fix both problems by just deleting it outright.

Change-Id: Ib00fecda258ba685f1752725971182af9d4459eb
Reviewed-on: https://go-review.googlesource.com/20380
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: remove nodesOrNodeList outside of syntax.go
Ian Lance Taylor [Tue, 8 Mar 2016 18:26:20 +0000 (10:26 -0800)]
cmd/compile: remove nodesOrNodeList outside of syntax.go

Passes toolstash -cmp.

Update #14473.

Change-Id: I717ebd948dfc8faf8b9ef5aa02c67484af618d18
Reviewed-on: https://go-review.googlesource.com/20359
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: preallocate storage for three Value args
Josh Bleecher Snyder [Mon, 7 Mar 2016 05:22:11 +0000 (21:22 -0800)]
cmd/compile: preallocate storage for three Value args

benchstat master2 arg3b
name      old time/op    new time/op    delta
Template     441ms ± 4%     444ms ± 6%    ~     (p=0.335 n=22+25)
GoTypes      1.51s ± 2%     1.51s ± 2%    ~     (p=0.129 n=25+21)
Compiler     5.59s ± 1%     5.56s ± 2%  -0.65%  (p=0.001 n=24+21)

name      old alloc/op   new alloc/op   delta
Template    85.6MB ± 0%    85.3MB ± 0%  -0.40%  (p=0.000 n=25+24)
GoTypes      307MB ± 0%     305MB ± 0%  -0.38%  (p=0.000 n=25+25)
Compiler    1.06GB ± 0%    1.05GB ± 0%  -0.43%  (p=0.000 n=25+25)

name      old allocs/op  new allocs/op  delta
Template     1.10M ± 0%     1.09M ± 0%  -1.04%  (p=0.000 n=25+25)
GoTypes      3.36M ± 0%     3.32M ± 0%  -1.13%  (p=0.000 n=25+24)
Compiler     13.0M ± 0%     12.9M ± 0%  -1.12%  (p=0.000 n=25+25)

Change-Id: I1280b846e895c00b95bb6664958a7765bd819610
Reviewed-on: https://go-review.googlesource.com/20296
Reviewed-by: Keith Randall <khr@golang.org>
8 years agoos/user: skip Current test on android
Brad Fitzpatrick [Tue, 8 Mar 2016 15:58:20 +0000 (15:58 +0000)]
os/user: skip Current test on android

Also, add more failure output to debug why linux/mips64le and
linux/ppc64 are failing. They should be working. I suspect their
builder test envs are missing something.

Change-Id: I97273fe72c4e3009db400394636d0da1ef147485
Reviewed-on: https://go-review.googlesource.com/20358
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agohash/crc32: use slicing by 8 for Castagnoli and smaller sizes
Klaus Post [Tue, 8 Mar 2016 14:57:12 +0000 (15:57 +0100)]
hash/crc32: use slicing by 8 for Castagnoli and smaller sizes

This adds "slicing by 8" optimization to Castagnoli tables which will
speed up CRC32 calculation on systems without asssembler,
which are all but AMD64.

In my tests, it is faster to use "slicing by 8" for sizes all down to
16 bytes, so the switchover point has been adjusted.

There are no benchmarks for small sizes, so I have added one for 40 bytes,
as well as one for bigger sizes (32KB).

Castagnoli, No assembler, 40 Byte payload: (before, after)
BenchmarkCastagnoli40B-4   10000000     161 ns/op         246.94 MB/s
BenchmarkCastagnoli40B-4   20000000     100 ns/op         398.01 MB/s

Castagnoli, No assembler, 32KB payload: (before, after)
BenchmarkCastagnoli32KB-4     10000     115426 ns/op      283.89 MB/s
BenchmarkCastagnoli32KB-4     30000     45171 ns/op       725.41 MB/s

IEEE, No assembler, 1KB payload: (before, after)
BenchmarkCrc1KB-4       500000     3604 ns/op         284.10 MB/s
BenchmarkCrc1KB-4      1000000     1463 ns/op         699.79 MB/s

Compared:
benchmark                     old ns/op     new ns/op     delta
BenchmarkCastagnoli40B-4      161           100           -37.89%
BenchmarkCastagnoli32KB-4     115426        45171         -60.87%
BenchmarkCrc1KB-4             3604          1463          -59.41%

benchmark                     old MB/s     new MB/s     speedup
BenchmarkCastagnoli40B-4      246.94       398.01       1.61x
BenchmarkCastagnoli32KB-4     283.89       725.41       2.56x
BenchmarkCrc1KB-4             284.10       699.79       2.46x

Change-Id: I303e4ec84e8d4dafd057d64c0e43deb2b498e968
Reviewed-on: https://go-review.googlesource.com/19335
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: cache const nil, iface, slice, and ""
Josh Bleecher Snyder [Mon, 7 Mar 2016 02:06:09 +0000 (18:06 -0800)]
cmd/compile: cache const nil, iface, slice, and ""

name      old time/op    new time/op    delta
Template     441ms ± 4%     446ms ± 4%  +1.23%  (p=0.048 n=22+25)
GoTypes      1.51s ± 2%     1.51s ± 2%    ~     (p=0.224 n=25+25)
Compiler     5.59s ± 1%     5.57s ± 2%  -0.38%  (p=0.019 n=24+24)

name      old alloc/op   new alloc/op   delta
Template    85.6MB ± 0%    85.6MB ± 0%  -0.11%  (p=0.000 n=25+24)
GoTypes      307MB ± 0%     305MB ± 0%  -0.45%  (p=0.000 n=25+25)
Compiler    1.06GB ± 0%    1.06GB ± 0%  -0.34%  (p=0.000 n=25+25)

name      old allocs/op  new allocs/op  delta
Template     1.10M ± 0%     1.10M ± 0%  -0.03%  (p=0.001 n=25+24)
GoTypes      3.36M ± 0%     3.35M ± 0%  -0.13%  (p=0.000 n=25+25)
Compiler     13.0M ± 0%     13.0M ± 0%  -0.12%  (p=0.000 n=25+24)

Change-Id: I7fc18acbc3b1588aececef9692e24a0bd3dba974
Reviewed-on: https://go-review.googlesource.com/20295
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocmd/compile: fix comment accuracy after recent change
Brad Fitzpatrick [Tue, 8 Mar 2016 07:05:31 +0000 (07:05 +0000)]
cmd/compile: fix comment accuracy after recent change

Change-Id: Ifa09bccb8482a6141d0aa862cef674fade30e2eb
Reviewed-on: https://go-review.googlesource.com/20355
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: simplify eq and hash function generation
Matthew Dempsky [Tue, 8 Mar 2016 11:40:50 +0000 (03:40 -0800)]
cmd/compile: simplify eq and hash function generation

Passes toolstash -cmp.

Change-Id: Ie4675e6f713c3bbb90556f5347cbd7268a9c1a5d
Reviewed-on: https://go-review.googlesource.com/20357
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: remove nodesOrNodeListPtr outside of syntax.go
Ian Lance Taylor [Tue, 8 Mar 2016 06:54:46 +0000 (22:54 -0800)]
cmd/compile: remove nodesOrNodeListPtr outside of syntax.go

Passes toolstash -cmp.

Update #14473.

Change-Id: I2620374b79c61b1e48467b98afe2d7d3beef878b
Reviewed-on: https://go-review.googlesource.com/20354
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: fix lineno restoration after SSA compilation
Matthew Dempsky [Mon, 7 Mar 2016 18:12:19 +0000 (10:12 -0800)]
cmd/compile: fix lineno restoration after SSA compilation

Without SSA:

$ go build -a -gcflags='-S -ssa=0' runtime 2>&1 | grep 'TEXT.*""\.init(SB)'
        0x0000 00000 ($GOROOT/src/runtime/write_err.go:14)        TEXT    "".init(SB), $88-0

With SSA, before this CL:

$ go build -a -gcflags='-S -ssa=1' runtime 2>&1 | grep 'TEXT.*""\.init(SB)'
        0x0000 00000 ($GOROOT/src/runtime/traceback.go:608)       TEXT    "".init(SB), $152-0

With SSA, after this CL:

$ go build -a -gcflags='-S -ssa=1' runtime 2>&1 | grep 'TEXT.*""\.init(SB)'
        0x0000 00000 ($GOROOT/src/runtime/write_err.go:14)        TEXT    "".init(SB), $152-0

Change-Id: Ida3541e03a1af6ffc753ee5c3abeb653459edbf6
Reviewed-on: https://go-review.googlesource.com/20321
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agodarwin/amd64: fix text-relocation issues for c-archive libraries

Aaron Zinman [Thu, 4 Feb 2016 01:36:15 +0000 (17:36 -0800)]
darwin/amd64: fix text-relocation issues for c-archive libraries


The existing implementation deals with absolute relocations in __TEXT
for darwin/amd64 in build-mode c-shared, but it ignores c-archive.
This results in issues when trying to use a c-archive in an iOS
app on the 64-bit simulator. This patch adds c-archive to the
handling of this issue.

Fixes #14217

Change-Id: I2e4d5193caa531171ad22fd0cd420a8bfb4646a6
Reviewed-on: https://go-review.googlesource.com/19206
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/internal/obj: add As type for assembly opcodes
Matthew Dempsky [Tue, 8 Mar 2016 02:00:08 +0000 (18:00 -0800)]
cmd/internal/obj: add As type for assembly opcodes

Passes toolstash/buildall.

Fixes #14692.

Change-Id: I4352678d8251309f2b8b7793674c550fac948006
Reviewed-on: https://go-review.googlesource.com/20350
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: Tinkering with schedule for debug and regalloc
David Chase [Fri, 4 Mar 2016 19:19:49 +0000 (14:19 -0500)]
cmd/compile: Tinkering with schedule for debug and regalloc

This adds a heap-based proper priority queue to the
scheduler which made a relatively easy to test quite a few
heuristics that "ought to work well".  For go tools
themselves (which may not be representative) the heuristic
that works best is (1) in line-number-order, then (2) from
more to fewer args, then (3) in variable ID order.  Trying
to improve this with information about use at end of
blocks turned out to be fruitless -- all of my naive
attempts at using that information turned out worse than
ignoring it.  I can confirm that the stores-early heuristic
tends to help; removing it makes the results slightly worse.

My metric is code size reduction, which I take to mean fewer
spills from register allocation.  It's not uniform.
Here's the endpoints for "vet" from one set of pretty-good
heuristics (this is representative at least).

-2208 time.parse 13472 15680 -14.081633%
-1514 runtime.pclntab 1002058 1003572 -0.150861%
-352 time.Time.AppendFormat 9952 10304 -3.416149%
-112 runtime.runGCProg 1984 2096 -5.343511%
-64 regexp/syntax.(*parser).factor 7264 7328 -0.873362%
-44 go.string.alldata 238630 238674 -0.018435%

48 math/big.(*Float).round 1376 1328 3.614458%
48 text/tabwriter.(*Writer).writeLines 1232 1184 4.054054%
48 math/big.shr 832 784 6.122449%
88 go.func.* 75174 75086 0.117199%
96 time.Date 1968 1872 5.128205%

Overall there appears to be an 0.1% decrease in text size.
No timings yet, and given the distribution of size reductions
it might make sense to wait on those.

addr2line  text (code) = -4392 bytes (-0.156273%)
api  text (code) = -5502 bytes (-0.147644%)
asm  text (code) = -5254 bytes (-0.187810%)
cgo  text (code) = -4886 bytes (-0.148846%)
compile  text (code) = -1577 bytes (-0.019346%) * changed
cover  text (code) = -5236 bytes (-0.137992%)
dist  text (code) = -5015 bytes (-0.167829%)
doc  text (code) = -5180 bytes (-0.182121%)
fix  text (code) = -5000 bytes (-0.215148%)
link  text (code) = -5092 bytes (-0.152712%)
newlink  text (code) = -5204 bytes (-0.196986%)
nm  text (code) = -4398 bytes (-0.156018%)
objdump  text (code) = -4582 bytes (-0.155046%)
pack  text (code) = -4503 bytes (-0.294287%)
pprof  text (code) = -6314 bytes (-0.085177%)
trace  text (code) = -5856 bytes (-0.097818%)
vet  text (code) = -5696 bytes (-0.117334%)
yacc  text (code) = -4971 bytes (-0.213817%)

This leaves me sorely tempted to look into a "real" scheduler
to try to do a better job, but I think it might make more
sense to look into getting loop information into the
register allocator instead.

Fixes #14577.

Change-Id: I5238b83284ce76dea1eb94084a8cd47277db6827
Reviewed-on: https://go-review.googlesource.com/20240
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocmd/compile: fix load combining from a non-zero pointer offset
Todd Neal [Tue, 8 Mar 2016 00:43:05 +0000 (18:43 -0600)]
cmd/compile: fix load combining from a non-zero pointer offset

When the pointer offset is non-zero in the small loads, we need to add the offset
when converting to the larger load.

Fixes #14694

Change-Id: I5ba8bcb3b9ce26c7fae0c4951500b9ef0fed54cd
Reviewed-on: https://go-review.googlesource.com/20333
Reviewed-by: Keith Randall <khr@golang.org>
8 years agoruntime: listen 127.0.0.1 instead of localhost on android
Burcu Dogan [Mon, 7 Mar 2016 21:41:27 +0000 (13:41 -0800)]
runtime: listen 127.0.0.1 instead of localhost on android

Fixes #14486.
Related to #14485.

Change-Id: I2dd77b0337aebfe885ae828483deeaacb500b12a
Reviewed-on: https://go-review.googlesource.com/20340
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/internal/obj: stop using as+ALAST as an opcode
Matthew Dempsky [Mon, 7 Mar 2016 23:15:57 +0000 (15:15 -0800)]
cmd/internal/obj: stop using as+ALAST as an opcode

Currently, package obj reserves a range of 1<<12 opcodes for each
target architecture.  E.g., mips64 has [6<<12, 7<<12).

However, because mips.ABEQ and mips.ALAST are both within that range,
the expression mips.ABEQ+mips.ALAST in turn falls (far) outside that
range around 12<<12, meaning it could theoretically collide with
another arch's opcodes.

More practically, it's a problem because 12<<12 overflows an int16,
which hampers fixing #14692.  (We could also just switch to uint16 to
avoid the overflow, but that still leaves the first problem.)

As a workaround, use Michael Hudson-Doyle's solution from
https://golang.org/cl/20182 and use negative values for these variant
instructions.

Passes toolstash -cmp for GOARCH=arm and GOARCH=mips64.

Updates #14692.

Change-Id: Iad797d10652360109fa4db19d4d1edb6529fc2c0
Reviewed-on: https://go-review.googlesource.com/20345
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agogo/build: introduce go1.7 build tag
Brad Fitzpatrick [Mon, 7 Mar 2016 23:11:37 +0000 (23:11 +0000)]
go/build: introduce go1.7 build tag

This is needed now for subrepos to be able to conditionally use
API symbols found only after Go 1.6.

Change-Id: Ie7d9301332aa1739b585d93f8025424ae72a2430
Reviewed-on: https://go-review.googlesource.com/20344
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: TimeoutHandler should start timer when serving request
Caio Marcelo de Oliveira Filho [Mon, 29 Feb 2016 15:06:57 +0000 (12:06 -0300)]
net/http: TimeoutHandler should start timer when serving request

TimeoutHandler was starting the Timer when the handler was created,
instead of when serving a request. It also was sharing it between
multiple requests, which is incorrect, as the requests might start
at different times.

Store the timeout duration and create the Timer when ServeHTTP is
called. Different requests will have different timers.

The testing plumbing was simplified to store the channel used to
control when timeout happens. It overrides the regular timer.

Fixes #14568.

Change-Id: I4bd51a83f412396f208682d3ae5e382db5f8dc81
Reviewed-on: https://go-review.googlesource.com/20046
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: change Node fields from *NodeList to Nodes
Ian Lance Taylor [Mon, 7 Mar 2016 22:32:18 +0000 (14:32 -0800)]
cmd/compile: change Node fields from *NodeList to Nodes

Compile time is about the same.  Getting rid of the nodeSeq interfaces,
particularly nodeSeqIterate, should produce some improvements.

Passes toolstash -cmp.

Update #14473.

Change-Id: I678abafdd9129c6cccb0ec980511932eaed496a0
Reviewed-on: https://go-review.googlesource.com/20343
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: inline list storage stealing
Josh Bleecher Snyder [Sun, 6 Mar 2016 00:25:58 +0000 (16:25 -0800)]
cmd/compile: inline list storage stealing

It is only necessary in a few places, and this inlining will
simplify the transition away from NodeLists.

Passes toolstash -cmp.

Change-Id: I4ee9b4bf56ffa04df23e20a0a83b302d36b33510
Reviewed-on: https://go-review.googlesource.com/20290
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/vet: remove -test flag
Konstantin Shaposhnikov [Tue, 1 Mar 2016 14:55:06 +0000 (22:55 +0800)]
cmd/vet: remove -test flag

-test flag is a testing only flag that enables all vet checks. It was needed
because there was no way to run all vet checks in a single command
invocation. However it is possible to do this now by combining -all and -shadow
flags.

Also a recently added -tests flag is similarly named, having both -test and
-tests can be confusing.

Change-Id: Ie5bacbe0bef5c8409eeace46f16141fa4e782c32
Reviewed-on: https://go-review.googlesource.com/20006
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: remove NodeList != NodeList comparisons
Josh Bleecher Snyder [Wed, 10 Jun 2015 22:31:53 +0000 (15:31 -0700)]
cmd/compile: remove NodeList != NodeList comparisons

Opt for replacements that avoid any assumptions
about the representations in use.

Passes toolstash -cmp.

Change-Id: Ia858a33abcae344e03fc1862fc9b0e192fde80c1
Reviewed-on: https://go-review.googlesource.com/20279
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: add sizeof test for ssa types
Josh Bleecher Snyder [Mon, 7 Mar 2016 02:05:41 +0000 (18:05 -0800)]
cmd/compile: add sizeof test for ssa types

Fix some test output while we're here.

Change-Id: I265cedc222e078eff120f268b92451e12b0400b2
Reviewed-on: https://go-review.googlesource.com/20294
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoos, syscall: skip tests when environment doesn't permit testing
Brad Fitzpatrick [Mon, 7 Mar 2016 22:11:48 +0000 (22:11 +0000)]
os, syscall: skip tests when environment doesn't permit testing

Fixes #14693

Change-Id: Id0a6a80b4c37c0b0f1c2755667b7233ed8964e40
Reviewed-on: https://go-review.googlesource.com/20342
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: fix checkmark scanning of finalizers
Austin Clements [Mon, 7 Mar 2016 22:10:19 +0000 (17:10 -0500)]
runtime: fix checkmark scanning of finalizers

Currently work.finalizersDone is reset only at the beginning of
gcStart. As a result, it will be set when checkmark runs, so checkmark
will skip scanning finalizers. Hence, if there are any bugs that cause
the regular scan of finalizers to miss pointers, checkmark will also
miss them and fail to detect the missed pointer.

Fix this by resetting finalizersDone in gcResetMarkState. This way it
gets reset before any full mark, which is exactly what we want.

Change-Id: I4ddb5eba5b3b97e52aaf3e08fd9aa692bda32b20
Reviewed-on: https://go-review.googlesource.com/20332
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/internal/obj/mips: add ALUI const
Matthew Dempsky [Mon, 7 Mar 2016 21:45:52 +0000 (13:45 -0800)]
cmd/internal/obj/mips: add ALUI const

Instead of abusing ALAST.

Passes GOARCH=mips64 toolstash -cmp.

Updates #14692.

Change-Id: Ie85e99cf76508c1d0f5847a4157056b614fd5cc6
Reviewed-on: https://go-review.googlesource.com/20341
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agogo/types: don't emit conversion error in non-numeric increment/decrement
Caio Marcelo de Oliveira Filho [Sat, 5 Mar 2016 18:57:17 +0000 (15:57 -0300)]
go/types: don't emit conversion error in non-numeric increment/decrement

In increment and decrement statements, explicit check that the type
of operand is numeric. This avoids a related but less clear error
about converting "1" to be emitted.

So, when checking

package main

func main() {
var x bool
x++
}

instead of emitting the error

prog.go:5:2: cannot convert 1 (untyped int constant) to bool

emits

prog.go:5:2: invalid operation: x++ (non-numeric type bool).

Updates #12525.

Change-Id: I00aa6bd0bb23267a2fe10ea3f5a0b20bbf3552bc
Reviewed-on: https://go-review.googlesource.com/20244
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: eliminate unnecessary type conversions
Matthew Dempsky [Mon, 29 Feb 2016 23:01:00 +0000 (15:01 -0800)]
runtime: eliminate unnecessary type conversions

Automated refactoring produced using github.com/mdempsky/unconvert.

Change-Id: Iacf871a4f221ef17f48999a464ab2858b2bbaa90
Reviewed-on: https://go-review.googlesource.com/20071
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile/internal/ppc64: clean up table initalisation
Dave Cheney [Sun, 6 Mar 2016 07:40:43 +0000 (18:40 +1100)]
cmd/compile/internal/ppc64: clean up table initalisation

Move initproginfo and initvariants to ppc64.Main to avoid checking that
the tables are initialised every time.

Change-Id: I95ff4146a7abc18c42a20bfad716cc80ea8367e5
Reviewed-on: https://go-review.googlesource.com/20286
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoos/user: make Current work without cgo
Brad Fitzpatrick [Thu, 3 Mar 2016 20:54:24 +0000 (20:54 +0000)]
os/user: make Current work without cgo

Fixes #14626

Change-Id: I91c40407dc35355e5c5046f24111a126f99260d9
Reviewed-on: https://go-review.googlesource.com/20192
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
8 years agocmd/internal/obj: simplify Optab range handling code
Matthew Dempsky [Mon, 7 Mar 2016 19:36:05 +0000 (11:36 -0800)]
cmd/internal/obj: simplify Optab range handling code

Use slices as slices, instead of as clumsy pointers.

Passes toolstash/buildall.

Change-Id: If09eacc2d8805d7d5eaa5566f9b6305541074371
Reviewed-on: https://go-review.googlesource.com/20322
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoos/user: add LookupGroup, LookupGroupId, and User.GroupIds functions
Ross Light [Thu, 4 Feb 2016 23:39:00 +0000 (15:39 -0800)]
os/user: add LookupGroup, LookupGroupId, and User.GroupIds functions

As part of local testing with a large group member list, I discovered
that the lookup functions don't resize their buffer if they receive
ERANGE.  I fixed this as a side-effect of this CL.

Thanks to @andrenth for the original CL.

Fixes #2617

Change-Id: Ie6aae2fe0a89eae5cce85786869a8acaa665ffe9
Reviewed-on: https://go-review.googlesource.com/19235
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agomime/multipart: don't call Read on io.Reader after an error is seen
Brad Fitzpatrick [Mon, 7 Mar 2016 16:35:45 +0000 (08:35 -0800)]
mime/multipart: don't call Read on io.Reader after an error is seen

The io.Reader contract makes no promises about how a Reader should
behave after it returns its first error. Usually the errors are
sticky, but they don't have to be. A regression in zlib.Reader (bug
accidentally relied on sticky errors.

Minimal fix: wrap the user's provided Reader in a Reader which
guarantees stickiness. The minimal fix is less scary than touching
the multipart state machine.

Fixes #14676

Change-Id: I8dd8814b13ae5530824ae0e68529f788974264a5
Reviewed-on: https://go-review.googlesource.com/20297
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/internal/obj: remove unused ar.go
Matthew Dempsky [Mon, 7 Mar 2016 18:44:05 +0000 (10:44 -0800)]
cmd/internal/obj: remove unused ar.go

Change-Id: I3eab54cd27c43bab38641fbead4adb6442481356
Reviewed-on: https://go-review.googlesource.com/20248
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocompress/zlib: make errors persistent
Joe Tsai [Sun, 6 Mar 2016 23:51:57 +0000 (15:51 -0800)]
compress/zlib: make errors persistent

Ensure that all errors (including io.EOF) are persistent across method
calls on zlib.Reader. Furthermore, ensure that these persistent errors
are properly cleared when Reset is called.

Fixes #14675

Change-Id: I15a20c7e25dc38219e7e0ff255d1ba775a86bb47
Reviewed-on: https://go-review.googlesource.com/20292
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: more nodeSeq conversions
Ian Lance Taylor [Mon, 7 Mar 2016 17:36:24 +0000 (09:36 -0800)]
cmd/compile: more nodeSeq conversions

Found by temporarily flipping fields from *NodeList to Nodes and fixing
all the compilation errors.  This CL does not actually change any
fields.

Passes toolstash -cmp.

Update #14473.

Change-Id: Ib98fa37e8752f96358224c973a743618a6a0e736
Reviewed-on: https://go-review.googlesource.com/20320
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: change Oconv to take an Op parameter
Matthew Dempsky [Mon, 7 Mar 2016 16:23:55 +0000 (08:23 -0800)]
cmd/compile: change Oconv to take an Op parameter

Eliminates type conversions in a bunch of Oconv(int(n.Op), ...) calls.

Notably, this identified a misuse of Oconv in amd64/gsubr.go to try to
print an assembly instruction op instead of a compiler node op.

Change-Id: I93b5aa49fe14a5eaf868b05426d3b8cd8ab52bc5
Reviewed-on: https://go-review.googlesource.com/20298
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: new files for plan9_arm support
Richard Miller [Wed, 27 Jan 2016 16:31:24 +0000 (16:31 +0000)]
runtime: new files for plan9_arm support

Implementation more or less follows plan9_386 version.
Revised 7 March to correct a bug in runtime.seek and
tidy whitespace for 8-column tabs.

Change-Id: I2e921558b5816502e8aafe330530c5a48a6c7537
Reviewed-on: https://go-review.googlesource.com/18966
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: signal handling support for plan9_arm
Richard Miller [Wed, 27 Jan 2016 18:43:36 +0000 (18:43 +0000)]
runtime: signal handling support for plan9_arm

Plan 9 trap/signal handling differs on ARM from other architectures
because ARM has a link register.  Also trap message syntax varies
between different architectures (historical accident?).
Revised 7 March to clarify a comment.

Change-Id: Ib6485f82857a2f9a0d6b2c375cf0aaa230b83656
Reviewed-on: https://go-review.googlesource.com/18969
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: don't emit conversion error in non-numeric increment/decrement
Caio Marcelo de Oliveira Filho [Sat, 5 Mar 2016 20:36:56 +0000 (17:36 -0300)]
cmd/compile: don't emit conversion error in non-numeric increment/decrement

In increment and decrement statements, explicit check that the type
of operand is numeric earlier. This avoids a related but less clear
error about converting "1" to be emitted.

So, when compiling

package main

func main() {
var x bool
x++
}

instead of emitting two errors

prog.go:5: cannot convert 1 to type bool
prog.go:5: invalid operation: x++ (non-numeric type bool)

just emits the second error.

Fixes #12525.

Change-Id: I6e81330703765bef0d6eb6c57098c1336af7c799
Reviewed-on: https://go-review.googlesource.com/20245
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agocompress/flate: remove unused woffset field.
Nigel Tao [Sat, 5 Mar 2016 00:14:51 +0000 (11:14 +1100)]
compress/flate: remove unused woffset field.

Change-Id: Id0a12c76b0a6925f2926d38a1931157f9ef5f650
Reviewed-on: https://go-review.googlesource.com/20280
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: soup up isSamePtr
Josh Bleecher Snyder [Sat, 5 Mar 2016 02:55:09 +0000 (18:55 -0800)]
cmd/compile: soup up isSamePtr

This increases the number of matches in make.bash
from 853 to 984.

Change-Id: I12697697a50ecd86d49698200144a4c80dd3e5a4
Reviewed-on: https://go-review.googlesource.com/20274
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agoruntime: merge {bgMark,assist}StartTime
Austin Clements [Wed, 2 Mar 2016 22:27:59 +0000 (17:27 -0500)]
runtime: merge {bgMark,assist}StartTime

We used to start background mark workers and assists at different
times, so we needed to keep track of these separately. They're now set
to exactly the same time, so clean things up by merging them in to one
value, markStartTime.

Change-Id: I17c9843c3ed2d6f07b4c8cd0b2c438fc6de23b53
Reviewed-on: https://go-review.googlesource.com/20143
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
8 years agocmd/compile: use OffPtr when possible
Josh Bleecher Snyder [Fri, 4 Mar 2016 20:34:43 +0000 (12:34 -0800)]
cmd/compile: use OffPtr when possible

OffPtr allocates less and is easier to optimize.

With this change, the OffPtr collapsing opt
rule matches increase from 160k to 263k,
and the Load-after-Store opt rule matches
increase from 217 to 853.

Change-Id: I763426a3196900f22a367f7f6d8e8047b279653d
Reviewed-on: https://go-review.googlesource.com/20273
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocmd/compile: collapse OffPtr sequences
Josh Bleecher Snyder [Fri, 4 Mar 2016 22:12:44 +0000 (14:12 -0800)]
cmd/compile: collapse OffPtr sequences

This triggers an astonishing 160k times
during make.bash. The second biggest
generic rewrite triggers 100k times.

However, this is really just moving
rewrites that were happening at the
architecture level to the generic level.

Change-Id: Ife06fe5234f31433328460cb2e0741c071deda41
Reviewed-on: https://go-review.googlesource.com/20235
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agocmd/compile: Combine smaller loads into a larger load
Keith Randall [Fri, 4 Mar 2016 18:26:57 +0000 (10:26 -0800)]
cmd/compile: Combine smaller loads into a larger load

This only deals with the loads themselves.  The bounds checks
are a separate issue.  Also doesn't handle stores, those are
harder because we need to make sure intermediate memory states
aren't observed (which is hard to do with rewrite rules).

Use one byte shorter instructions for zero-extending loads.

Update #14267

Change-Id: I40af25ab5208488151ba7db32bf96081878fa7d9
Reviewed-on: https://go-review.googlesource.com/20218
Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile, cmd/link, cmd/newlink: remove support for weak symbols
Michael Hudson-Doyle [Sun, 6 Mar 2016 20:47:02 +0000 (09:47 +1300)]
cmd/compile, cmd/link, cmd/newlink: remove support for weak symbols

They were only used for rtype.ptrToThis which David Crawshaw removed a couple
of weeks ago. Removes two traversals of Ctxt.Allsym from the linker but it
doesn't seem to make much difference to performance.

Change-Id: I5c305e0180186f643221d57822d301de4aa18827
Reviewed-on: https://go-review.googlesource.com/20287
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: hide NodeList details in evconst
Josh Bleecher Snyder [Wed, 10 Jun 2015 01:37:26 +0000 (18:37 -0700)]
cmd/compile: hide NodeList details in evconst

The new code is a bit less efficient,
but it does not involve altering the structure
of any linked lists.
This will make it easier to replace NodeLists
with Node slices.
We can return to a more efficient algorithm
when NodeLists have been replaced.

Passes toolstash -cmp.

Change-Id: I0bb5ee75e7c0646e6d37fe558c8f0548729d8aa1
Reviewed-on: https://go-review.googlesource.com/20277
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoRewrite leftover references to plan9.bell-labs.com to 9p.io.
Muhammed Uluyol [Sun, 6 Mar 2016 04:51:25 +0000 (23:51 -0500)]
Rewrite leftover references to plan9.bell-labs.com to 9p.io.

Change-Id: Iadb4aa016a7b361d01827787dbc59164d5d147f2
Reviewed-on: https://go-review.googlesource.com/20291
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: use a uint8-sized named type for Addr.Type
Josh Bleecher Snyder [Fri, 15 May 2015 03:11:28 +0000 (20:11 -0700)]
cmd/compile: use a uint8-sized named type for Addr.Type

No immediate reduction in the size of Addr.

Passes toolstash -cmp.

Change-Id: I78ea4c6e181b6e571ce70a5f1ae8158844eb197d
Reviewed-on: https://go-review.googlesource.com/20276
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
8 years agocmd/compile/internal/gc: assert size of important types
Dave Cheney [Sun, 6 Mar 2016 02:04:52 +0000 (13:04 +1100)]
cmd/compile/internal/gc: assert size of important types

Add tests to ensure that the size of important types don't change
unexpectedly.

Skip the test on nacl platforms because of their unusual padding
requirements.

Change-Id: Iddb127a99499e089a309b721f5073356c0da8b24
Reviewed-on: https://go-review.googlesource.com/20285
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agofmt: refactor and unify float and complex formatting
Martin Möhrmann [Sat, 27 Feb 2016 13:37:10 +0000 (14:37 +0100)]
fmt: refactor and unify float and complex formatting

Removes specialized functions for each verb and float/complex size
and replaces them with generic variants fmtFloat and
fmtComplex similar to other generic fmt functions.

Simplifies the complex formatting by relying on fmtFloat
to handle the verb and default precision selection.

Complex imaginary formatting does not need to clear the f.space flag
because the set f.plus flag will force a sign instead of a space.

Sets default precision for %b to -1 (same as %g and %G)
since precision for %b has no affect in strconv.AppendFloat.

Add more tests and group them a bit better.
Use local copies of +Inf,-Inf and NaN instead
of math package functions for testing.

Saves around 8kb in the go binary.

name              old time/op  new time/op  delta
SprintfFloat-2     200ns ± 4%   196ns ± 4%  -1.55%  (p=0.007 n=20+20)
SprintfComplex-2   569ns ± 4%   570ns ± 3%    ~     (p=0.804 n=20+20)

Change-Id: I36d35dab6f835fc2bd2c042ac97705868eb2446f
Reviewed-on: https://go-review.googlesource.com/20252
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>

8 years agofmt: use fewer allocations for %q string formatting
Martin Möhrmann [Sat, 5 Mar 2016 10:33:13 +0000 (11:33 +0100)]
fmt: use fewer allocations for %q string formatting

Reuse the internal buffer and use append versions of
the strconv quote functions to avoid some allocations.

Add more tests.

name                  old time/op    new time/op    delta
SprintfQuoteString-2     486ns ± 2%     416ns ± 2%  -14.42%  (p=0.000 n=20+20)

name                  old allocs/op  new allocs/op  delta
SprintfQuoteString-2      4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=20+20)

Change-Id: I63795b51fd95c53c5993ec8e6e99b659941f9f54
Reviewed-on: https://go-review.googlesource.com/20251
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agofmt: optimize byte slice and array formatting for %v and %d
Martin Möhrmann [Thu, 3 Mar 2016 16:06:43 +0000 (17:06 +0100)]
fmt: optimize byte slice and array formatting for %v and %d

Instead of calling printArg in fmtBytes to format each byte call
the byte formatting functions directly since it is known each
element is of type byte.

Add more tests for byte slice and array formatting.

name            old time/op  new time/op  delta
SprintfBytes-2   843ns ±16%   417ns ±11%  -50.58%  (p=0.000 n=20+20)

Change-Id: I5b907dbf52091e3de9710b09d67649c76f4c17e9
Reviewed-on: https://go-review.googlesource.com/20176
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agoruntime: don't print EnableGC flag in WriteHeapProfile()
Hitoshi Mitake [Wed, 13 Jan 2016 14:06:27 +0000 (23:06 +0900)]
runtime: don't print EnableGC flag in WriteHeapProfile()

Current runtime.WriteHeapProfile() doesn't print correct
EnableGC. Even if GOGC=off, the result file has below line:
 # EnableGC = true

It is hard to print correct status of the variable because of corner
cases e.g. initialization. For avoiding confusion, this commit removes
the print.

Change-Id: Ia792454a6c650bdc50a06fbaff4df7b6330ae08a
Reviewed-on: https://go-review.googlesource.com/18600
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
8 years agocmd/compile: convert asmlist to []*Node
Matthew Dempsky [Sat, 5 Mar 2016 03:04:50 +0000 (19:04 -0800)]
cmd/compile: convert asmlist to []*Node

Updates #14473.

Change-Id: I88745c2a6119dea3b81b57299e70a2a7e4c584a8
Reviewed-on: https://go-review.googlesource.com/20272
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agofmt: float formatting should not permanently change width
Martin Möhrmann [Fri, 4 Mar 2016 14:52:35 +0000 (15:52 +0100)]
fmt: float formatting should not permanently change width

formatFloat should restore the original f.wid value before
returning. Callers should not have to save and restore f.wid.

Fixes: #14642
Change-Id: I531dae15c7997fe8909e2ad1ef7c376654afb030
Reviewed-on: https://go-review.googlesource.com/20179
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/compile: change parser, racewalk, range to use nodeSeq
Ian Lance Taylor [Fri, 4 Mar 2016 23:26:38 +0000 (15:26 -0800)]
cmd/compile: change parser, racewalk, range to use nodeSeq

Passes toolstash -cmp.

Update #14473.

Change-Id: I0809c6b88643f04c7fc503f866ffe25e69f29910
Reviewed-on: https://go-review.googlesource.com/20260
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: convert subr, swt, typecheck to nodeSeq
Ian Lance Taylor [Sat, 5 Mar 2016 01:28:07 +0000 (17:28 -0800)]
cmd/compile: convert subr, swt, typecheck to nodeSeq

Passes toolstash -cmp.

Update #14473.

Change-Id: I836197810405cde72cbb49fef7e163a517601f9c
Reviewed-on: https://go-review.googlesource.com/20242
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: stop leaking 'any' type into user package
Matthew Dempsky [Sat, 5 Mar 2016 00:39:07 +0000 (16:39 -0800)]
cmd/compile: stop leaking 'any' type into user package

The new check corresponds to the (etype != TANY || Debug['A'] != 0)
that was lost in golang.org/cl/19936.

Fixes #14652.

Change-Id: Iec3788ff02529b3b0f0d4dd92ec9f3ef20aec849
Reviewed-on: https://go-review.googlesource.com/20271
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: remove syslook's copy parameter
Matthew Dempsky [Fri, 4 Mar 2016 23:19:06 +0000 (15:19 -0800)]
cmd/compile: remove syslook's copy parameter

Instead make substArgTypes responsible for cloning the function
definition Node and the function signature Type tree.

Passes toolstash -cmp.

Change-Id: I9ec84c90a7ae83d164d3f578e84a91cf1490d8ab
Reviewed-on: https://go-review.googlesource.com/20239
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/cipher: xorBytes performance ppc64le/ppc64
Lynn Boger [Tue, 16 Feb 2016 22:05:56 +0000 (16:05 -0600)]
crypto/cipher: xorBytes performance ppc64le/ppc64

Update supportsUnaligned in xor.go to be true for
GOARCH values ppc64le and ppc64.  This allows the
xor of long buffers to be done on double words
(8 bytes) instead of a single byte at a time, which
significantly improves performance.

Fixes #14350

Change-Id: Iccc6b9d3df2e604a55f4c1e4890bdd3bb0d77ab0
Reviewed-on: https://go-review.googlesource.com/19519
Reviewed-by: Minux Ma <minux@golang.org>
8 years agocmd/compile: convert select, sinit, ssa to nodeSeq
Ian Lance Taylor [Sat, 5 Mar 2016 00:13:17 +0000 (16:13 -0800)]
cmd/compile: convert select, sinit, ssa to nodeSeq

Passes toolstash -cmp.

Update #14473.

Change-Id: I1b50fe981e7a266d4b14f31d849eb91afccdfda3
Reviewed-on: https://go-review.googlesource.com/20270
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: don't allocate convX2X or assertX2X func names before syslook
Brad Fitzpatrick [Fri, 4 Mar 2016 22:02:27 +0000 (22:02 +0000)]
cmd/compile: don't allocate convX2X or assertX2X func names before syslook

Change-Id: Ib632ee7ac893750bec4cfe223745bca5f31900ab
Reviewed-on: https://go-review.googlesource.com/20234
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: change order.go to use nodeSeq
Ian Lance Taylor [Fri, 4 Mar 2016 22:29:24 +0000 (14:29 -0800)]
cmd/compile: change order.go to use nodeSeq

Passes toolstash -cmp

Update #14473.

Change-Id: I15b35d40a5ec1f4355ee38bc6d131920933ac95c
Reviewed-on: https://go-review.googlesource.com/20237
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile/internal/ssa: chmod -x likelyadjust.go
Matthew Dempsky [Fri, 4 Mar 2016 22:52:28 +0000 (14:52 -0800)]
cmd/compile/internal/ssa: chmod -x likelyadjust.go

Change-Id: I01ec7d08884a1e0fbce94ea77281c1ee4a2cfd56
Reviewed-on: https://go-review.googlesource.com/20238
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/compile: change export.go and fmt.go to use nodeSeq
Ian Lance Taylor [Fri, 4 Mar 2016 21:16:48 +0000 (13:16 -0800)]
cmd/compile: change export.go and fmt.go to use nodeSeq

Also fix some uses of nodeSeqIterator.Len, and fix the implementation in
nodesIterator.

Passes toolstash -cmp.

Update #14473.

Change-Id: I228871470234b7f1314ffd2aae8a4c0624c35f98
Reviewed-on: https://go-review.googlesource.com/20231
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/link/internal/ld: don't panic on short buildid
Rhys Hiltner [Fri, 4 Mar 2016 06:37:14 +0000 (22:37 -0800)]
cmd/link/internal/ld: don't panic on short buildid

When the linker was written in C, command line arguments were passed
around as null-terminated byte arrays which encouraged checking
characters one at a time. In Go, that can easily lead to
out-of-bounds panics.

Use the more idiomatic strings.HasPrefix when checking cmd/link's -B
argument to avoid the panic, and replace the manual hex decode with
use of the encoding/hex package.

Fixes #14636

Change-Id: I45f765bbd8cf796fee1a9a3496178bf76b117827
Reviewed-on: https://go-review.googlesource.com/20211
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoruntime: disable gcMarkRootCheck debugging check during STW
Austin Clements [Wed, 2 Mar 2016 02:30:26 +0000 (21:30 -0500)]
runtime: disable gcMarkRootCheck debugging check during STW

gcMarkRootCheck takes ~10ns per goroutine. This is just a debugging
check, so disable it (plus, if something is going to go wrong, it's
more likely to go wrong during concurrent mark).

We may be able to re-enable this later, or move it to after we've
started the world again. (But not for 1.6.x.)

For 1.6.x.

Fixes #14419.

name / 95%ile-time/markTerm          old          new  delta
500kIdleGs-12                24.0ms ± 0%  18.9ms ± 6%  -21.46%  (p=0.000 n=15+20)

Change-Id: Idb2a2b1771449de772c159ef95920d6df1090666
Reviewed-on: https://go-review.googlesource.com/20148
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: reset mark state before stopping the world
Austin Clements [Tue, 1 Mar 2016 20:09:24 +0000 (15:09 -0500)]
runtime: reset mark state before stopping the world

Currently we reset the mark state during STW sweep termination. This
involves looping over all of the goroutines. Each iteration of this
loop takes ~25ns, so at around 400k goroutines, we'll exceed our 10ms
pause goal.

However, it's safe to do this before we stop the world for sweep
termination because nothing is consuming this state yet. Hence, move
the reset to just before STW.

This isn't perfect: a long reset can still delay allocating goroutines
that block on GC starting. But it's certainly better to block some
things eventually than to block everything immediately.

For 1.6.x.

Fixes #14420.

name \ 95%ile-time/sweepTerm           old          new  delta
500kIdleGs-12                 11312µs ± 6%  18.9µs ± 6%  -99.83%  (p=0.000 n=16+20)

Change-Id: I9815c4d8d9b0d3c3e94dfdab78049cefe0dcc93c
Reviewed-on: https://go-review.googlesource.com/20147
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: fix off-by-one error finding module for PC
Ian Lance Taylor [Fri, 4 Mar 2016 19:29:55 +0000 (11:29 -0800)]
runtime: fix off-by-one error finding module for PC

Also fix compiler-invoked panics to avoid a confusing "malloc deadlock"
crash if they are invoked while executing the runtime.

Fixes #14599.

Change-Id: I89436abcbf3587901909abbdca1973301654a76e
Reviewed-on: https://go-review.googlesource.com/20219
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocmd/link: deduplicate read-only string data
David Crawshaw [Sat, 27 Feb 2016 17:33:14 +0000 (08:33 -0900)]
cmd/link: deduplicate read-only string data

Many read-only strings in Go binaries are substrings of other read-only
strings. A common source is the text form of type information, which
will include both "struct { X int }" and "*struct { X int }" or
"*bytes.Reader" and "func(*bytes.Reader)" in the same binary.

Because this character data is referred to by separate string headers,
we can skip writing the smaller string and modify the pointer
relocation to point to the larger string. This CL does this
deduplication in the linker after the reachable set of strings has
been determined.

This removes 765KB from juju (1.4% without DWARF).

Link time goes at tip goes form 4.6s to 6.3s, but note that this CL
is part of a series that recently reduced link time from 9.6s.

For #6853.

Change-Id: Ib2087cf627c9f1e9a1181f9b4c8f81d1a3f42191
Reviewed-on: https://go-review.googlesource.com/19987
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoreflect: recognize unnamed directional channels
David Crawshaw [Fri, 4 Mar 2016 19:53:26 +0000 (14:53 -0500)]
reflect: recognize unnamed directional channels

go test github.com/onsi/gomega/gbytes now passes at tip, and tests
added to the reflect package.

Fixes #14645

Change-Id: I16216c1a86211a1103d913237fe6bca5000cf885
Reviewed-on: https://go-review.googlesource.com/20221
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/link: align string data to Minalign when merging strings
Michael Munday [Fri, 4 Mar 2016 15:14:03 +0000 (10:14 -0500)]
cmd/link: align string data to Minalign when merging strings

Minalign > 1 implies that relocations inserted by the linker cannot
target arbitrary bytes.

Related to #14604

Change-Id: Ie68d14887bc4047d9b29b0cb1149a8d14b6c62e2
Reviewed-on: https://go-review.googlesource.com/20214
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: convert inl.go to use nodeSeq
Ian Lance Taylor [Fri, 4 Mar 2016 17:37:58 +0000 (09:37 -0800)]
cmd/compile: convert inl.go to use nodeSeq

Passes toolstash -cmp.

Update #14473.

Change-Id: I60ef7cac553b346ca6b8cc7152cd184e59994b66
Reviewed-on: https://go-review.googlesource.com/20216
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: more ssa config flags
Keith Randall [Fri, 4 Mar 2016 06:06:57 +0000 (22:06 -0800)]
cmd/compile: more ssa config flags

To turn ssa compilation on or off altogether, use
-ssa=1 or -ssa=0.  Default is on.

To turn on or off consistency checks, do
-d=ssa/check/on or -d=ssa/check/off.  Default is on for now.

Change-Id: I277e0311f538981c8b9c62e7b7382a0c8755ce4c
Reviewed-on: https://go-review.googlesource.com/20217
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/compile: small cleanup to syslook calls
Matthew Dempsky [Fri, 4 Mar 2016 15:55:39 +0000 (07:55 -0800)]
cmd/compile: small cleanup to syslook calls

Passing copy==1 to syslook is only necessary to support subsequent
calls to substArgTypes.  typ2Itab and concatstring* don't have "any"
parameters, so no point in deep copying their function signatures at
every call site.

For a couple other syslook calls (makemap and conv[IET]2[IET]), move
them closer to their corresponding substArgTypes calls so it's easier
to see that all syslook(fn, 1) calls are necessary.

Change-Id: I4a0588ab2b8b5b8ce7a0a44b24c8cf8fda489af6
Reviewed-on: https://go-review.googlesource.com/20215
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: re-vendor math/big to pick up bug fix
Robert Griesemer [Fri, 4 Mar 2016 02:26:36 +0000 (18:26 -0800)]
cmd/compile: re-vendor math/big to pick up bug fix

The changes to internal/big are completely automatic
by running vendor.bash in that directory.

Also added respective test case.

For #14553.

Change-Id: I98b124bcc9ad9e9bd987943719be27864423cb5d
Reviewed-on: https://go-review.googlesource.com/20199
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agomath/big: use correct precision in Float.Float32/64 for denormals
Robert Griesemer [Fri, 4 Mar 2016 01:39:55 +0000 (17:39 -0800)]
math/big: use correct precision in Float.Float32/64 for denormals

When a big.Float is converted to a denormal float32/64, the rounding
precision depends on the size of the denormal. Rounding may round up
and thus change the size (exponent) of the denormal. Recompute the
correct precision again for correct placement of the mantissa.

Fixes #14553.

Change-Id: Iedab5810a2d2a405cc5da28c6de7be34cb035b86
Reviewed-on: https://go-review.googlesource.com/20198
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agocmd/compile: remove NUL-terminator from string data
David Crawshaw [Thu, 18 Feb 2016 16:08:25 +0000 (11:08 -0500)]
cmd/compile: remove NUL-terminator from string data

Makes godoc 37KB smaller.
For #6853.

Change-Id: I0bd6e40f2b4da193768a9fc2ce494cacf7e83c32
Reviewed-on: https://go-review.googlesource.com/19697
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>