]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windows
Shenghou Ma [Wed, 26 Sep 2012 14:34:25 +0000 (22:34 +0800)]
cmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windows
        Fixes #4063.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/6543066

12 years agocmd/go: assume that code in $GOROOT is up to date
Joel Sing [Wed, 26 Sep 2012 14:00:50 +0000 (00:00 +1000)]
cmd/go: assume that code in $GOROOT is up to date

Do not check compiler/linker timestamps for packages that are in the
$GOROOT. Avoids trying to rebuild non-writable standard packages when
timestamps have not been retained on the Go binaries.

Fixes #4106.

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

12 years agoreflect.DeepEqual: rewrite clarification about nil and empty slice.
Rob Pike [Wed, 26 Sep 2012 10:46:49 +0000 (20:46 +1000)]
reflect.DeepEqual: rewrite clarification about nil and empty slice.
The previous version was created by an idiot. This time, Rog Peppe
wrote the text. Thanks, Rog.
(== doesn't work on slices in general, so it makes no sense to
talk about in the context of DeepEqual.)

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

12 years agonet: fix plan 9 build
Mikio Hara [Wed, 26 Sep 2012 07:11:49 +0000 (16:11 +0900)]
net: fix plan 9 build

R=golang-dev, lucio.dere, fshahriar
CC=golang-dev
https://golang.org/cl/6562046

12 years agoreflect.DeepEqual: document that empty and nil are unequal for slices
Rob Pike [Wed, 26 Sep 2012 05:21:07 +0000 (15:21 +1000)]
reflect.DeepEqual: document that empty and nil are unequal for slices

Update #4133.
Added a sentence of documentation to call out the behavior.

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

12 years agoexp/types/staging: updated gcimporter
Robert Griesemer [Wed, 26 Sep 2012 00:39:02 +0000 (17:39 -0700)]
exp/types/staging: updated gcimporter

Mostly minor changes to match the new
definitions in types.go and const.go.

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

12 years agoexp/types/staging: support for typechecking (most) builtins
Robert Griesemer [Wed, 26 Sep 2012 00:38:43 +0000 (17:38 -0700)]
exp/types/staging: support for typechecking (most) builtins

This code relies on some functions that are not yet in staging,
but it get's harder to keep all this in sync in a piece-meal
fashion.

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

12 years agoexp/types/staging: operands, constants, and error handling
Robert Griesemer [Wed, 26 Sep 2012 00:38:22 +0000 (17:38 -0700)]
exp/types/staging: operands, constants, and error handling

More pieces of the typechecker code:

- Operands are temporary objects representing an expressions's
type and value (for constants). An operand is the equivalent of
an "attribute" in attribute grammars except that it's not stored
but only passed around during type checking.

- Constant operations are implemented in const.go. Constants are
represented as bool (booleans), int64 and *big.Int (integers),
*big.Rat (floats), complex (complex numbers), and string (strings).

- Error reporting is consolidated in errors.go. Only the first
dozen of lines is new code, the rest of the file contains the
exprString and typeString functions formerly in two separate
files (which have been removed).

This is a replacement CL for 6492101 (which was created without
proper use of hg).

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

12 years agonet/http: use tls host instead of proxy, when checking against a certificate
Christian Himpel [Tue, 25 Sep 2012 16:22:13 +0000 (09:22 -0700)]
net/http: use tls host instead of proxy, when checking against a certificate

Fixes #4152.

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

12 years agosyscall: do not use int to test network syscall results (on windows)
Alex Brainman [Tue, 25 Sep 2012 07:06:39 +0000 (17:06 +1000)]
syscall: do not use int to test network syscall results (on windows)

Fixes #4147.

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

12 years agocmd/5c: fix dataflag annotation
Shenghou Ma [Tue, 25 Sep 2012 06:42:44 +0000 (14:42 +0800)]
cmd/5c: fix dataflag annotation

file        old_size     new_size    base@c1ce95068533
bin/go      14717392     6287824     5918236

this huge size difference is due to GC data for runtime.mheap
(NOPTR dataflag is not obeyed).

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

12 years agotest/bench/shootout: new data after 64-bit ints for amd64
Rob Pike [Tue, 25 Sep 2012 04:14:26 +0000 (14:14 +1000)]
test/bench/shootout: new data after 64-bit ints for amd64

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

12 years agocmd/dist: new version for string for development branch
Russ Cox [Tue, 25 Sep 2012 01:35:20 +0000 (21:35 -0400)]
cmd/dist: new version for string for development branch

Remove VERSION, which was forcing version to 'devel'.

Old:
$ go version
go version devel

New:
$ go version
go version devel +0a3866d6cc6b Mon Sep 24 20:08:05 2012 -0400

The date and time (and time zone) is that of the most recent commit,
not the time of the build itself. With some effort we could normalize
the zone, but I don't think it's worth the effort (more C coding,
since Mercurial is unhelpful).

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

12 years agobuild: make int 64 bits on amd64
Russ Cox [Tue, 25 Sep 2012 00:57:01 +0000 (20:57 -0400)]
build: make int 64 bits on amd64

The assembly offsets were converted mechanically using
code.google.com/p/rsc/cmd/asmlint. The instruction
changes were done by hand.

Fixes #2188.

R=iant, r, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/6550058

