]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agoA+C: Daniel Lidén (individual CLA)
Brad Fitzpatrick [Mon, 16 Dec 2013 18:48:51 +0000 (10:48 -0800)]
A+C: Daniel Lidén (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/42940043

11 years agostrings: Add IndexFunc example
Robin Eklind [Mon, 16 Dec 2013 18:44:23 +0000 (10:44 -0800)]
strings: Add IndexFunc example

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42370043

11 years agostrings: Update Trim example.
Robin Eklind [Mon, 16 Dec 2013 18:40:28 +0000 (10:40 -0800)]
strings: Update Trim example.

Use an input which better shows that behaviour of the function. Only leading
and trailing runes are trimed, not intermediate ones.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42390043

11 years agoruntime: fix test
Russ Cox [Mon, 16 Dec 2013 17:59:30 +0000 (12:59 -0500)]
runtime: fix test

Was supposed to be in the nm CL.

TBR=r
CC=golang-dev
https://golang.org/cl/42870043

11 years agoapi: update next.txt
Brad Fitzpatrick [Mon, 16 Dec 2013 17:57:41 +0000 (09:57 -0800)]
api: update next.txt

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/42860043

11 years agodebug/goobj: add package for reading new Go object files
Russ Cox [Mon, 16 Dec 2013 17:52:21 +0000 (12:52 -0500)]
debug/goobj: add package for reading new Go object files

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/40610043

11 years agocmd/nm: reimplement in Go
Russ Cox [Mon, 16 Dec 2013 17:52:11 +0000 (12:52 -0500)]
cmd/nm: reimplement in Go

The immediate goal is to support the new object file format,
which libmach (nm's support library) does not understand.
Rather than add code to libmach or reengineer liblink to
support this new use, just write it in Go.

The C version of nm reads the Plan 9 symbol table stored in
Go binaries, now otherwise unused.

This reimplementation uses the standard symbol table for
the corresponding file format instead, bringing us one step
closer to removing the Plan 9 symbol table from Go binaries.

Tell cmd/dist not to build cmd/nm anymore.
Tell cmd/go to install cmd/nm in the tool directory.

R=golang-dev, r, iant, alex.brainman
CC=golang-dev
https://golang.org/cl/40600043

11 years agocmd/ld: move instruction selection + layout into compilers, assemblers
Russ Cox [Mon, 16 Dec 2013 17:51:58 +0000 (12:51 -0500)]
cmd/ld: move instruction selection + layout into compilers, assemblers

- new object file reader/writer (liblink/objfile.c)
- remove old object file writing routines
- add pcdata iterator
- remove all trace of "line number stack" and "path fragments" from
  object files, linker (!!!)
- dwarf now writes a single "compilation unit" instead of one per package

This CL disables the check for chains of no-split functions that
could overflow the stack red zone. A future CL will attack the problem
of reenabling that check (issue 6931).

This CL is just the liblink and cmd/ld changes.
There are minor associated adjustments in CL 37030045.
Each depends on the other.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/39680043

11 years agocmd/cc, cmd/gc: update compilers, assemblers for liblink changes
Russ Cox [Mon, 16 Dec 2013 17:51:38 +0000 (12:51 -0500)]
cmd/cc, cmd/gc: update compilers, assemblers for liblink changes

- add buffered stdout to all tools and provide to link ctxt.
- avoid extra \n before ! in .6 files written by assemblers
  (makes them match the C compilers).
- use linkwriteobj instead of linkouthist+linkwritefuncs.
- in assemblers and C compilers, record pc explicitly in Prog,
  for use by liblink.
- in C compilers, preserve jump target links.
- in Go compilers (gsubr.c) attach gotype directly to
  corresponding LSym* instead of rederiving from instruction stream.
- in Go compilers, emit just one definition for runtime.zerovalue
  from each compilation.

This CL consists entirely of small adjustments.
The heavy lifting is in CL 39680043.
Each depends on the other.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/37030045

11 years agostrings: Add FieldsFunc example.
Robin Eklind [Mon, 16 Dec 2013 17:43:03 +0000 (09:43 -0800)]
strings: Add FieldsFunc example.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/42360043

11 years agodoc/install-source.html: mention make.bash to skip tests
Shenghou Ma [Mon, 16 Dec 2013 02:03:12 +0000 (21:03 -0500)]
doc/install-source.html: mention make.bash to skip tests

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/42590043

11 years agounicode/utf16: add explicit test for decoding invalid runes.
Dave Cheney [Mon, 16 Dec 2013 01:35:25 +0000 (12:35 +1100)]
unicode/utf16: add explicit test for decoding invalid runes.

The EncodeRune test exercises DecodeRune, but only for runes that it can encode. Add an explicit test for invalid utf16 surrogate pairs.

Bonus: coverage is now 100%

unicode/utf16/utf16.go: IsSurrogate     100.0%
unicode/utf16/utf16.go: DecodeRune      100.0%
unicode/utf16/utf16.go: EncodeRune      100.0%
unicode/utf16/utf16.go: Encode          100.0%
unicode/utf16/utf16.go: Decode          100.0%
total:                  (statements)    100.0%

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/39150044

11 years agounicode/utf16: add explicit tests for IsSurrogate
Dave Cheney [Mon, 16 Dec 2013 00:15:23 +0000 (11:15 +1100)]
unicode/utf16: add explicit tests for IsSurrogate

Update #6956

Add tests for IsSurrogate.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/42570043

11 years agodoc/articles/wiki: remove GNU make dependency
Aram Hăvărneanu [Sun, 15 Dec 2013 22:51:03 +0000 (17:51 -0500)]
doc/articles/wiki: remove GNU make dependency

R=golang-dev, adg, minux.ma
CC=golang-dev
https://golang.org/cl/38410043

11 years agocrypto/tls: generate random serial numbers.
Adam Langley [Sun, 15 Dec 2013 17:57:57 +0000 (12:57 -0500)]
crypto/tls: generate random serial numbers.

NSS (used in Firefox and Chrome) won't accept two certificates with the same
issuer and serial. But this causes problems with self-signed certificates
with a fixed serial number.

This change randomises the serial numbers in the certificates generated by
generate_cert.go.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/38290044

11 years agocrypto/cipher: fix CFB mode.
Adam Langley [Sun, 15 Dec 2013 17:55:59 +0000 (12:55 -0500)]
crypto/cipher: fix CFB mode.

a073d65e6f8c had a couple of bugs in the CFB mode that I missed in code review:
        1) The loop condition wasn't updated from the old version.
        2) It wasn't safe when src and dst aliased.

Fixes #6950.

R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/42110043

