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

26384 Commits

Author SHA1 Message Date
Burcu Dogan
9e173f9db9 doc: add android/arm as a valid GOOS/GOARCH combination
Fixes #14497.

Change-Id: Ibdd55acf9e416873c64f8751c2f65f7ccdb1d500
Reviewed-on: https://go-review.googlesource.com/19914
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-25 00:38:16 +00:00
Tal Shprecher
45c4ebec5b cmd/asm: fix EOF message on operand parsing errors.
If the parsing of an operand completes but the parser thinks there
is more to read, return an "expected end of operand" error message
instead of "expected EOF." This also removes extra "asm: " prefixes
in error strings since "asm: " is already set as the global log
prefix.

Fixes #14071

Change-Id: I7d621c1aea529a0eca3bcba032359bd25b3e1080
Reviewed-on: https://go-review.googlesource.com/19731
Reviewed-by: Rob Pike <r@golang.org>
2016-02-25 00:21:14 +00:00
Matthew Dempsky
d17727bdb4 cmd/compile: cleanup escape sequence lexing
Change-Id: I7fe4d0cdcc284d5319c130ee3c351f23489af273
Reviewed-on: https://go-review.googlesource.com/19902
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-25 00:11:16 +00:00
Damien Neil
5888763428 cmd/go: skip consistent cgo build test on Solaris.
See #13247.

Change-Id: I06636157028d98430eb29277c822270592907856
Reviewed-on: https://go-review.googlesource.com/19910
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-24 23:58:10 +00:00
Josh Bleecher Snyder
0625fc8e82 cmd/compile: clean up getlinepragma
Passes toolstash -cmp.

Change-Id: Ia497b51c74a9c760a873e1ed690e4408fd0fe596
Reviewed-on: https://go-review.googlesource.com/19844
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 22:54:41 +00:00
Keith Randall
9c269e6a46 cmd/compile: don't free the Prog list if we look at it after flush
Only tests do this, provide them a hook to disable freeing
after flush.

Change-Id: I810c6c51414a93f476a18ba07b807e16092bf8cf
Reviewed-on: https://go-review.googlesource.com/19907
Reviewed-by: Keith Randall <khr@golang.org>
2016-02-24 22:10:27 +00:00
Alberto Donizetti
a9581e2e7a unicode/utf16: speed up and clean up Encode and EncodeRune
name                        old time/op  new time/op  delta
EncodeValidASCII-4          74.1ns ± 1%  70.1ns ± 1%   -5.46%  (p=0.000 n=10+10)
EncodeValidJapaneseChars-4  61.3ns ± 0%  58.9ns ± 0%   -3.82%  (p=0.000 n=10+10)
EncodeRune-4                13.1ns ± 1%   9.8ns ± 0%  -25.24%   (p=0.000 n=10+9)

Fixes #6957

Change-Id: I9dde6d77420c34c6e2ef3e6213bb6be9b58a3074
Reviewed-on: https://go-review.googlesource.com/19891
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 21:07:03 +00:00
Burcu Dogan
47b0422885 os: fix tests on brillo
Not every Android contains the /system/framework directory, e.g. Brillo.
Test against other Android-only system files.

Fixes #14489.

Change-Id: I6d9ec1c4d4ceba3803798015e6917d59cf515de8
Reviewed-on: https://go-review.googlesource.com/19904
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Burcu Dogan <jbd@google.com>
Run-TryBot: Burcu Dogan <jbd@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 21:05:40 +00:00
Keith Randall
f388b58540 cmd/compile: reuseable cache of Prog structs
Reuseable cache of Prog entries.

Improves compiler speed by ~10%.

Update #13646

Change-Id: I01bd8606540d989ea8b8ba5131d1275ba380d976
Reviewed-on: https://go-review.googlesource.com/19868
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-24 18:52:28 +00:00
Keith Randall
45c2e38b37 cmd/compile: Drop references to Prog structs after each function
Don't accumulate a massive list of Prog structs during
compilation and write them all out at the end of compilation.
Instead, convert them to code+relocs (or data+relocs) after each
function is compiled.