12 years agoruntime: add types to MSpan
Jan Ziak [Tue, 25 Sep 2012 00:08:05 +0000 (20:08 -0400)]
runtime: add types to MSpan

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

12 years agoreflect: add MakeFunc (API CHANGE)
Russ Cox [Tue, 25 Sep 2012 00:06:32 +0000 (20:06 -0400)]
reflect: add MakeFunc (API CHANGE)

Fixes #1765.

R=iant, r, daniel.morsing, minux.ma, bradfitz, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/6554067

12 years agonet: add read, write message methods to IPConn, UDPConn
Mikio Hara [Mon, 24 Sep 2012 21:57:32 +0000 (06:57 +0900)]
net: add read, write message methods to IPConn, UDPConn

Both methods allow to access the IP ancillary data through
socket control messages.

This CL is required for CL 6482044; go.net/ipv4: new package.

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

12 years agocmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.
Rémy Oudompheng [Mon, 24 Sep 2012 21:44:00 +0000 (23:44 +0200)]
cmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.

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

12 years agocmd/6g, cmd/8g: add OINDREG, ODOT, ODOTPTR cases to igen.
Rémy Oudompheng [Mon, 24 Sep 2012 21:07:44 +0000 (23:07 +0200)]
cmd/6g, cmd/8g: add OINDREG, ODOT, ODOTPTR cases to igen.

Apart from reducing the number of LEAL/LEAQ instructions by about
30%, it gives 8g easier registerization in several cases,
for example in strconv. Performance with 6g is not affected.

Before (386):
src/pkg/strconv/decimal.go:22   TEXT  (*decimal).String+0(SB),$240-12
src/pkg/strconv/extfloat.go:540 TEXT  (*extFloat).ShortestDecimal+0(SB),$584-20

After (386):
src/pkg/strconv/decimal.go:22   TEXT  (*decimal).String+0(SB),$196-12
src/pkg/strconv/extfloat.go:540 TEXT  (*extFloat).ShortestDecimal+0(SB),$420-20

Benchmarks with GOARCH=386 (on a Core 2).

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    7110191000   7079644000   -0.43%
BenchmarkFannkuch11      7769274000   7766514000   -0.04%
BenchmarkGobDecode         33454820     34755400   +3.89%
BenchmarkGobEncode         11675710     11007050   -5.73%
BenchmarkGzip            2013519000   1593855000  -20.84%
BenchmarkGunzip           253368200    242667600   -4.22%
BenchmarkJSONEncode       152443900    120763400  -20.78%
BenchmarkJSONDecode       304112800    247461800  -18.63%
BenchmarkMandelbrot200     29245520     29240490   -0.02%
BenchmarkParse              8484105      8088660   -4.66%
BenchmarkRevcomp         2695688000   2841263000   +5.40%
BenchmarkTemplate         363759800    277271200  -23.78%

benchmark                       old ns/op    new ns/op    delta
BenchmarkAtof64Decimal                127          129   +1.57%
BenchmarkAtof64Float                  166          164   -1.20%
BenchmarkAtof64FloatExp               308          300   -2.60%
BenchmarkAtof64Big                    584          571   -2.23%
BenchmarkAppendFloatDecimal           440          430   -2.27%
BenchmarkAppendFloat                  995          776  -22.01%
BenchmarkAppendFloatExp               897          746  -16.83%
BenchmarkAppendFloatNegExp            900          752  -16.44%
BenchmarkAppendFloatBig              1528         1228  -19.63%
BenchmarkAppendFloat32Integer         443          453   +2.26%
BenchmarkAppendFloat32ExactFraction   812          661  -18.60%
BenchmarkAppendFloat32Point          1002          773  -22.85%
BenchmarkAppendFloat32Exp             858          725  -15.50%
BenchmarkAppendFloat32NegExp          848          728  -14.15%
BenchmarkAppendFloat64Fixed1          447          431   -3.58%
BenchmarkAppendFloat64Fixed2          480          462   -3.75%
BenchmarkAppendFloat64Fixed3          461          457   -0.87%
BenchmarkAppendFloat64Fixed4          509          484   -4.91%

Update #1914.

R=rsc, nigeltao
CC=golang-dev, remy
https://golang.org/cl/6494107

12 years agocrypto/tls: support session ticket resumption.
Adam Langley [Mon, 24 Sep 2012 20:52:43 +0000 (16:52 -0400)]
crypto/tls: support session ticket resumption.

Session resumption saves a round trip and removes the need to perform
the public-key operations of a TLS handshake when both the client and
server support it (which is true of Firefox and Chrome, at least).

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

12 years agotesting: document -test.bench flag
Francesc Campoy [Mon, 24 Sep 2012 20:05:47 +0000 (13:05 -0700)]
testing: document -test.bench flag

Fixes #4080.

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

12 years agocmd/gc: fix escape analysis bug
Russ Cox [Mon, 24 Sep 2012 19:53:12 +0000 (15:53 -0400)]
cmd/gc: fix escape analysis bug

Was not handling &x.y[0] and &x.y.z correctly where
y is an array or struct-valued field (not a pointer).

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

12 years agoregexp/syntax: define accepted syntax
Russ Cox [Mon, 24 Sep 2012 19:33:53 +0000 (15:33 -0400)]
regexp/syntax: define accepted syntax