11 years agoA+C: Aram Hăvărneanu (individual CLA)
Andrew Gerrand [Fri, 13 Dec 2013 23:03:11 +0000 (10:03 +1100)]
A+C: Aram Hăvărneanu (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/42090043

11 years agoruntime: fix crash in runtime.GoroutineProfile
Russ Cox [Fri, 13 Dec 2013 20:44:57 +0000 (15:44 -0500)]
runtime: fix crash in runtime.GoroutineProfile

This is a possible Go 1.2.1 candidate.

Fixes #6946.

R=iant, r
CC=golang-dev
https://golang.org/cl/41640043

11 years agobytes: fix description of FieldsFunc
Shenghou Ma [Fri, 13 Dec 2013 03:13:19 +0000 (22:13 -0500)]
bytes: fix description of FieldsFunc
Similar to CL 3814041 that fixed the same issue in strings.
Fixes #6941.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41490045

11 years agotest: match gccgo import error messages
Ian Lance Taylor [Fri, 13 Dec 2013 03:02:11 +0000 (19:02 -0800)]
test: match gccgo import error messages

Gccgo doesn't have the same equivalent of file name and
package as the gc compiler, so the error messages are
necessarily different.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40510048

11 years ago.hgignore: remove duplicate entry
Ian Lance Taylor [Fri, 13 Dec 2013 03:01:50 +0000 (19:01 -0800)]
.hgignore: remove duplicate entry

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/40690048

11 years agodebug/dwarf: remove unused field addrsize from Data
Ian Lance Taylor [Fri, 13 Dec 2013 02:55:05 +0000 (18:55 -0800)]
debug/dwarf: remove unused field addrsize from Data

The addrsize field is not a constant for an entire executable
file, and is now handled by the dataFormat interface when
reading the data.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/41620043

11 years agoreflect: correct function name in panic string
Ian Lance Taylor [Fri, 13 Dec 2013 02:54:48 +0000 (18:54 -0800)]
reflect: correct function name in panic string

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/36840045

11 years agodoc: change "threads" to "goroutines"
Ian Lance Taylor [Fri, 13 Dec 2013 02:48:40 +0000 (18:48 -0800)]
doc: change "threads" to "goroutines"

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/40510049

11 years ago.hgignore: remove merge markers
Ian Lance Taylor [Fri, 13 Dec 2013 01:25:02 +0000 (17:25 -0800)]
.hgignore: remove merge markers

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/40720049

11 years agotest: match gccgo error messages
Ian Lance Taylor [Fri, 13 Dec 2013 01:18:37 +0000 (17:18 -0800)]
test: match gccgo error messages

fixedbugs/issue4510.dir/f2.go:7: error: 'fmt' defined as both imported name and global name
f1.go:7: note: 'fmt' imported here

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41530044

11 years agotest: match gccgo error messages
Ian Lance Taylor [Fri, 13 Dec 2013 01:18:12 +0000 (17:18 -0800)]
test: match gccgo error messages

const1.go:33: error: integer constant overflow
<similar errors omitted>
const1.go:64: error: division by zero
const1.go:67: error: floating point constant overflow
const1.go:68: error: floating point constant overflow
const1.go:69: error: floating point constant overflow
const1.go:70: error: division by zero
const1.go:71: error: expected integer type
const1.go:77: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:78: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:79: error: argument 1 has incompatible type (cannot use type uint8 as type int)
const1.go:81: error: argument 1 has incompatible type (cannot use type float32 as type int)
const1.go:82: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:83: error: floating point constant truncated to integer
const1.go:85: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:86: error: argument 1 has incompatible type (cannot use type string as type int)
const1.go:87: error: argument 1 has incompatible type (cannot use type bool as type int)
const1.go:90: error: const initializer cannot be nil
const1.go:91: error: expression is not constant
const1.go:92: error: expression is not constant
const1.go:93: error: invalid constant type
const1.go:94: error: invalid constant type
fixedbugs/bug462.go:17: error: unknown field 'os.File' in 'T'
fixedbugs/issue3705.go:9: error: cannot declare init - must be func
fixedbugs/issue4251.go:12: error: inverted slice range
fixedbugs/issue4251.go:16: error: inverted slice range
fixedbugs/issue4251.go:20: error: inverted slice range
fixedbugs/issue4405.go:11: error: invalid character 0x7 in identifier
fixedbugs/issue4405.go:12: error: invalid character 0x8 in identifier
fixedbugs/issue4405.go:13: error: invalid character 0xb in identifier
fixedbugs/issue4405.go:14: error: invalid character 0xc in identifier
fixedbugs/issue4429.go:15: error: expected pointer
fixedbugs/issue4517d.go:9: error: cannot import package as init
fixedbugs/issue4545.go:17: error: invalid context-determined non-integer type for left operand of shift
fixedbugs/issue4545.go:16: error: incompatible types in binary expression
fixedbugs/issue4610.go:15: error: expected ';' or '}' or newline
fixedbugs/issue4610.go:16: error: expected declaration
fixedbugs/issue4654.go:15: error: value computed is not used
<similar errors omitted>
fixedbugs/issue4776.go:9: error: program must start with package clause
fixedbugs/issue4776.go:9: error: expected ';' or newline after package clause
fixedbugs/issue4813.go:31: error: index must be integer
<similar errors omitted>
fixedbugs/issue4847.go:22: error: initialization expression for 'matchAny' depends upon itself
fixedbugs/issue5089.go:13: error: redefinition of 'bufio.Buffered': receiver name changed
fixedbugs/issue5089.go:11: note: previous definition of 'bufio.Buffered' was here
fixedbugs/issue5172.go:17: error: reference to undefined field or method 'bar'
fixedbugs/issue5172.go:18: error: reference to undefined field or method 'bar'
fixedbugs/issue5172.go:12: error: use of undefined type 'bar'
fixedbugs/issue5358.go:16: error: argument 2 has incompatible type
fixedbugs/issue5581.go:29: error: use of undefined type 'Blah'
funcdup.go:10: error: redefinition of 'i'
funcdup.go:10: note: previous definition of 'i' was here
<similar errors omitted>
funcdup2.go:10: error: redefinition of 'i'
funcdup2.go:10: note: previous definition of 'i' was here
<similar errors omitted>
slice3err.go:20: error: middle index required in 3-index slice
<similar errors omitted>
slice3err.go:20: error: final index required in 3-index slice
<similar errors omitted>
slice3err.go:21: error: final index required in 3-index slice
slice3err.go:46: error: invalid 3-index slice of string
<similar errors omitted>
slice3err.go:57: error: inverted slice range
<similar errors omitted>
slice3err.go:62: error: invalid slice index: capacity less than length
slice3err.go:64: error: invalid slice index: capacity less than start
slice3err.go:65: error: invalid slice index: capacity less than start
slice3err.go:66: error: invalid slice index: capacity less than start
slice3err.go:68: error: invalid slice index: capacity less than length
slice3err.go:70: error: invalid slice index: capacity less than start
slice3err.go:80: error: invalid slice index: capacity less than length
slice3err.go:82: error: invalid slice index: capacity less than start
slice3err.go:83: error: invalid slice index: capacity less than start
slice3err.go:84: error: invalid slice index: capacity less than start
slice3err.go:86: error: invalid slice index: capacity less than length
slice3err.go:88: error: invalid slice index: capacity less than start
slice3err.go:99: error: array index out of bounds
<similar errors omitted>
slice3err.go:106: error: invalid slice index: capacity less than length
slice3err.go:107: error: invalid slice index: capacity less than start
slice3err.go:118: error: invalid slice index: capacity less than length
slice3err.go:119: error: invalid slice index: capacity less than start
syntax/semi1.go:10: error: missing '{' after if clause
syntax/semi1.go:10: error: reference to undefined name 'x'
syntax/semi1.go:10: error: reference to undefined name 'y'
syntax/semi1.go:12: error: reference to undefined name 'z'
syntax/semi2.go:10: error: missing '{' after switch clause
syntax/semi2.go:10: error: reference to undefined name 'x'
syntax/semi3.go:10: error: missing '{' after for clause
syntax/semi3.go:10: error: reference to undefined name 'x'
syntax/semi3.go:10: error: reference to undefined name 'y'
syntax/semi3.go:10: error: reference to undefined name 'z'
syntax/semi3.go:12: error: reference to undefined name 'z'
syntax/semi4.go:11: error: missing '{' after for clause
syntax/semi4.go:10: error: reference to undefined name 'x'
syntax/semi4.go:12: error: reference to undefined name 'z'
typecheck.go:12: error: reference to undefined name 'b'
typecheck.go:17: error: reference to undefined name 'c'
typecheck.go:11: error: use of undefined type 'b'
typecheck.go:16: error: not enough arguments
typecheck.go:17: error: not enough arguments

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41520044

11 years agotest: add []rune case to string_lit.go
Ian Lance Taylor [Fri, 13 Dec 2013 01:17:02 +0000 (17:17 -0800)]
test: add []rune case to string_lit.go

Gccgo managed to get this case wrong.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41490044

11 years agotest: adjust issue4618 for gccgo allocation behaviour
Ian Lance Taylor [Fri, 13 Dec 2013 01:14:05 +0000 (17:14 -0800)]
test: adjust issue4618 for gccgo allocation behaviour

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41550044

11 years agotest: disable large type/stack frame tests for gccgo
Ian Lance Taylor [Fri, 13 Dec 2013 01:13:46 +0000 (17:13 -0800)]
test: disable large type/stack frame tests for gccgo

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40370052

11 years agotest: disable a couple of precise GC tests for gccgo
Ian Lance Taylor [Fri, 13 Dec 2013 01:13:27 +0000 (17:13 -0800)]
test: disable a couple of precise GC tests for gccgo

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41610043

11 years agodoc: add Go 1.2 to release history page
Andrew Gerrand [Thu, 12 Dec 2013 22:31:49 +0000 (09:31 +1100)]
doc: add Go 1.2 to release history page

Fixes #6939.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/41540043

11 years agocrypto/rc4: fix type errors in pure Go implementation
Richard Musiol [Thu, 12 Dec 2013 19:32:31 +0000 (14:32 -0500)]
crypto/rc4: fix type errors in pure Go implementation

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/40540049

11 years agocrypto/sha1: Optimise FUNC1 with alternate formulation
Nick Craig-Wood [Thu, 12 Dec 2013 19:26:36 +0000 (11:26 -0800)]
crypto/sha1: Optimise FUNC1 with alternate formulation

According to Wikipedia: http://en.wikipedia.org/wiki/SHA-1
there is an alternate formulation for the FUNC1 transform,
namely

f1 = d xor (b and (c xor d))

instead of

f1 = (b and c) or ((not b) and d)

This reduces the instruction count of FUNC1 from 6 to 4 and
makes about 5% speed improvement on amd64 and suprisingly 17%
on 386.

amd64 Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          506          499   -1.38%
BenchmarkHash1K             3099         2961   -4.45%
BenchmarkHash8K            22292        21243   -4.71%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        15.80        16.00    1.01x
BenchmarkHash1K           330.40       345.82    1.05x
BenchmarkHash8K           367.48       385.63    1.05x

i386 Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          647          615   -4.95%
BenchmarkHash1K             3673         3161  -13.94%
BenchmarkHash8K            26141        22374  -14.41%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        12.35        13.01    1.05x
BenchmarkHash1K           278.74       323.94    1.16x
BenchmarkHash8K           313.37       366.13    1.17x

The improvements on an Intel(R) Core(TM) i7-4770K CPU @
3.50GHz were almost identical.

R=golang-dev, r, hanwen
CC=golang-dev, rsc
https://golang.org/cl/19910043

11 years agoimage: add RGB and RGB48
ChaiShushan [Thu, 12 Dec 2013 19:24:27 +0000 (11:24 -0800)]
image: add RGB and RGB48

R=golang-dev, r, nigeltao
CC=golang-dev
https://golang.org/cl/13239051

11 years agodoc/go1.3.txt: first checkins: makerelease, liblink
Rob Pike [Thu, 12 Dec 2013 19:17:54 +0000 (11:17 -0800)]
doc/go1.3.txt: first checkins: makerelease, liblink

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/40650047

11 years agocrypto/cipher: speed up gcmInc32.
Han-Wen Nienhuys [Thu, 12 Dec 2013 16:25:17 +0000 (11:25 -0500)]
crypto/cipher: speed up gcmInc32.

The counter is not secret, so the code does not need to be
constant time.

benchmark                    old MB/s     new MB/s  speedup
BenchmarkAESGCMSeal1K           89.90        92.84    1.03x
BenchmarkAESGCMOpen1K           89.16        92.30    1.04x

R=agl
CC=golang-dev
https://golang.org/cl/40690046

11 years agofmt: Fix signed zero-padding for positive floats
Felix Geisendörfer [Thu, 12 Dec 2013 14:40:16 +0000 (06:40 -0800)]
fmt: Fix signed zero-padding for positive floats

Space padding still has the same issue, I will send a separate patch for that
if this one gets accepted.
Fixes #6856.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/35660043

11 years agoA+C: Felix Geisendörfer (individual CLA)
Rob Pike [Thu, 12 Dec 2013 14:39:57 +0000 (06:39 -0800)]
A+C: Felix Geisendörfer (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/40870048

11 years agonet, text/tabwriter: use cap arg to make
Josh Bleecher Snyder [Thu, 12 Dec 2013 06:13:17 +0000 (10:13 +0400)]
net, text/tabwriter: use cap arg to make

Changes generated by:

gofmt -w -r 'make(a, b)[0:0] -> make(a, 0, b)' src/pkg

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/24820045

11 years agonet: don't leave hostsPath unrestored on error in TestLookupStaticHost
Josh Bleecher Snyder [Thu, 12 Dec 2013 06:12:06 +0000 (10:12 +0400)]
net: don't leave hostsPath unrestored on error in TestLookupStaticHost

If the return was reached, then hostsPath would not be properly restored
to its original value. See the (lengthy) discussion at
https://golang.org/cl/15960047/

I assume that this is not for Go 1.2; mailing now since I promised to do so.
I will plan to ping once Go 1.2 is out.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/16200043

11 years agocrypto/x509: fix typo in comment.
Adam Langley [Wed, 11 Dec 2013 22:27:29 +0000 (17:27 -0500)]
crypto/x509: fix typo in comment.

Fixes #6633.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/40720046

11 years agocrypto/cipher: speed up xor operations in CBC, CFB, OBF, CTR
Han-Wen Nienhuys [Wed, 11 Dec 2013 21:05:02 +0000 (16:05 -0500)]
crypto/cipher: speed up xor operations in CBC, CFB, OBF, CTR
and GCM on 386 and amd64

Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz:

benchmark                    old MB/s     new MB/s  speedup
BenchmarkAESGCMSeal1K           82.39        92.05    1.12x
BenchmarkAESGCMOpen1K           82.28        91.88    1.12x
BenchmarkAESCFBEncrypt1K       141.54       277.59    1.96x
BenchmarkAESCFBDecrypt1K       133.06       278.07    2.09x
BenchmarkAESOFB1K              160.51       380.24    2.37x
BenchmarkAESCTR1K              164.07       429.25    2.62x
BenchmarkAESCBCEncrypt1K       170.99       263.74    1.54x
BenchmarkAESCBCDecrypt1K       124.96       249.14    1.99x

Fixes #6741.

R=agl, dave, agl
CC=golang-dev
https://golang.org/cl/24250044

11 years agocmd/5a, cmd/6a, cmd/8a: fix .y files to match y.tab.[ch]
Russ Cox [Wed, 11 Dec 2013 17:11:37 +0000 (12:11 -0500)]
cmd/5a, cmd/6a, cmd/8a: fix .y files to match y.tab.[ch]

When I renamed LAddr back to Addr (before sending the
original linker CLs), I missed the .y files in my global substitute.
Since the .y files are only processed when running make in
one of those directories (not during all.bash), they were
behind the generated files.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/40770044

11 years agocrypto/sha256: block implementation in amd64 assembly
Joel Sing [Wed, 11 Dec 2013 16:41:30 +0000 (11:41 -0500)]
crypto/sha256: block implementation in amd64 assembly

Benchmark on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1259          677  -46.23%
BenchmarkHash1K            14387         6749  -53.09%
BenchmarkHash8K           106006        50107  -52.73%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         6.35        11.81    1.86x
BenchmarkHash1K            71.17       151.72    2.13x
BenchmarkHash8K            77.28       163.49    2.12x

R=agl
CC=golang-dev
https://golang.org/cl/28460043

11 years agonet/http: document that body is closed after (*Request).Write.
Shenghou Ma [Wed, 11 Dec 2013 04:35:50 +0000 (23:35 -0500)]
net/http: document that body is closed after (*Request).Write.
Fixes #6911.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/38690043

11 years agomisc/dist: rename to makerelease
Andrew Gerrand [Wed, 11 Dec 2013 03:47:18 +0000 (14:47 +1100)]
misc/dist: rename to makerelease

The ambiguity has gone on too long.

R=golang-dev, minux.ma, r, dsymonds
CC=golang-dev
https://golang.org/cl/39920043

11 years agodoc/effective_go.html: close some tags.
Oling Cat [Tue, 10 Dec 2013 22:49:28 +0000 (09:49 +1100)]
doc/effective_go.html: close some tags.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/37700043

11 years agotest: don't rely on order of unrelated imports in bug191
Ian Lance Taylor [Tue, 10 Dec 2013 20:05:37 +0000 (12:05 -0800)]
test: don't rely on order of unrelated imports in bug191

There is no necessary relationship between the imports of the
packages a and b, and gccgo happens to import them in a
different order, leading to different output.  This ordering
is not the purpose of the test in any case.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40400043

11 years agoruntime: remove outdated comment and related indentation
Carl Shapiro [Tue, 10 Dec 2013 19:17:43 +0000 (11:17 -0800)]
runtime: remove outdated comment and related indentation

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/39810043

11 years agocrypto/x509: fix behaviour of KeyUsageAny.
Adam Langley [Tue, 10 Dec 2013 19:06:26 +0000 (14:06 -0500)]
crypto/x509: fix behaviour of KeyUsageAny.

(Reporter wasn't able to provide a certificate chain that uses this
feature for testing.)

Fixes #6831

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/40340043

11 years agotest/run: make -v output look like go test output
Russ Cox [Tue, 10 Dec 2013 19:02:42 +0000 (14:02 -0500)]
test/run: make -v output look like go test output

Among other things, it makes it easier to scan to
see what is slow.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40040044

11 years agotest: add some test cases that were miscompiled by gccgo
Ian Lance Taylor [Tue, 10 Dec 2013 18:47:30 +0000 (10:47 -0800)]
test: add some test cases that were miscompiled by gccgo

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/40310043

11 years agoliblink, cmd/gc: fix incompatible type signatures on Plan 9
David du Colombier [Tue, 10 Dec 2013 13:42:41 +0000 (08:42 -0500)]
liblink, cmd/gc: fix incompatible type signatures on Plan 9

R=ality, golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/39640043

11 years agosyscall: skip routing messages with mismatched version
Joel Sing [Tue, 10 Dec 2013 13:03:46 +0000 (00:03 +1100)]
syscall: skip routing messages with mismatched version

Skip routing messages with a mismatched version, rather than failing
and returning EINVAL. Only return EINVAL if we were unable to parse
any of the routing messages (presumably due to a version mismatch).

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/30340043

11 years agodatabase/sql: Remove redundant condition in if
Alberto García Hierro [Tue, 10 Dec 2013 12:10:09 +0000 (16:10 +0400)]
database/sql: Remove redundant condition in if

The final condition (db.maxIdleConnsLocked() > db.freeConn.Len()) can
only be true iff db.maxIdleConnsLocked() is greater than 0, so previously
checking if it's greater than 0 is a waste, specially when that involves
a method call which (ATM) can't be inlined and includes a switch.

Dissasembly follows (test for err == nil has been omitted for clarity):

Before:
43c357: cmp    $0x0,%bl
43c35a: jne    43c3ce <database/sql.(*DB).putConnDBLocked+0x1ce>
43c35c: mov    %rax,(%rsp)
43c360: callq  43aec0 <database/sql.(*DB).maxIdleConnsLocked>
43c365: mov    0x8(%rsp),%rbx
43c36a: cmp    $0x0,%rbx
43c36e: jle    43c3ce <database/sql.(*DB).putConnDBLocked+0x1ce>
43c370: mov    0x30(%rsp),%rbx
43c375: mov    %rbx,(%rsp)
43c379: callq  43aec0 <database/sql.(*DB).maxIdleConnsLocked>
43c37e: mov    0x30(%rsp),%rdx
43c383: mov    0x8(%rsp),%rcx
43c388: mov    0x28(%rdx),%rbp
43c38c: mov    0x28(%rbp),%rbx
43c390: cmp    %rcx,%rbx
43c393: jge    43c3ce <database/sql.(*DB).putConnDBLocked+0x1ce>
43c395: mov    0x28(%rdx),%rbp
43c399: mov    %rbp,(%rsp)
43c39d: mov    0x38(%rsp),%rcx
43c3a2: mov    $0x556c60,%eax
43c3a7: mov    %rax,0x8(%rsp)
43c3ac: mov    %rcx,0x10(%rsp)
43c3b1: callq  4db5b0 <container/list.(*List).PushFront>

After:
43c357: cmp    $0x0,%bl
43c35a: jne    43c3b5 <database/sql.(*DB).putConnDBLocked+0x1b5>
43c35c: mov    %rax,(%rsp)
43c360: callq  43aec0 <database/sql.(*DB).maxIdleConnsLocked>
43c365: mov    0x30(%rsp),%rdx
43c36a: mov    0x8(%rsp),%rcx
43c36f: mov    0x28(%rdx),%rbp
43c373: mov    0x28(%rbp),%rbx
43c377: cmp    %rcx,%rbx
43c37a: jge    43c3b5 <database/sql.(*DB).putConnDBLocked+0x1b5>
43c37c: mov    0x28(%rdx),%rbp
43c380: mov    %rbp,(%rsp)
43c384: mov    0x38(%rsp),%rcx
43c389: mov    $0x556c60,%eax
43c38e: mov    %rax,0x8(%rsp)
43c393: mov    %rcx,0x10(%rsp)
43c398: callq  4db590 <container/list.(*List).PushFront>

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/14656044

11 years agonet: fix nits found by go tool vet
Mikio Hara [Tue, 10 Dec 2013 05:30:52 +0000 (14:30 +0900)]
net: fix nits found by go tool vet

R=golang-dev, dave, adg
CC=golang-dev
https://golang.org/cl/27430043

11 years agoos: fix build.
Shenghou Ma [Tue, 10 Dec 2013 04:46:21 +0000 (23:46 -0500)]
os: fix build.
CL 36800043 and CL 36930044 have a merge conflict that I overlooked.

R=golang-dev
CC=golang-dev
https://golang.org/cl/39850043

11 years agocrypto/rand: support generation of 2-5 bit primes, also document the error return...
Shenghou Ma [Tue, 10 Dec 2013 04:25:49 +0000 (23:25 -0500)]
crypto/rand: support generation of 2-5 bit primes, also document the error return for Prime
Fixes #6849.
Fixes #6867.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/35870043

11 years agoos: clarify docs for Rename.
Shenghou Ma [Tue, 10 Dec 2013 04:25:13 +0000 (23:25 -0500)]
os: clarify docs for Rename.

Three changes:
1. mention "move" to clarify things up.
2. use {old,new}path instead of {old,new}name, which makes it clear what
   relative path would do here.
3. mention "OS-specific restrictions might apply".

Fixes #6887.

R=golang-dev, alex.brainman, iant, r
CC=golang-dev
https://golang.org/cl/36930044

11 years agostrconv: add example for Unquote.
Shenghou Ma [Tue, 10 Dec 2013 04:24:58 +0000 (23:24 -0500)]
strconv: add example for Unquote.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/38920043

11 years agoruntime: check for signed zero in printfloat
Carl Shapiro [Tue, 10 Dec 2013 01:51:30 +0000 (17:51 -0800)]
runtime: check for signed zero in printfloat

Fixes #6899

R=golang-dev, r, cshapiro, iant, rsc
CC=golang-dev
https://golang.org/cl/38120043

11 years agomisc/cgo/testcdefs: rm correct file in test.bash
Alex Brainman [Tue, 10 Dec 2013 01:06:24 +0000 (12:06 +1100)]
misc/cgo/testcdefs: rm correct file in test.bash

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/39780043

11 years agocmd/pack: stop parsing object files to generate __.SYMDEF
Russ Cox [Tue, 10 Dec 2013 00:35:17 +0000 (19:35 -0500)]
cmd/pack: stop parsing object files to generate __.SYMDEF

Nothing looks at __.SYMDEF, and the object file format is changing.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/39580044

11 years agoruntime: remove non-extern decls of runtime.goarm
Russ Cox [Tue, 10 Dec 2013 00:35:07 +0000 (19:35 -0500)]
runtime: remove non-extern decls of runtime.goarm

The linker is in charge of providing the one true declaration.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/39560043

11 years agocmd/cgo: use __gcc_struct__ for go exported functions
Alex Brainman [Tue, 10 Dec 2013 00:30:12 +0000 (11:30 +1100)]
cmd/cgo: use __gcc_struct__ for go exported functions

Fixes #6833

R=minux.ma, iant
CC=golang-dev
https://golang.org/cl/35790045

11 years agoliblink: fix extern register accesses on Plan 9 (386)
Anthony Martin [Mon, 9 Dec 2013 23:48:44 +0000 (18:48 -0500)]
liblink: fix extern register accesses on Plan 9 (386)

R=golang-dev, 0intro, rsc
CC=golang-dev
https://golang.org/cl/39680044

11 years agocmd/8c, cmd/8g, cmd/8l: fix Plan 9 warnings
David du Colombier [Mon, 9 Dec 2013 23:47:22 +0000 (18:47 -0500)]
cmd/8c, cmd/8g, cmd/8l: fix Plan 9 warnings

warning: src/cmd/8c/list.c:124 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:134 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:142 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:152 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:156 format mismatch d VLONG, arg 4
warning: src/cmd/8c/list.c:160 format mismatch d VLONG, arg 4
warning: src/cmd/8c/list.c:165 format mismatch d VLONG, arg 4
warning: src/cmd/8c/list.c:167 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:172 format mismatch d VLONG, arg 4
warning: src/cmd/8c/list.c:174 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:178 format mismatch d VLONG, arg 3
warning: src/cmd/8c/list.c:184 format mismatch d VLONG, arg 3

warning: src/cmd/8g/list.c:91 format mismatch d VLONG, arg 4
warning: src/cmd/8g/list.c:100 format mismatch d VLONG, arg 4
warning: src/cmd/8g/list.c:114 format mismatch d VLONG, arg 5
warning: src/cmd/8g/list.c:118 format mismatch d VLONG, arg 5
warning: src/cmd/8g/list.c:122 format mismatch d VLONG, arg 5
warning: src/cmd/8g/list.c:126 format mismatch d VLONG, arg 5
warning: src/cmd/8g/list.c:136 format mismatch d VLONG, arg 4

warning: src/cmd/8l/list.c:107 format mismatch d VLONG, arg 4
warning: src/cmd/8l/list.c:125 format mismatch ux VLONG, arg 4
warning: src/cmd/8l/list.c:128 format mismatch ux VLONG, arg 4
warning: src/cmd/8l/list.c:130 format mismatch d VLONG, arg 4
warning: src/cmd/8l/list.c:134 format mismatch d VLONG, arg 5
warning: src/cmd/8l/list.c:138 format mismatch d VLONG, arg 6
warning: src/cmd/8l/list.c:143 format mismatch d VLONG, arg 5
warning: src/cmd/8l/list.c:148 format mismatch d VLONG, arg 5
warning: src/cmd/8l/list.c:150 format mismatch d VLONG, arg 4
warning: src/cmd/8l/list.c:154 format mismatch d VLONG, arg 4
warning: src/cmd/8l/list.c:158 format mismatch d VLONG, arg 4
warning: src/cmd/8l/obj.c:132 format mismatch ux VLONG, arg 2

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/39710043

11 years agoruntime: do not use memmove in the Plan 9 signal handler
Anthony Martin [Mon, 9 Dec 2013 23:41:48 +0000 (18:41 -0500)]
runtime: do not use memmove in the Plan 9 signal handler

Fixes a regression introduced in revision 4cb93e2900d0.

That revision changed runtime·memmove to use SSE MOVOU
instructions for sizes between 17 and 256 bytes. We were
using memmove to save a copy of the note string during
the note handler. The Plan 9 kernel does not allow the
use of floating point in note handlers (which includes
MOVOU since it touches the XMM registers).

Arguably, runtime·memmove should not be using MOVOU when
GO386=387 but that wouldn't help us on amd64. It's very
important that we guard against any future changes so we
use a simple copy loop instead.

This change is extracted from CL 9796043 (since that CL
is still being ironed out).

R=rsc
CC=golang-dev
https://golang.org/cl/34640045

11 years ago.hgignore: ignore liblink/anames?.c
Russ Cox [Mon, 9 Dec 2013 23:40:54 +0000 (18:40 -0500)]
.hgignore: ignore liblink/anames?.c

R=golang-dev, minux.ma, iant
CC=golang-dev
https://golang.org/cl/36300045

11 years agobuild: do not use the host's libbio on Plan 9
Anthony Martin [Mon, 9 Dec 2013 23:39:58 +0000 (18:39 -0500)]
build: do not use the host's libbio on Plan 9

R=jas, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/14604047

11 years agocmd/gc, runtime: correct a misnomer regarding dead value maps
Carl Shapiro [Mon, 9 Dec 2013 22:45:10 +0000 (14:45 -0800)]
cmd/gc, runtime: correct a misnomer regarding dead value maps

The funcdata symbol incorrectly named the dead value map the
dead pointer map.  The dead value map identifies all dead
values, including pointers and non-pointers, in a stack frame.
The purpose of this map is to allow the runtime to poison
locations of dead data to catch lost invariants.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/38670043

11 years agocmd/gc: fix windows build, probably
Russ Cox [Mon, 9 Dec 2013 18:02:56 +0000 (13:02 -0500)]
cmd/gc: fix windows build, probably

TBR=iant
CC=golang-dev
https://golang.org/cl/39540043

11 years agocmd/6l: fix linux/amd64
Russ Cox [Mon, 9 Dec 2013 17:58:35 +0000 (09:58 -0800)]
cmd/6l: fix linux/amd64

TBR=iant
CC=golang-dev
https://golang.org/cl/39530043

11 years agocmd/dist, cmd/go: pass -fmessage-length always
Russ Cox [Mon, 9 Dec 2013 17:56:23 +0000 (12:56 -0500)]
cmd/dist, cmd/go: pass -fmessage-length always

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/36300044

11 years agocmd/gc: print more information for windows failure
Russ Cox [Mon, 9 Dec 2013 17:55:25 +0000 (12:55 -0500)]
cmd/gc: print more information for windows failure

TBR=iant
CC=golang-dev
https://golang.org/cl/39510043

11 years agocmd/ld: fix linux/386 build
Russ Cox [Mon, 9 Dec 2013 15:42:55 +0000 (07:42 -0800)]
cmd/ld: fix linux/386 build

TBR=iant
CC=golang-dev
https://golang.org/cl/39400044

11 years agocmd/dist, cmd/go: pass -fmessage-length=0 when using clang
Russ Cox [Mon, 9 Dec 2013 15:33:27 +0000 (10:33 -0500)]
cmd/dist, cmd/go: pass -fmessage-length=0 when using clang

That option turns off word wrapping of individual
error messages generated by clang. The wrapping
makes the errors harder to read and conflicts with the
idea of a terminal window that can be resized.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/35810043

11 years agoliblink: fix Plan 9 build
David du Colombier [Mon, 9 Dec 2013 12:55:53 +0000 (07:55 -0500)]
liblink: fix Plan 9 build

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/39280043

11 years agoruntime: remove cross-function jump in vlop_arm.s
Russ Cox [Mon, 9 Dec 2013 03:52:08 +0000 (22:52 -0500)]
runtime: remove cross-function jump in vlop_arm.s

The new linker will disallow this on arm
(it is already disallowed on amd64 and 386)
in order to be able to lay out each function
separately.

The restriction is only for jumps into the middle
of a function; jumps to the beginning of a function
remain fine.

Prereq for linker cleanup (golang.org/s/go13linker).

R=iant, r, minux.ma
CC=golang-dev
https://golang.org/cl/35800043

11 years agocmd/5g, cmd/6g, cmd/8g: use liblink
Russ Cox [Mon, 9 Dec 2013 03:51:55 +0000 (22:51 -0500)]
cmd/5g, cmd/6g, cmd/8g: use liblink

Preparation for golang.org/s/go13linker work.

This CL does not build by itself. It depends on 35740044
and 35790044 and will be submitted at the same time.

R=iant
CC=golang-dev
https://golang.org/cl/34590045

11 years agocmd/5c, cmd/6c, cmd/8c: use liblink
Russ Cox [Mon, 9 Dec 2013 03:51:31 +0000 (22:51 -0500)]
cmd/5c, cmd/6c, cmd/8c: use liblink

Preparation for golang.org/s/go13linker work.

This CL does not build by itself. It depends on 35740044
and 35790044 and will be submitted at the same time.

R=iant
CC=golang-dev
https://golang.org/cl/34580044

11 years agocmd/5a, cmd/6a, cmd/8a: use liblink
Russ Cox [Mon, 9 Dec 2013 03:49:56 +0000 (22:49 -0500)]
cmd/5a, cmd/6a, cmd/8a: use liblink

Preparation for golang.org/s/go13linker work.

This CL does not build by itself. It depends on 35740044
and 35790044 and will be submitted at the same time.

R=iant
CC=golang-dev
https://golang.org/cl/35830043

11 years agoliblink: create new library based on linker code
Russ Cox [Mon, 9 Dec 2013 03:49:37 +0000 (22:49 -0500)]
liblink: create new library based on linker code

There is an enormous amount of code moving around in this CL,
but the code is the same, and it is invoked in the same ways.
This CL is preparation for the new linker structure, not the new
structure itself.

The new library's definition is in include/link.h.

The main change is the use of a Link structure to hold all the
linker-relevant state, replacing the smattering of global variables.
The Link structure should both make it clearer which state must
be carried around and make it possible to parallelize more easily
later.

The main body of the linker has moved into the architecture-independent
cmd/ld directory. That includes the list of known header types, so the
distinction between Hplan9x32 and Hplan9x64 is removed (no other
header type distinguished 32- and 64-bit formats), and code for unused
formats such as ipaq kernels has been deleted.

The code being deleted from 5l, 6l, and 8l reappears in liblink or in ld.
Because multiple files are being merged in the liblink directory,
it is not possible to show the diffs nicely in hg.

The Prog and Addr structures have been unified into an
architecture-independent form and moved to link.h, where they will
be shared by all tools: the assemblers, the compilers, and the linkers.
The unification makes it possible to write architecture-independent
traversal of Prog lists, among other benefits.

The Sym structures cannot be unified: they are too fundamentally
different between the linker and the compilers. Instead, liblink defines
an LSym - a linker Sym - to be used in the Prog and Addr structures,
and the linker now refers exclusively to LSyms. The compilers will
keep using their own syms but will fill out the corresponding LSyms in
the Prog and Addr structures.

Although code from 5l, 6l, and 8l is now in a single library, the
code has been arranged so that only one architecture needs to
be linked into a particular program: 5l will not contain the code
needed for x86 instruction layout, for example.

The object file writing code in liblink/obj.c is from cmd/gc/obj.c.

Preparation for golang.org/s/go13linker work.

This CL does not build by itself. It depends on 35740044
and will be submitted at the same time.

R=iant
CC=golang-dev
https://golang.org/cl/35790044

11 years agocmd/dist: add liblink build information
Russ Cox [Mon, 9 Dec 2013 03:48:11 +0000 (22:48 -0500)]
cmd/dist: add liblink build information

In addition to adding the library, change the way the anames array is created.
Previously, it was written to src/cmd/6l/enam.c (and similarly for 5l and 8l)
and each of the other tools (6g, 6c, 6a) compiled the 6l/enam.c file in addition
to their own sources.

Now that there is a library shared by all these programs, move the anames
array into that library. To eliminate name conflicts, name the array after
the architecture letter: anames5, anames6, anames8.

First step to linker cleanup (golang.org/s/go13linker).

This CL does not build by itself. It depends on the CLs introducing
liblink and changing commands to use it.

R=iant
CC=golang-dev
https://golang.org/cl/35740044

11 years agocmd/gc: do not generate dead value maps yet
Carl Shapiro [Fri, 6 Dec 2013 23:49:47 +0000 (15:49 -0800)]
cmd/gc: do not generate dead value maps yet

We are not clearing dead values in the garbage collector so it
is not worth the RSS cost to materialize the data and write it
out to the binary.

R=golang-dev, iant, cshapiro
CC=golang-dev
https://golang.org/cl/38650043

11 years agocmd/gc: clarify a TODO regarding variables used in liveness analysis
Carl Shapiro [Fri, 6 Dec 2013 23:36:54 +0000 (15:36 -0800)]
cmd/gc: clarify a TODO regarding variables used in liveness analysis

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/38640043

11 years agoruntime: add GODEBUG option for an electric fence like heap mode
Carl Shapiro [Fri, 6 Dec 2013 22:40:45 +0000 (14:40 -0800)]
runtime: add GODEBUG option for an electric fence like heap mode

When enabled this new debugging mode will allocate objects on
their own page and never recycle memory addresses.  This is an
essential tool to root cause a broad class of heap corruption.

R=golang-dev, dave, daniel.morsing, dvyukov, rsc, iant, cshapiro
CC=golang-dev
https://golang.org/cl/22060046

11 years agodoc: update list of gccgo import search paths
Peter Collingbourne [Fri, 6 Dec 2013 21:33:10 +0000 (13:33 -0800)]
doc: update list of gccgo import search paths

R=iant
CC=golang-dev
https://golang.org/cl/38560043

11 years agoCONTRIBUTORS: add Peter Collingbourne (Google CLA)
Ian Lance Taylor [Fri, 6 Dec 2013 21:32:47 +0000 (13:32 -0800)]
CONTRIBUTORS: add Peter Collingbourne (Google CLA)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/38590043

11 years agocmd/dist: revert an accidental change to the optimization setting
Carl Shapiro [Fri, 6 Dec 2013 01:49:34 +0000 (17:49 -0800)]
cmd/dist: revert an accidental change to the optimization setting

R=golang-dev
CC=golang-dev
https://golang.org/cl/38130043

11 years agocmd/5g, cmd/5l, cmd/6g, cmd/6l, cmd/8g, cmd/8l, cmd/gc, runtime: generate pointer...
Carl Shapiro [Fri, 6 Dec 2013 01:35:22 +0000 (17:35 -0800)]
cmd/5g, cmd/5l, cmd/6g, cmd/6l, cmd/8g, cmd/8l, cmd/gc, runtime: generate pointer maps by liveness analysis

This change allows the garbage collector to examine stack
slots that are determined as live and containing a pointer
value by the garbage collector.  This results in a mean
reduction of 65% in the number of stack slots scanned during
an invocation of "GOGC=1 all.bash".

Unfortunately, this does not yet allow garbage collection to
be precise for the stack slots computed as live.  Pointers
confound the determination of what definitions reach a given
instruction.  In general, this problem is not solvable without
runtime cost but some advanced cooperation from the compiler
might mitigate common cases.

R=golang-dev, rsc, cshapiro
CC=golang-dev
https://golang.org/cl/14430048

11 years agoA+C: add Dmitri Shuralyov
Andrew Gerrand [Wed, 4 Dec 2013 22:28:24 +0000 (09:28 +1100)]
A+C: add Dmitri Shuralyov

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/31900043

11 years agodoc/go1.3.txt: add file to track significant CLs for 1.3
Rob Pike [Wed, 4 Dec 2013 01:08:51 +0000 (17:08 -0800)]
doc/go1.3.txt: add file to track significant CLs for 1.3
Nothing significant so far (right?), but let's lay the keystone.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/36830043

11 years agoencoding/gob: do not hide an unsafe.Pointer in a uintptr
Carl Shapiro [Tue, 3 Dec 2013 23:24:27 +0000 (15:24 -0800)]
encoding/gob: do not hide an unsafe.Pointer in a uintptr

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/23320044

11 years agoruntime: add an allocation and free tracing for gc debugging
Carl Shapiro [Tue, 3 Dec 2013 22:42:38 +0000 (14:42 -0800)]
runtime: add an allocation and free tracing for gc debugging

Output for an allocation and free (sweep) follows

MProf_Malloc(p=0xc2100210a0, size=0x50, type=0x0 <single object>)
        #0 0x46ee15 runtime.mallocgc /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:141
        #1 0x47004f runtime.settype_flush /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:612
        #2 0x45f92c gc /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2071
        #3 0x45f89e mgc /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2050
        #4 0x45258b runtime.mcall /usr/local/google/home/cshapiro/go/src/pkg/runtime/asm_amd64.s:179

MProf_Free(p=0xc2100210a0, size=0x50)
        #0 0x46ee15 runtime.mallocgc /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:141
        #1 0x47004f runtime.settype_flush /usr/local/google/home/cshapiro/go/src/pkg/runtime/malloc.goc:612
        #2 0x45f92c gc /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2071
        #3 0x45f89e mgc /usr/local/google/home/cshapiro/go/src/pkg/runtime/mgc0.c:2050
        #4 0x45258b runtime.mcall /usr/local/google/home/cshapiro/go/src/pkg/runtime/asm_amd64.s:179

R=golang-dev, dvyukov, rsc, cshapiro
CC=golang-dev
https://golang.org/cl/21990045

11 years agocmd/gc: fix special-casing of the printed names of map internal structures.
Keith Randall [Tue, 3 Dec 2013 22:27:08 +0000 (14:27 -0800)]
cmd/gc: fix special-casing of the printed names of map internal structures.
Shaves 1% off of binary size.

update #6853

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/35940047

11 years agoruntime: move stack scanning into the parallel mark phase
Carl Shapiro [Tue, 3 Dec 2013 22:12:55 +0000 (14:12 -0800)]
runtime: move stack scanning into the parallel mark phase

This change reduces the cost of the stack scanning by frames.
It moves the stack scanning from the serial root enumeration
phase to the parallel tracing phase.  The output that follows
are timings for the issue 6482 benchmark

Baseline

BenchmarkGoroutineSelect       50  108027405 ns/op
BenchmarkGoroutineBlocking       50   89573332 ns/op
BenchmarkGoroutineForRange       20   95614116 ns/op
BenchmarkGoroutineIdle       20  122809512 ns/op

Stack scan by frames, non-parallel

BenchmarkGoroutineSelect       20  297138929 ns/op
BenchmarkGoroutineBlocking       20  301137599 ns/op
BenchmarkGoroutineForRange       10  312499469 ns/op
BenchmarkGoroutineIdle       10  209428876 ns/op

Stack scan by frames, parallel

BenchmarkGoroutineSelect       20  183938431 ns/op
BenchmarkGoroutineBlocking       20  170109999 ns/op
BenchmarkGoroutineForRange       20  179628882 ns/op
BenchmarkGoroutineIdle       20  157541498 ns/op

The remaining performance disparity is due to inefficiencies
in gentraceback and its callees.  The effect was isolated by
using a parallel stack scan where scanstack was modified to do
a conservative scan of the stack segments without gentraceback
followed by a call of gentrackback with a no-op callback.

The output that follows are the top-10 most frequent tops of
stacks as determined by the Linux perf record facility.

Baseline

+  25.19%  gc.test  gc.test            [.] runtime.xchg
+  19.00%  gc.test  gc.test            [.] scanblock
+   8.53%  gc.test  gc.test            [.] scanstack
+   8.46%  gc.test  gc.test            [.] flushptrbuf
+   5.08%  gc.test  gc.test            [.] procresize
+   3.57%  gc.test  gc.test            [.] runtime.chanrecv
+   2.94%  gc.test  gc.test            [.] dequeue
+   2.74%  gc.test  gc.test            [.] addroots
+   2.25%  gc.test  gc.test            [.] runtime.ready
+   1.33%  gc.test  gc.test            [.] runtime.cas64

Gentraceback

+  18.12%  gc.test  gc.test             [.] runtime.xchg
+  14.68%  gc.test  gc.test             [.] scanblock
+   8.20%  gc.test  gc.test             [.] runtime.gentraceback
+   7.38%  gc.test  gc.test             [.] flushptrbuf
+   6.84%  gc.test  gc.test             [.] scanstack
+   5.92%  gc.test  gc.test             [.] runtime.findfunc
+   3.62%  gc.test  gc.test             [.] procresize
+   3.15%  gc.test  gc.test             [.] readvarint
+   1.92%  gc.test  gc.test             [.] addroots
+   1.87%  gc.test  gc.test             [.] runtime.chanrecv

R=golang-dev, dvyukov, rsc
CC=golang-dev
https://golang.org/cl/17410043

11 years agoruntime: get rid of concatstring's vararg C argument.
Keith Randall [Tue, 3 Dec 2013 18:39:19 +0000 (10:39 -0800)]
runtime: get rid of concatstring's vararg C argument.

Pass as a slice of strings instead.  For 2-5 strings, implement
dedicated routines so no slices are needed.

static call counts in the go binary:
 2 strings: 342 occurrences
 3 strings:  98
 4 strings:  30
 5 strings:  13
6+ strings:  14

Why?  C varags, bad for stack scanning and copying.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/36380043

11 years agoruntime: fix race detector when map keys/values are passed by pointer.
Keith Randall [Tue, 3 Dec 2013 02:03:25 +0000 (18:03 -0800)]
runtime: fix race detector when map keys/values are passed by pointer.

Now that the map implementation is reading the keys and values from
arbitrary memory (instead of from stack slots), it needs to tell the
race detector when it does so.

Fixes #6875.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/36360043