Track down a few other places that were keeping Progs alive
and nil them out so the Progs get GCd promptly.

Saves ~20% in peak memory usage for the compiler.  Surprisingly not much
help speed-wise (only because we end up doing more GCs.  With a
compensating GOGC=120, it does help a bit), but this provides a base for
more changes (e.g. reusing a cache of Progs).

Change-Id: I838e01017c228995a687a8110d0cd67bf8596407
Reviewed-on: https://go-review.googlesource.com/19867
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-24 18:47:57 +00:00
Martin Möhrmann
fdd0179bb1 all: fix typos and spelling
Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913
Reviewed-on: https://go-review.googlesource.com/19829
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 18:42:29 +00:00
Eric Lagergren
4feb47bc76 encoding/csv: clarify that TrimLeadingSpace can trim the delimiter
Fixes #14464

Change-Id: Iafc21641cca7d35b7a5631cfc94742ee8e7d5042
Reviewed-on: https://go-review.googlesource.com/19861
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-24 18:42:09 +00:00
David du Colombier
039d455f9d cmd/compile: don't use duffzero on Plan 9
In CL 14408, the implementation of duffzero on amd64
was changed to replace the use of the MOVQ instructions
by MOVUPS.

However, it broke the build on plan9/amd64, since
Plan 9 doesn't allow floating point in note handler.

This change disables the use of duffzero on Plan 9.
We also take care to not use the MOVUPS instruction.

Fixes #14471.

Change-Id: I8277b485dfe65a68d7d8338e52a048c5d45069bf
Reviewed-on: https://go-review.googlesource.com/19890
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-24 18:05:10 +00:00
David Crawshaw
a858931200 cmd/compile: embed type string header in rtype
Reduces binary size of cmd/go by 1%.

For #6853.

Change-Id: I6f2992a4dd3699db1b532ab08683e82741b9c2e4
Reviewed-on: https://go-review.googlesource.com/19692
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 17:12:15 +00:00
Robert Griesemer
8dd2ce2b98 cmd/compile: factor our literal lexing from main lexer function
Further reduces complexity of lexer.next which is now readable.
Also removes the need to initialize various local variables in
each next call even if they are not used for the current token.

No measurable performance change for `time go build -a net/http`
(best of 5 runs): difference < 0.3% (in the noise).

Change-Id: I0d74caa2768920af1ceee027e0f46595119d4210
Reviewed-on: https://go-review.googlesource.com/19865
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-02-24 16:56:51 +00:00
Jure Ham
38d4511b10 sort: fix for nondeterministic less function in quicksort pivot
Fixes #14377

Change-Id: I130a6e1b8bc827db44efd0a74e759b894ecc4977
Reviewed-on: https://go-review.googlesource.com/19823
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 15:30:45 +00:00
kortschak
50c38d46e8 cmd/go, go/build: add support for Fortran
This change adds support for Fortran files (.f, .F, .for, .f90) to the
go tool, in a similar fashion to Objective-C/C++. Only gfortran is
supported out of the box so far but leaves other Fortran compiler
toolchains the ability to pass the correct link options via CGO_LDFLAGS.
A simple test (misc/cgo/fortran) has been added and plugged into the
general test infrastructure. This test is only enabled when the $FC
environment variable is defined (or if 'gfortran' was found in $PATH.)

Derived from CL 4114.

Change-Id: Ifc855091942f95c6e9b17d91c17ceb4eee376408
Reviewed-on: https://go-review.googlesource.com/19670
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 15:06:38 +00:00
Catalin Nicutar
6e6637bdb4 cmd/vet: add a check for tests with malformed names
According to golang.org/pkg/testing the first character after Test has
to be non-lowercase. Functions that don't conform to this are not
considered tests and are not loaded which can cause surprises.