Update #3953.

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

12 years agocmd/8g: don't create redundant temporaries in bgen.
Rémy Oudompheng [Mon, 24 Sep 2012 19:29:24 +0000 (21:29 +0200)]
cmd/8g: don't create redundant temporaries in bgen.

Comparisons used to create temporaries for arguments
even if they were already variables or addressable.
Removing the extra ones reduces pressure on regopt.

benchmark                 old ns/op    new ns/op    delta
BenchmarkGobDecode         50787620     49908980   -1.73%
BenchmarkGobEncode         19870190     19473030   -2.00%
BenchmarkGzip            3214321000   3067929000   -4.55%
BenchmarkGunzip           496792800    465828600   -6.23%
BenchmarkJSONEncode       232524800    263864400  +13.48%
BenchmarkJSONDecode       622038400    506600600  -18.56%
BenchmarkMandelbrot200     23937310     45913060  +91.81%
BenchmarkParse             14364450     13997010   -2.56%
BenchmarkRevcomp         6919028000   6480009000   -6.35%
BenchmarkTemplate         594458800    539528200   -9.24%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode            15.11        15.38    1.02x
BenchmarkGobEncode            38.63        39.42    1.02x
BenchmarkGzip                  6.04         6.33    1.05x
BenchmarkGunzip               39.06        41.66    1.07x
BenchmarkJSONEncode            8.35         7.35    0.88x
BenchmarkJSONDecode            3.12         3.83    1.23x
BenchmarkParse                 4.03         4.14    1.03x
BenchmarkRevcomp              36.73        39.22    1.07x
BenchmarkTemplate              3.26         3.60    1.10x

R=mtj, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6547064

12 years agotesting: add memory allocation stats to benchmark
Eric Roshan-Eisner [Mon, 24 Sep 2012 19:03:16 +0000 (15:03 -0400)]
testing: add memory allocation stats to benchmark

R=rsc, nigeltao, dave, bradfitz, r, rogpeppe
CC=golang-dev
https://golang.org/cl/6497084

12 years agocmd/gc: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:59:44 +0000 (14:59 -0400)]
cmd/gc: prepare for 64-bit ints

This CL makes the compiler understand that the type of
the len or cap of a map, slice, or string is 'int', not 'int32'.
It does not change the meaning of int, but it should make
the eventual change of the meaning of int in 6g a bit smoother.

Update #2188.

R=ken, dave, remyoudompheng
CC=golang-dev
https://golang.org/cl/6542059

12 years agocmd/ld: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:59:09 +0000 (14:59 -0400)]
cmd/ld: prepare for 64-bit ints

Use explicit IntSize constant instead of 4.

This CL does not change the meaning of int, but it should make
the eventual change of the meaning of int on amd64 a bit
smoother.

Update #2188.

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

12 years agocmd/cgo: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:58:57 +0000 (14:58 -0400)]
cmd/cgo: prepare for 64-bit ints

This CL makes the size of an int controlled by a variable
in cgo instead of hard-coding 4 (or 32 bits) in various places.

Update #2188.

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

12 years agomisc/cgo: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:58:45 +0000 (14:58 -0400)]
misc/cgo: prepare for 64-bit ints

In a few places, the existing cgo tests assume that a
Go int is the same as a C int. Making int 64 bits wide
on 64-bit platforms violates this assumption.
Change that code to assume that Go int32 and C int
are the same instead. That's still not great, but it's better,
and I am unaware of any systems we run on where it is not true.

Update #2188.

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

12 years agoruntime: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:58:34 +0000 (14:58 -0400)]
runtime: prepare for 64-bit ints

This CL makes the runtime understand that the type of
the len or cap of a map, slice, or string is 'int', not 'int32',
and it is also careful to distinguish between function arguments
and results of type 'int' vs type 'int32'.

In the runtime, the new typedefs 'intgo' and 'uintgo' refer
to Go int and uint. The C types int and uint continue to be
unavailable (cause intentional compile errors).

This CL does not change the meaning of int, but it should make
the eventual change of the meaning of int on amd64 a bit
smoother.

Update #2188.

R=iant, r, dave, remyoudompheng
CC=golang-dev
https://golang.org/cl/6551067

12 years agocmd/[568]g: explain the purpose of various Reg fields.
Rémy Oudompheng [Mon, 24 Sep 2012 18:55:11 +0000 (20:55 +0200)]
cmd/[568]g: explain the purpose of various Reg fields.

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

12 years agoCONTRIBUTORS: add Jonathan Feinberg (Google CLA)
Russ Cox [Mon, 24 Sep 2012 18:36:07 +0000 (14:36 -0400)]
CONTRIBUTORS: add Jonathan Feinberg (Google CLA)

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

12 years agotag go1.0.3
Andrew Gerrand [Mon, 24 Sep 2012 18:15:33 +0000 (13:15 -0500)]
tag go1.0.3

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

12 years agolib9/fmt: do not put a main symbol into lib9.a
Russ Cox [Mon, 24 Sep 2012 16:57:05 +0000 (12:57 -0400)]
lib9/fmt: do not put a main symbol into lib9.a

Fixes #4143.

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

12 years agoA+C: Add Shivakumar GN (Individual CLA)
Brad Fitzpatrick [Mon, 24 Sep 2012 16:49:31 +0000 (09:49 -0700)]
A+C: Add Shivakumar GN (Individual CLA)

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

12 years agocmd/gc: fix comment for caninl
Russ Cox [Mon, 24 Sep 2012 16:30:32 +0000 (12:30 -0400)]
cmd/gc: fix comment for caninl

Was describing an old implementation.

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

12 years agocmd/dist, pkg/runtime: Plan 9, 64-bit: Get PID from TLS; remove use of `_tos'.
Akshat Kumar [Mon, 24 Sep 2012 16:24:45 +0000 (12:24 -0400)]
cmd/dist, pkg/runtime: Plan 9, 64-bit: Get PID from TLS; remove use of `_tos'.

Using offsets from Tos is cumbersome and we've had problems
in the past. Since it's only being used to grab the PID, we'll just
get that from the default TLS instead.

R=rsc, rminnich, npe
CC=golang-dev
https://golang.org/cl/6543049

12 years agoreflect: fix mistake in error message
Russ Cox [Mon, 24 Sep 2012 15:47:27 +0000 (11:47 -0400)]
reflect: fix mistake in error message

Pointed out by James Chalfant after submit of CL 6500065.

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

12 years agoencoding/asn1: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 14:30:37 +0000 (10:30 -0400)]
encoding/asn1: prepare for 64-bit ints

The code was assuming that int = 32 bits. Don't.

Update #2188.

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

12 years agocompress/flate: move the history buffer out of the decompressor struct.
Nigel Tao [Mon, 24 Sep 2012 07:58:08 +0000 (17:58 +1000)]
compress/flate: move the history buffer out of the decompressor struct.

I'm not exactly sure why there's a performance gain, but it seems like
an easy win. Maybe it's a cache line thing. Maybe it's that
unsafe.Sizeof(decompressor{}) drops to below unmappedzero, so that
checkref/checkoffset don't need to insert TESTB instructions. Maybe
it's less noise for the conservative garbage collector. Maybe it's
something else.

compress/flate benchmarks:
BenchmarkDecodeDigitsSpeed1e4          378628       349906   -7.59%
BenchmarkDecodeDigitsSpeed1e5         3481976      3204898   -7.96%
BenchmarkDecodeDigitsSpeed1e6        34419500     31750660   -7.75%
BenchmarkDecodeDigitsDefault1e4        362317       335562   -7.38%
BenchmarkDecodeDigitsDefault1e5       3290032      3107624   -5.54%
BenchmarkDecodeDigitsDefault1e6      30542540     28937480   -5.26%
BenchmarkDecodeDigitsCompress1e4       362803       335158   -7.62%
BenchmarkDecodeDigitsCompress1e5      3294512      3114526   -5.46%
BenchmarkDecodeDigitsCompress1e6     30514940     28927090   -5.20%
BenchmarkDecodeTwainSpeed1e4           412818       389521   -5.64%
BenchmarkDecodeTwainSpeed1e5          3475780      3288908   -5.38%
BenchmarkDecodeTwainSpeed1e6         33629640     31931420   -5.05%
BenchmarkDecodeTwainDefault1e4         369736       348850   -5.65%
BenchmarkDecodeTwainDefault1e5        2861050      2721383   -4.88%
BenchmarkDecodeTwainDefault1e6       27120120     25862050   -4.64%
BenchmarkDecodeTwainCompress1e4        372057       350822   -5.71%
BenchmarkDecodeTwainCompress1e5       2855109      2718664   -4.78%
BenchmarkDecodeTwainCompress1e6      26987010     26336030   -2.41%

image/png benchmarks:
BenchmarkDecodeGray               1841839      1802251   -2.15%
BenchmarkDecodeNRGBAGradient      7115318      6933280   -2.56%
BenchmarkDecodeNRGBAOpaque        6135892      6013284   -2.00%
BenchmarkDecodePaletted           1153313      1114302   -3.38%
BenchmarkDecodeRGB                5619404      5511190   -1.93%

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

12 years agoexp/locale/collate/tools/colcmp: implementation of colcmp tool used for comparing
Marcel van Lohuizen [Mon, 24 Sep 2012 04:22:03 +0000 (13:22 +0900)]
exp/locale/collate/tools/colcmp: implementation of colcmp tool used for comparing
various implementation of collation.  The tool provides commands for soring,
regressing one implementation against another, and benchmarking.
Currently it includes collation implementations for the Go collator, ICU,
and one using Darwin's CoreFoundation framework.
To avoid building this tool in the default build, the colcmp tag has been
added to all files. This allows other tools/colcmp in this directory (e.g. it may make
sense to move maketables here) to be put in this directory as well.

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

12 years agotest: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 04:06:41 +0000 (00:06 -0400)]
test: prepare for 64-bit ints

Minor tweaks to avoid assuming that int is always 32 bits.

Update #2188.

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

12 years agotest: minor fixes in run and testlib
Russ Cox [Mon, 24 Sep 2012 04:06:31 +0000 (00:06 -0400)]
test: minor fixes in run and testlib

Can tell this doesn't get run very often, but it is still important
for when you've broken everything else.

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

12 years agosyscall: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 04:06:22 +0000 (00:06 -0400)]
syscall: prepare for 64-bit ints