This change adds a check to warn about Test-like functions in a _test
file that are not actually run by go test.

Moved over from https://go-review.googlesource.com/#/c/19466/

Change-Id: I2f89676058b27a0e35f721bdabc9fa8a9d34430d
Reviewed-on: https://go-review.googlesource.com/19724
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-02-24 10:40:34 +00:00
Shenghou Ma
c3ecded729 cmd/dist: introduce list subcommand to list all supported platforms
Fixes #12270.

Change-Id: Ie3dcbd0403d270b4b7f5c39049e12315eee159ed
Reviewed-on: https://go-review.googlesource.com/19837
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 06:41:08 +00:00
Robert Griesemer
539aa05a64 cmd/compile: towards simpler and faster lexing: always use getr
Always reading runes (rather than bytes) has negligible overhead
(a simple if at the moment - it can be eliminated eventually) but
simplifies the lexer logic and opens up the door for speedups.
In the process remove many int conversions that are now not needed
anymore.

Also, because identifiers are now more easily recognized, remove
talph label and move identifier lexing "in place".

Also, instead of accepting all chars < 0x80 and then check for
"frogs", only permit valid characters in the first place. Removes
an extra call for common simple tokens and leads to simpler logic.

`time go build -a net/http` (best of 5 runs) seems 1% faster.
Assuming this is in the noise, there is no noticeable performance
degradation with this change.

Change-Id: I3454c9bf8b91808188cf7a5f559341749da9a1eb
Reviewed-on: https://go-review.googlesource.com/19847
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 04:36:25 +00:00
Shenghou Ma
814978a013 .gitignore: ignore src/go/build/zcgo.go
Change-Id: I6d5db2781d05d6e7e49f5059db1fd84ad6ec328e
Reviewed-on: https://go-review.googlesource.com/19839
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-02-24 04:25:46 +00:00
Mikio Hara
08f1a778c9 net: rename test files
This change renames {ipraw,tcp,udp,unix}_test.go to
{ipraw,tcp,udp,unix}sock_test.go for clarification. Also moves
NSS-related system configuration test helpers into main_conf_test.go and
main_noconf_test.go.

Change-Id: I28ba1e8ceda7b182ee3aa85f0ca3321388ba45e2
Reviewed-on: https://go-review.googlesource.com/19787
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-24 03:07:58 +00:00
Shenghou Ma
1439158120 runtime, syscall: switch linux/386 to use int 0x80
Like bionic, musl also doesn't provide vsyscall helper in %gs:0x10,
and as int $0x80 is as fast as calling %gs:0x10, just use int $0x80
always.

Because we're no longer using vsyscall in VDSO, get rid of VDSO code
for linux/386 too.

Fixes #14476.

Change-Id: I00ec8652060700e0a3c9b524bfe3c16a810263f6
Reviewed-on: https://go-review.googlesource.com/19833
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-24 02:07:17 +00:00
Ian Lance Taylor
5c096cc092 runtime: deflake TestCgoCheckBytes
Bump up the multiplier to 20.  Also run the fast version first, so that
the slow version is likely to start up faster.

Change-Id: Ia0654cc1212ab03a45da1904d3e4b57d6a8d02a0
Reviewed-on: https://go-review.googlesource.com/19835
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2016-02-24 01:49:05 +00:00
Shenghou Ma
7606e4a032 cmd/compile/internal/gc: update comment after c2go
Change-Id: I02c60f6c767e917a8ed3772c2773fe266f781e44
Reviewed-on: https://go-review.googlesource.com/19834
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-24 01:46:27 +00:00
Shenghou Ma
733cae6acd cmd/dist, go/build: make cmd/dist generate cgoEnabled map for go/build
This reduces the amount of duplication. Now there is only one list
of platforms supporting cgo.

Update #12270.

Change-Id: I5dcd55cb6be7c5bb6ce560383c71d90ab1189dc9
Reviewed-on: https://go-review.googlesource.com/14278
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-24 01:45:28 +00:00
Matthew Dempsky
1e4e09612c cmd/compile: remove parser lineno hack for issue #13267
After golang.org/cl/19652 removed the bizarre lexlineno{++,--}
statements for parsing canned imports, this hack for #13267 is no
longer necessary:

    $ echo -n 0 > /tmp/0.go
    $ go tool compile /tmp/0.go
    /tmp/0.go:1: syntax error: package statement must be first

Apparently setting lexlineno to 2 while parsing the canned imports
caused prevlineno and lineno to also be set to 2.  After we finished
parsing imports and restored lexlineno to 1, since "package" is the
first token in a source file, we'll have fixed lineno = 1, but
prevlineno was still set to 2.

Change-Id: Ibcc49fe3402264819b9abb53505631f7a0ad4a36
Reviewed-on: https://go-review.googlesource.com/19859
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-02-24 00:19:46 +00:00
Keith Randall
e360f7c4db cmd/compile: keep JMPs around with -N
When -N, make sure we don't drop every instruction from
a block, even ones which would otherwise be empty.
Helps keep line numbers around for debugging, particularly
for break and continue statements (which often compile
down to nothing).

Fixes #14379

Change-Id: I33722c4f0dcd502f146fa48af262ba3a477c959a
Reviewed-on: https://go-review.googlesource.com/19854
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2016-02-24 00:16:23 +00:00
Prashant Varanasi
c4cb365ea2 net: fix for DialTimeout errors with large timeout
The existing implementation converts the deadline time to an int64,
but does not handle overflow. If the calculated deadline is negative
but the user specified deadline is in the future, then we can assume
the calculation overflowed, and set the deadline to math.MaxInt64.

Fixes #14431

Change-Id: I54dbb4f02bc7ffb9cae8cf62e4e967e9c6541ec6
Reviewed-on: https://go-review.googlesource.com/19758
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-02-23 22:48:04 +00:00
Robert Griesemer
d1cc7f70cd cmd/compile: give informative error instead of "stupid shift"
Fixes #13940.

Change-Id: I00fe377c949e5be4cbc035f6ca18e547e326bfba
Reviewed-on: https://go-review.googlesource.com/19856
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-23 22:31:35 +00:00
Robert Griesemer
ef3c45adfc text/tabwriter: clarify documentation
More clearly distinguish between tab-terminated cells
which are part of an (aligned) column, and non-tab terminated
cells which are not part of a column. Added additional examples.

For #14412.

Change-Id: If72607385752e221eaa2518238b11f48fbcb8a90
Reviewed-on: https://go-review.googlesource.com/19855
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-23 22:09:32 +00:00
Alberto Donizetti
7786f97905 unicode/utf16: speed up and clean up Decode
name                        old time/op  new time/op  delta
DecodeValidASCII-4          94.7ns ± 1%  87.4ns ± 1%  -7.71%  (p=0.000 n=10+9)
DecodeValidJapaneseChars-4  91.0ns ± 2%  84.8ns ± 0%  -6.77%  (p=0.000 n=9+10)
DecodeRune-4                16.5ns ± 0%  16.6ns ± 2%    ~     (p=0.108 n=9+10)

For #6957

Change-Id: I618c15c2a42ef7ec6a5cd163b7c3f1a65ca4ad01
Reviewed-on: https://go-review.googlesource.com/19826
Reviewed-by: Rob Pike <r@golang.org>
2016-02-23 21:09:07 +00:00
Matthew Dempsky
9877900c8c Revert "cmd/compile: move hiter, hmap, and scase definitions into builtin.go"
This reverts commit f28bbb776a.