This CL fixes code that incorrectly assumes that int is 32 bits wide.
Specifically, the socketpair system call expects a pointer to a pair
of int32s, not a pair of ints. Fix this inside the wrappers without
changing the APIs.

Update #2188.

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

12 years agotext/template: allow .Field access to parenthesized expressions
Rob Pike [Mon, 24 Sep 2012 03:23:15 +0000 (13:23 +1000)]
text/template: allow .Field access to parenthesized expressions

Change the grammar so that field access is a proper operator.
This introduces a new node, ChainNode, into the public (but
actually internal) API of text/template/parse. For
compatibility, we only use the new node type for the specific
construct, which was not parseable before. Therefore this
should be backward-compatible.

Before, .X.Y was a token in the lexer; this CL breaks it out
into .Y applied to .X. But for compatibility we mush them
back together before delivering. One day we might remove
that hack; it's the simple TODO in parse.go/operand.

This change also provides grammatical distinction between
        f
and
        (f)
which might permit function values later, but not now.

Fixes #3999.

R=golang-dev, dsymonds, gri, rsc, mikesamuel
CC=golang-dev
https://golang.org/cl/6494119

12 years agotime: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 03:04:28 +0000 (23:04 -0400)]
time: prepare for 64-bit ints

The code was trying to interpret a uint32 n as a signed quantity
and then store it in an int. For this, int(n) currently works, but when
int becomes 64 bits one must write int(int32(n)) instead, to get
the 32-bit sign extension.

Update #2188.

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

12 years agonet/http: use r.Body.Close to close connection during TestServeFileFromCWD
Alex Brainman [Mon, 24 Sep 2012 02:48:19 +0000 (12:48 +1000)]
net/http: use r.Body.Close to close connection during TestServeFileFromCWD

Fixes #3917.

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

12 years agopkg/go/ast: Avoid doing zero-length writes to the fd.
Akshat Kumar [Sun, 23 Sep 2012 22:30:28 +0000 (08:30 +1000)]
pkg/go/ast: Avoid doing zero-length writes to the fd.

After each line, ast.Print would do a zero-length write,
which would hit the boundary condition on Plan 9 when
reading over pipes (since message boundaries are
preserved). This change makes sure we only do positive-
length writes.

R=rsc, rminnich, dave, r
CC=golang-dev
https://golang.org/cl/6558046

12 years agodoc: Remove obsolete references to weekly releases.
Uriel Mangado [Sun, 23 Sep 2012 21:18:19 +0000 (16:18 -0500)]
doc: Remove obsolete references to weekly releases.

This was misleading and often confusing for new users.

Leaving the actual weekly release history page for historical reference.

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

12 years agotest: expand run.go's errorcheck, make clear which bugs run
Russ Cox [Sun, 23 Sep 2012 17:16:14 +0000 (13:16 -0400)]
test: expand run.go's errorcheck, make clear which bugs run

Today, if run.go doesn't understand a test header line it just ignores
the test, making it too easy to write or edit tests that are not actually
being run.

- expand errorcheck to accept flags, so that bounds.go and escape*.go can run.
- create a whitelist of skippable tests in run.go; skipping others is an error.
- mark all skipped tests at top of file.

Update #4139.

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

12 years agocmd/6g: fix internal error with SSE registers.
Rémy Oudompheng [Sun, 23 Sep 2012 16:22:03 +0000 (18:22 +0200)]
cmd/6g: fix internal error with SSE registers.

Revision 63f7abcae015 introduced a bug caused by
code assuming registers started at X5, not X0.

Fixes #4138.

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

12 years agocmd/5g: fix build
Shenghou Ma [Sun, 23 Sep 2012 07:05:44 +0000 (15:05 +0800)]
cmd/5g: fix build

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

12 years agoeffective_go: s/usr/home/ in example
Rob Pike [Sun, 23 Sep 2012 00:44:56 +0000 (10:44 +1000)]
effective_go: s/usr/home/ in example
When I was a lad (and well past), users were in /usr;
now they're somewhere else, I'm told.
Kids today.

Fixes #4122.

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

12 years agocmd/gc: fix use of nil interface, slice
Russ Cox [Sun, 23 Sep 2012 00:42:11 +0000 (20:42 -0400)]
cmd/gc: fix use of nil interface, slice

Fixes #3670.

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

12 years agospec: a couple of minor tweaks to the wording of the import section
Rob Pike [Sat, 22 Sep 2012 19:03:43 +0000 (05:03 +1000)]
spec: a couple of minor tweaks to the wording of the import section
- remove ambiguous 'it'
- use a lower-case PackageName in the example

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

12 years agocmd/5g: fix register opt bug
Russ Cox [Sat, 22 Sep 2012 14:01:35 +0000 (10:01 -0400)]
cmd/5g: fix register opt bug

The width was not being set on the address, which meant
that the optimizer could not find variables that overlapped
with it and mark them as having had their address taken.
This let to the compiler believing variables had been set
but never used and then optimizing away the set.

Fixes #4129.

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

12 years agoreflect: add Type.ConvertibleTo, Value.Convert (API CHANGE)
Russ Cox [Sat, 22 Sep 2012 12:52:27 +0000 (08:52 -0400)]
reflect: add Type.ConvertibleTo, Value.Convert (API CHANGE)

Fixes #4047.

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