Change-Id: I82fb81dcff3ddcaefef72949f1ef3a41bcd22301
Reviewed-on: https://go-review.googlesource.com/19849
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2016-02-23 19:42:52 +00:00
Paul Marks
676550d040 net: use dialTCP cancelation for DualStack dialing.
The previous Happy Eyeballs implementation would intentionally leak
connections, because dialTCP could not be reliably terminated upon
losing the race.

Now that dialTCP supports cancelation (plan9 excluded), dialParallel can
wait for responses from both the primary and fallback racers, strictly
before returning control to the caller.

In dial_test.go, we no longer need Sleep to avoid leaks.
Also, fix a typo in the Benchmark IPv4 address.

Updates #11225
Fixes #14279

Change-Id: Ibf3fe5c7ac2f7a438c1ab2cdb57032beb8bc27b5
Reviewed-on: https://go-review.googlesource.com/19390
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-23 19:26:34 +00:00
Robert Griesemer
5583e8a421 spec: fix EBNF for slice syntax
The () parentheses grouped wrongly. Removed them completely in
favor of separate 2- and 3-index slice alternatives which is
clearer.

Fixes #14477.

Change-Id: I0b7521ac912130d9ea8740b8793b3b88e2609418
Reviewed-on: https://go-review.googlesource.com/19853
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-23 19:18:25 +00:00
David Crawshaw
735e5a483c cmd/compile: stop aligning string data
Makes godoc 10KB smaller.
For #6853.

Change-Id: Id54bd8c82cb2a1ba11d2d724e3107f73024b19d9
Reviewed-on: https://go-review.googlesource.com/19696
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-23 17:15:39 +00:00
Alberto Donizetti
cd41db34bc regexp: remove unreachable code
Found running go vet on the package. It barks that
	regexp/backtrack.go:257: unreachable code
	regexp/backtrack.go:302: unreachable code

For #11041

Change-Id: I0f5ba0d6183108fba3d144991b826273db0ffb09
Reviewed-on: https://go-review.googlesource.com/19824
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-23 15:16:50 +00:00
Harshavardhana
4ded58bd5a net/http/httputil: Keep response headers when response ContentLength is 0.
Current code does not print any response headers from httputil.DumpResponse().

   PUT /miniocloud/new-file HTTP/1.1
   Host: s3.amazonaws.com
   User-Agent: Go-http-client/1.1
   Content-Length: 11
   Accept-Encoding: gzip

   HTTP/1.1 200 OK

With this fix we get an appropriate output for httputil.DumpResponse().

   PUT /miniocloud/new-file HTTP/1.1
   Host: s3.amazonaws.com
   User-Agent: Go-http-client/1.1
   Content-Length: 11
   Accept-Encoding: gzip

   HTTP/1.1 200 OK
   Content-Length: 0
   Date: Thu, 14 Jan 2016 03:04:42 GMT
   Etag: "3e25960a79dbc69b674cd4ec67a72c62"
   Server: AmazonS3
   X-Amz-Id-2: qnXyH6sknlovV0Myy3emFAXTNtI/sQIcu1ZXNq/6wd17K32tQ7WNGB1qb3nzCpW2DhfeZ/MbWfw=
   X-Amz-Request-Id: 8422EACB0CC492BD

Fixes #13942

Change-Id: Ida063cc3524a96170d8a837893f7c9f49b6cf98e
Reviewed-on: https://go-review.googlesource.com/18624
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-23 15:16:39 +00:00
Shawn Smith
58ec5839cd all: fix typos
Change-Id: I6035941df8b0de6aeaf6c05df7257bcf6e9191fe
Reviewed-on: https://go-review.googlesource.com/19320
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-23 13:58:47 +00:00
Alberto Donizetti
abf4696ede unicode/utf16: add benchmarks
For #6957

Change-Id: Ic497c12f33efc933e9fe81f6cd1b2a0a01abbabf
Reviewed-on: https://go-review.googlesource.com/19820
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-23 13:58:26 +00:00
Matthew Dempsky
3ec0651539 cmd/compile: add copyright notice to util.go
util.go was originally added in golang.org/cl/4851, and later moved to
its current location in golang.org/cl/10287.