12 years agocmd/cgo: use debug data for enums on windows
Joel Sing [Sat, 22 Sep 2012 07:57:54 +0000 (17:57 +1000)]
cmd/cgo: use debug data for enums on windows

Use the debug data for enums on windows.

Fixes #4120.

R=alex.brainman
CC=golang-dev
https://golang.org/cl/6545047

12 years agodebug/pe: add symbol support
Joel Sing [Sat, 22 Sep 2012 07:56:49 +0000 (17:56 +1000)]
debug/pe: add symbol support

Add support for processing the COFF symbol table.

R=alex.brainman
CC=golang-dev
https://golang.org/cl/6551045

12 years agocmd/gc: fix a spurious -u compile error
Russ Cox [Sat, 22 Sep 2012 01:12:41 +0000 (21:12 -0400)]
cmd/gc: fix a spurious -u compile error

Fixes #4082.

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

12 years agocgo: set alignment to 1 for unions and classes; avoids crash from divide-by-zero
Rob Pike [Fri, 21 Sep 2012 21:25:41 +0000 (07:25 +1000)]
cgo: set alignment to 1 for unions and classes; avoids crash from divide-by-zero
Fixes #4114.

R=golang-dev, iant, rsc, iant, devon.odell
CC=golang-dev
https://golang.org/cl/6553050

12 years agodoc: document go1.0.3
Andrew Gerrand [Fri, 21 Sep 2012 19:50:38 +0000 (14:50 -0500)]
doc: document go1.0.3

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

12 years agodoc/talks: remove talks, refer to talks.golang.org instead
Andrew Gerrand [Fri, 21 Sep 2012 19:38:22 +0000 (14:38 -0500)]
doc/talks: remove talks, refer to talks.golang.org instead

These talks have been moved to the go.talks sub-repository:
        https://code.google.com/p/go.talks

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

12 years agocmd/6g: cosmetic improvements to regopt debugging.
Rémy Oudompheng [Fri, 21 Sep 2012 18:20:26 +0000 (20:20 +0200)]
cmd/6g: cosmetic improvements to regopt debugging.

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

12 years agocmd/6g: use all 16 float registers, optimize float moves
Russ Cox [Fri, 21 Sep 2012 17:39:09 +0000 (13:39 -0400)]
cmd/6g: use all 16 float registers, optimize float moves

Fixes #2446.

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

12 years agoruntime: fix typos in comments
Jan Ziak [Fri, 21 Sep 2012 16:25:55 +0000 (12:25 -0400)]
runtime: fix typos in comments

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

12 years agoruntime: fix mmap comments
Shenghou Ma [Fri, 21 Sep 2012 05:50:02 +0000 (13:50 +0800)]
runtime: fix mmap comments
We only pass lower 32 bits of file offset to asm routine.

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

12 years agoall: match asm variable names to Go func declarations
Russ Cox [Fri, 21 Sep 2012 04:35:56 +0000 (00:35 -0400)]
all: match asm variable names to Go func declarations

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

12 years agounicode: performance improvements (API change)
Russ Cox [Fri, 21 Sep 2012 04:35:25 +0000 (00:35 -0400)]
unicode: performance improvements (API change)

*** There is an API change here: the introduction of the
LatinOffset int in the RangeTable struct. ***

* Avoid checking Latin range multiple times for non-Latin runes.
* Use linear search when it is faster than binary search.

go test -calibrate runs the calibration for where the linear/binary
crossover should be.

benchmark                       old MB/s     new MB/s  speedup
BenchmarkFields            36.27        41.43    1.14x
BenchmarkFieldsFunc        36.23        41.38    1.14x

The speedup here is evenly split between the linear scans
and the LatinOffset change. Both are about 1.07x.

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

12 years agocmd/{ld,5l,6l,8l}: add support for OpenBSD ELF signatures
Joel Sing [Fri, 21 Sep 2012 02:51:39 +0000 (12:51 +1000)]
cmd/{ld,5l,6l,8l}: add support for OpenBSD ELF signatures

OpenBSD now requires ELF binaries to have a PT_NOTE that identifies
it as an OpenBSD binary. Refactor the existing NetBSD ELF signature
code and implement support for OpenBSD ELF signatures.

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

12 years agonet: fix comment
Mikio Hara [Thu, 20 Sep 2012 22:13:36 +0000 (07:13 +0900)]
net: fix comment

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

12 years agosync: add Once test with panic
Dmitriy Vyukov [Thu, 20 Sep 2012 19:29:29 +0000 (23:29 +0400)]
sync: add Once test with panic
Tests behavior of Once when initialization function panics.

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

12 years agocmd/ld: remove unused assignment
Lucio De Re [Thu, 20 Sep 2012 18:58:33 +0000 (14:58 -0400)]
cmd/ld: remove unused assignment

The calculation of datsize is redundant.

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

12 years agoruntime: reset parfor stats
Dmitriy Vyukov [Thu, 20 Sep 2012 18:46:24 +0000 (22:46 +0400)]
runtime: reset parfor stats
Otherwise they sum up between GCs.

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

12 years agocrypto/x509: Use ExtKeyUsage and UnknownExtKeyUsage fields from template in CreateCer...
Andrew Harding [Thu, 20 Sep 2012 16:36:37 +0000 (12:36 -0400)]
crypto/x509: Use ExtKeyUsage and UnknownExtKeyUsage fields from template in CreateCertificate

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

12 years agocrypto/x509: ignore non-critical email constraints
Adam Langley [Thu, 20 Sep 2012 16:30:56 +0000 (12:30 -0400)]
crypto/x509: ignore non-critical email constraints

Previously we tried to parse email constraints as the maximum base
distance (which is unused and must be omitted according to RFC 5280)
because they share the same tag number. Rather than complicate the
code further, this CL just ignores the unused values.

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

12 years agoA+C: Add Andrew Harding (Individual CLA)
Adam Langley [Thu, 20 Sep 2012 16:24:36 +0000 (12:24 -0400)]
A+C: Add Andrew Harding  (Individual CLA)

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

12 years agocgo: process DWARF info even when debug data is used for value
Joel Sing [Thu, 20 Sep 2012 03:20:33 +0000 (13:20 +1000)]
cgo: process DWARF info even when debug data is used for value

Always process the DWARF info, even when the const value is determined
using the debug data block. This ensures that the injected enum is
removed and future loads of the same constant do not trigger
inconsistent definitions.

Add tests for issues 2470 and 4054.
Fixes #4054.

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

12 years agomisc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm
Alex Brainman [Thu, 20 Sep 2012 02:06:08 +0000 (12:06 +1000)]
misc/cgo/test: do not run wasteCPU during TestParallelSleep unless on arm

R=golang-dev, r, minux.ma, dave, bradfitz
CC=golang-dev
https://golang.org/cl/6532052

12 years agovet: fix rangeloop.
David Symonds [Wed, 19 Sep 2012 22:12:47 +0000 (08:12 +1000)]
vet: fix rangeloop.

In a range loop, the presence of a value implies the presence of a key.
However, the presence of a value as an *ast.Ident does not imply that
the key is also an *ast.Ident, thus leading to a panic any time the
two argument form is used where the key is not an identifier.

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

12 years agomisc/vim: fix Drop for imports after the first group.
David Symonds [Wed, 19 Sep 2012 22:11:07 +0000 (08:11 +1000)]
misc/vim: fix Drop for imports after the first group.

Previously, an import block such as
import (
         "net"

                "stack"
        )
would not permit ":Drop stack" to work because we were aborting
the scan early, which is only correct when Import is in operation.

R=golang-dev, franciscossouza
CC=golang-dev
https://golang.org/cl/6532053

12 years agogofmt: added testcase for files containing \r\n line endings
Robert Griesemer [Wed, 19 Sep 2012 21:14:21 +0000 (14:14 -0700)]
gofmt: added testcase for files containing \r\n line endings
(see also issue 3961).