Change-Id: I10b4941d42ae1ff2e78990c497c1347bbbae4e3d
Reviewed-on: https://go-review.googlesource.com/19851
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-23 10:49:47 +00:00
Matthew Dempsky
e34295e647 cmd/compile: use path.Join in importfile
Change-Id: Ib413b0cb16405965455d7764a8c4a22bf431389b
Reviewed-on: https://go-review.googlesource.com/19850
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-23 10:49:39 +00:00
Robert Griesemer
e7524d51fd cmd/compile: move Io state into lexer and remove Io type
Pass lexer around so state is accessible and dependency is explicit.
In the process remove EOF -> '\n' conversion that has to be corrected
for when reporting errors.

Change-Id: If95564b70e7484dedc1f5348e585cd19acbc1243
Reviewed-on: https://go-review.googlesource.com/19819
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-02-23 03:42:38 +00:00
Robert Griesemer
0784e6918e net/http: fix typo in doc string
Fixes #14475.

Change-Id: I1b5b0a9793a417572ec55f313185d03ad5ae9d01
Reviewed-on: https://go-review.googlesource.com/19846
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-02-23 03:42:24 +00:00
Keith Randall
bd70bd9cb2 runtime: unify memeq and memequal
They do the same thing, except memequal also has the short-circuit
check if the two pointers are equal.

A) We might as well always do the short-circuit check, it is only 2 instructions.
B) The extra function call (memequal->memeq) is expensive.

benchmark                 old ns/op     new ns/op     delta
BenchmarkArrayEqual-8     8.56          5.31          -37.97%

No noticeable affect on the former memeq user (maps).

Fixes #14302

Change-Id: I85d1ada59ed11e64dd6c54667f79d32cc5f81948
Reviewed-on: https://go-review.googlesource.com/19843
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-23 00:15:38 +00:00
Brady Sullivan
1e00cc1647 crypto/tls: Improve ambiguous comment in cipher_suites.go
A comment existed referencing RC4 coming before AES because of it's
vulnerability to the Lucky 13 attack. This clarifies that the Lucky 13 attack
only effects AES-CBC, and not AES-GCM.

Fixes #14474

Change-Id: Idcb07b5e0cdb0f9257cf75abea60129ba495b5f5
Reviewed-on: https://go-review.googlesource.com/19845
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-22 23:56:37 +00:00
Rob Pike
108218453a cmd/doc: handle embedded fields properly
The structure of the code meant that an embedded field was never
checked for export status. We need to check the name of the type,
which is either of type T or type *T, and T might be unexported.

Fixes #14356.

Change-Id: I56f468e9b8ae67e9ed7509ed0b91d860507baed2
Reviewed-on: https://go-review.googlesource.com/19701
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-02-22 23:40:02 +00:00
Matthew Dempsky
a4b833940d runtime: move machport into darwin's mOS
It's not needed on other OSes.

Change-Id: Ia6b13510585392a7062374806527d33876beba2a
Reviewed-on: https://go-review.googlesource.com/19818
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-22 21:15:50 +00:00
Matthew Dempsky
756ea30eb0 runtime: simplify stack copying in ThreadCreateProfile
Change-Id: I7414d2fab18ae6e7e7c50f8697ec64d38290f409
Reviewed-on: https://go-review.googlesource.com/19817
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-22 21:15:46 +00:00
Josh Bleecher Snyder
36694064e5 cmd/compile: disable checknils during alg eq generation
Cuts 20k off cmd/go and 32k off golang.org/x/tools/cmd/godoc, approx 0.15% each.

For #6853 and #9930

Change-Id: Ic510b76b80a9153b1ede7b3533d2dbc16caa5c63
Reviewed-on: https://go-review.googlesource.com/19768
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-22 21:10:55 +00:00