hexdump -c testdata/crlf.input
0000000   /   *  \r  \n  \t   S   o   u   r   c   e       c   o   n   t
0000010   a   i   n   i   n   g       C   R   /   L   F       l   i   n
0000020   e       e   n   d   i   n   g   s   .  \r  \n  \t   T   h   e
0000030       g   o   f   m   t   '   e   d       o   u   t   p   u   t
0000040       m   u   s   t       o   n   l   y       h   a   v   e
0000050   L   F  \r  \n  \t   l   i   n   e       e   n   d   i   n   g
0000060   s   .  \r  \n   *   /  \r  \n   p   a   c   k   a   g   e
0000070   m   a   i   n  \r  \n  \r  \n   f   u   n   c       m   a   i
0000080   n   (   )       {  \r  \n  \t   /   /       l   i   n   e
0000090   c   o   m   m   e   n   t  \r  \n  \t   p   r   i   n   t   l
00000a0   n   (   "   h   e   l   l   o   ,       w   o   r   l   d   !
00000b0   "   )       /   /       a   n   o   t   h   e   r       l   i
00000c0   n   e       c   o   m   m   e   n   t  \r  \n  \t   p   r   i
00000d0   n   t   l   n   (   )  \r  \n   }  \r  \n
00000db

hexdump -c testdata/crlf.golden
0000000   /   *  \n  \t   S   o   u   r   c   e       c   o   n   t   a
0000010   i   n   i   n   g       C   R   /   L   F       l   i   n   e
0000020       e   n   d   i   n   g   s   .  \n  \t   T   h   e       g
0000030   o   f   m   t   '   e   d       o   u   t   p   u   t       m
0000040   u   s   t       o   n   l   y       h   a   v   e       L   F
0000050  \n  \t   l   i   n   e       e   n   d   i   n   g   s   .  \n
0000060   *   /  \n   p   a   c   k   a   g   e       m   a   i   n  \n
0000070  \n   f   u   n   c       m   a   i   n   (   )       {  \n  \t
0000080   /   /       l   i   n   e       c   o   m   m   e   n   t  \n
0000090  \t   p   r   i   n   t   l   n   (   "   h   e   l   l   o   ,
00000a0       w   o   r   l   d   !   "   )       /   /       a   n   o
00000b0   t   h   e   r       l   i   n   e       c   o   m   m   e   n
00000c0   t  \n  \t   p   r   i   n   t   l   n   (   )  \n   }  \n
00000cf

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

12 years agoencoding/gob: fix comment
Robert Griesemer [Wed, 19 Sep 2012 17:11:24 +0000 (10:11 -0700)]
encoding/gob: fix comment

Fixes #4100.

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

12 years agosrc/all.bat: fix banner
Shenghou Ma [Wed, 19 Sep 2012 16:58:34 +0000 (00:58 +0800)]
src/all.bat: fix banner
we need to restore %PATH% before calling "dist banner", so that
it could suggest the user to add %GOROOT%/bin to %PATH% if necessary.

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

12 years agomisc/cgo/stdio: make it work on Windows and also test it
Shenghou Ma [Wed, 19 Sep 2012 16:27:23 +0000 (00:27 +0800)]
misc/cgo/stdio: make it work on Windows and also test it
use a function to get stdout and stderr, instead of depending
on a specific libc implementation.
also make test/run.go replace \r\n by \n before comparing
output.

        Fixes #2121.
        Part of issue 1741.

R=alex.brainman, rsc, r, remyoudompheng
CC=golang-dev
https://golang.org/cl/5847068

12 years agocmd/ld: consistent binary for cgo programs
Shenghou Ma [Wed, 19 Sep 2012 16:18:41 +0000 (00:18 +0800)]
cmd/ld: consistent binary for cgo programs
We use pkg path instead of file name (which contains $WORK) in section symbols names.

R=golang-dev, fullung, rsc, iant
CC=golang-dev
https://golang.org/cl/6445085

12 years agoos: use small writes during console io
Alex Brainman [Wed, 19 Sep 2012 06:55:21 +0000 (16:55 +1000)]
os: use small writes during console io

Fixes #3767

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

12 years agoapi: fix build; regenerate api.txt with fixed signatures
Brad Fitzpatrick [Wed, 19 Sep 2012 05:04:07 +0000 (22:04 -0700)]
api: fix build; regenerate api.txt with fixed signatures

Update to tip (to get 6475062 and 6525047)
Rebuild cmd/api.
Switch to a go1 release branch.
Run go tool api > api/go1.txt.new in release branch.
Back to tip.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6528047

12 years agomisc/cgo/test and test/bench/go1: enable these tests on windows
Alex Brainman [Wed, 19 Sep 2012 02:07:25 +0000 (12:07 +1000)]
misc/cgo/test and test/bench/go1: enable these tests on windows

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

12 years agocmd/api: fix signatures like func(x, y, z int)
Mikio Hara [Tue, 18 Sep 2012 22:04:12 +0000 (07:04 +0900)]
cmd/api: fix signatures like func(x, y, z int)

Fixes writing of function parameter, result lists which
consist of multiple named or unnamed items with same type.

Fixes #4011.

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

12 years agovet: add range variable misuse detection
Andrew Gerrand [Tue, 18 Sep 2012 21:19:31 +0000 (14:19 -0700)]
vet: add range variable misuse detection

R=fullung, r, remyoudompheng, minux.ma, gri, rsc
CC=golang-dev
https://golang.org/cl/6494075

12 years agogo/doc: synthesize "package main" for examples
Andrew Gerrand [Tue, 18 Sep 2012 21:13:34 +0000 (14:13 -0700)]
go/doc: synthesize "package main" for examples

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

12 years agorace: linker changes
Dmitriy Vyukov [Tue, 18 Sep 2012 21:05:25 +0000 (01:05 +0400)]
race: linker changes
This is the second part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change makes the linker emit dependency on runtime/race package when supplied with -b flag.

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

12 years agocmd/api: allow extension of interfaces with unexported methods
Russ Cox [Tue, 18 Sep 2012 19:57:03 +0000 (15:57 -0400)]
cmd/api: allow extension of interfaces with unexported methods

Fixes #4061.

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

12 years agorace: build system changes
Dmitriy Vyukov [Tue, 18 Sep 2012 19:47:15 +0000 (23:47 +0400)]
race: build system changes
This is the first part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
Adds -race flag to go command.
API change:
+pkg go/build, type Context struct, InstallTag string

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

12 years agorace: cmd/cgo changes
Dmitriy Vyukov [Tue, 18 Sep 2012 19:42:18 +0000 (23:42 +0400)]
race: cmd/cgo changes
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change breaks circular dependency between runtime/race and syscall packages.

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

12 years agobytes, strings: add Fields benchmarks
Russ Cox [Tue, 18 Sep 2012 19:02:08 +0000 (15:02 -0400)]
bytes, strings: add Fields benchmarks

The performance changes will be a few different CLs.
Start with benchmarks as a baseline.

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

12 years agoruntime: hide the semaphore table from garbage collector
Jan Ziak [Tue, 18 Sep 2012 18:30:01 +0000 (14:30 -0400)]
runtime: hide the semaphore table from garbage collector

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

12 years agospec: clarify expression statements
Robert Griesemer [Tue, 18 Sep 2012 18:25:53 +0000 (11:25 -0700)]
spec: clarify expression statements

Function and method calls are valid expression statements,
but calling certain built-in functions is not permitted.
Enumerate the built-ins.

Also: unsafe.Offsetof permits parenthesized selectors as
arguments.

This is simply documenting existing compiler behavior
(both gc and gccgo agree).

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

12 years agoreflect: use []unsafe.Pointer instead of []*int
Jan Ziak [Tue, 18 Sep 2012 18:23:11 +0000 (14:23 -0400)]
reflect: use []unsafe.Pointer instead of []*int

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