]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agogob: test case for indirection to large field.
Ian Lance Taylor [Fri, 15 Apr 2011 00:16:26 +0000 (17:16 -0700)]
gob: test case for indirection to large field.

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

14 years agogofmt: exclude test case that doesn't compile w/o errors
Robert Griesemer [Fri, 15 Apr 2011 00:06:38 +0000 (17:06 -0700)]
gofmt: exclude test case that doesn't compile w/o errors

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

14 years agogofmt: gofmt test harness bug fix
Robert Griesemer [Thu, 14 Apr 2011 23:33:29 +0000 (16:33 -0700)]
gofmt: gofmt test harness bug fix

Don't use the rewrite rule from a previous test
for the next test if there is no rewrite rule
provided.

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

14 years agohttp: don't quote Set-Cookie Domain and Path
Petar Maymounkov [Thu, 14 Apr 2011 22:05:02 +0000 (15:05 -0700)]
http: don't quote Set-Cookie Domain and Path

Fixes #1659

R=rsc, bradfitzgo, bradfitzwork
CC=bradfitz, golang-dev
https://golang.org/cl/4368052

14 years agogofmt: don't crash when rewriting nil interfaces in AST.
Robert Griesemer [Thu, 14 Apr 2011 21:25:25 +0000 (14:25 -0700)]
gofmt: don't crash when rewriting nil interfaces in AST.

The new reflection API makes it an error to call value.Set(x)
if x is invalid. Guard for it.

Added corresponding test case.

Fixes #1696.

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

14 years agohttp: be clear when failing to connect to a proxy
Brad Fitzpatrick [Thu, 14 Apr 2011 20:49:19 +0000 (13:49 -0700)]
http: be clear when failing to connect to a proxy

Ubuntu and/or GNOME have some bug that likes
to set the "http_proxy" environment variable
and forgets to unset it.  This is annoying
to debug.  Be clear in the error message that
a proxy was in use.

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

14 years agofor GCC4.6: fix a bunch of set-and-not-used errors.
Rob Pike [Thu, 14 Apr 2011 20:31:37 +0000 (13:31 -0700)]
for GCC4.6: fix a bunch of set-and-not-used errors.

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

14 years agopkg/runtime/plan9: Warning remediation, for Plan 9 native.
Lucio De Re [Thu, 14 Apr 2011 18:54:36 +0000 (11:54 -0700)]
pkg/runtime/plan9: Warning remediation, for Plan 9 native.

. Missing declaration of runtime.brk_();
. Argument v in runtime.SysReserve() is not used;
  (I'd prefer a Plan 9-type solution...)

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

14 years agogotest: generate gofmt-compliant code
Brad Fitzpatrick [Thu, 14 Apr 2011 18:50:00 +0000 (11:50 -0700)]
gotest: generate gofmt-compliant code

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

14 years agocrypto/tls: add server-side OCSP stapling support.
Adam Langley [Thu, 14 Apr 2011 18:47:28 +0000 (14:47 -0400)]
crypto/tls: add server-side OCSP stapling support.

We already had support on the client side. I also changed the name of
the flag in the ServerHello structure to match the name of the same
flag in the ClientHello (ocspStapling).

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

14 years agohttp: consume request bodies before replying
Brad Fitzpatrick [Thu, 14 Apr 2011 17:40:23 +0000 (10:40 -0700)]
http: consume request bodies before replying

This fixes our http behavior (even if Handlers forget to
consume a request body, we do it for them before we send
their response header), fixes the racy TestServerExpect,
and adds TestServerConsumesRequestBody.

With GOMAXPROCS>1, the http tests now seem race-free.

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

14 years agohttp: fix race in transport_test
Brad Fitzpatrick [Thu, 14 Apr 2011 16:07:20 +0000 (09:07 -0700)]
http: fix race in transport_test

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

14 years agogotest: add timing, respect $GOARCH
Russ Cox [Thu, 14 Apr 2011 14:59:33 +0000 (10:59 -0400)]
gotest: add timing, respect $GOARCH

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

14 years agold: defend against some broken object files
Russ Cox [Thu, 14 Apr 2011 14:42:48 +0000 (10:42 -0400)]
ld: defend against some broken object files

Fixes #1698.
Fixes #1699.

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

14 years agocompress/flate: dictionary support
Russ Cox [Thu, 14 Apr 2011 14:41:55 +0000 (10:41 -0400)]
compress/flate: dictionary support

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

14 years agogc: fix use of typekind array in error messages
Russ Cox [Thu, 14 Apr 2011 13:33:53 +0000 (09:33 -0400)]
gc: fix use of typekind array in error messages

Fixes #1697.

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

14 years agoruntime: fix gdb support for channels.
Luuk van Dijk [Thu, 14 Apr 2011 13:32:20 +0000 (15:32 +0200)]
runtime: fix gdb support for channels.

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

14 years agoruntime: fix set and not used in chan.c
Dave Cheney [Thu, 14 Apr 2011 12:16:40 +0000 (08:16 -0400)]
runtime: fix set and not used in chan.c

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

14 years agolib9/create.c: delete unused variable
Rob Pike [Thu, 14 Apr 2011 06:12:48 +0000 (23:12 -0700)]
lib9/create.c: delete unused variable
fixes build with GCC4.6

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

14 years agotag weekly.2011-04-13
Andrew Gerrand [Thu, 14 Apr 2011 04:19:34 +0000 (14:19 +1000)]
tag weekly.2011-04-13

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

14 years agoweekly.2011-04-13 weekly.2011-04-13
Andrew Gerrand [Thu, 14 Apr 2011 04:18:35 +0000 (14:18 +1000)]
weekly.2011-04-13

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

14 years agoruntime: drop chan circular linked list in favor of circular buffer
Russ Cox [Thu, 14 Apr 2011 03:42:06 +0000 (23:42 -0400)]
runtime: drop chan circular linked list in favor of circular buffer

The list elements are already being allocated out of a
single memory buffer.  We can drop the Link* pointer
following and the memory it requires, replacing it with
index operations.

The change also keeps a channel from containing a pointer
back into its own allocation block, which would create a
cycle.  Blocks involved in cycles are not guaranteed to be
finalized properly, and channels depend on finalizers to
free OS-level locks on some systems.  The self-reference
was keeping channels from being garbage collected.

runtime-gdb.py will need to be updated in order to dump
the content of buffered channels with the new data structure.

Fixes #1676.

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

14 years agopkg: manual cleanup of some gofixed code
Russ Cox [Thu, 14 Apr 2011 03:36:00 +0000 (23:36 -0400)]
pkg: manual cleanup of some gofixed code

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

14 years agogc: fix func syntax error
Russ Cox [Thu, 14 Apr 2011 02:48:21 +0000 (22:48 -0400)]
gc: fix func syntax error

Fixes #1685.

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

14 years agonet: sort records returned by LookupMX
Corey Thomasson [Thu, 14 Apr 2011 00:30:56 +0000 (10:30 +1000)]
net: sort records returned by LookupMX

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

14 years agodoc/install.html: document use of libc6-dev-i386
Andrew Gerrand [Thu, 14 Apr 2011 00:28:59 +0000 (10:28 +1000)]
doc/install.html: document use of libc6-dev-i386

Fixes #1689.

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

14 years agogovet: make name-matching for printf etc. case-insensitive.
Rob Pike [Wed, 13 Apr 2011 23:57:44 +0000 (16:57 -0700)]
govet: make name-matching for printf etc. case-insensitive.
Update goyacc, cgo to be more canonical in their naming and silence the new warnings.

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

14 years agoimage: allow "?" wildcards when registering image formats.
Nigel Tao [Wed, 13 Apr 2011 23:56:42 +0000 (09:56 +1000)]
image: allow "?" wildcards when registering image formats.

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

14 years agogofmt: gofmt -s -w src misc
Robert Griesemer [Wed, 13 Apr 2011 22:13:59 +0000 (15:13 -0700)]
gofmt: gofmt -s -w src misc

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

14 years agolibmach: fix the windows build.
Rob Pike [Wed, 13 Apr 2011 21:57:47 +0000 (14:57 -0700)]
libmach: fix the windows build.
Newly enabled compiler errors need workaround.

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

14 years agofix build: disable gofmt test script, enable gotest testing instead
Robert Griesemer [Wed, 13 Apr 2011 21:24:38 +0000 (14:24 -0700)]
fix build: disable gofmt test script, enable gotest testing instead

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

14 years agohttp: flesh out server Expect handling + tests
Brad Fitzpatrick [Wed, 13 Apr 2011 21:09:04 +0000 (14:09 -0700)]
http: flesh out server Expect handling + tests

This mostly adds Expect 100-continue tests (from
the perspective of server correctness) that were
missing before.

It also fixes a few missing cases that will
probably never come up in practice, but it's nice
to have handled correctly.

Proper 100-continue client support remains a TODO.

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

14 years agogofmt: add test framework in Go
Robert Griesemer [Wed, 13 Apr 2011 20:59:59 +0000 (13:59 -0700)]
gofmt: add test framework in Go

- replaced existing testdata/test.sh with new gofmt_test
- added initial test case for rewrite tests

TODO: Need to add more tests.

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

14 years agogofmt: minor refactor to permit easy testing
Robert Griesemer [Wed, 13 Apr 2011 20:57:53 +0000 (13:57 -0700)]
gofmt: minor refactor to permit easy testing

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

14 years agoreflect: inline method implementations
Russ Cox [Wed, 13 Apr 2011 20:55:20 +0000 (16:55 -0400)]
reflect: inline method implementations

This CL is only cut-and-paste, moving code around.
Moving it in a separate CL should simplify the diffs in later CLs.

There are three patterns here.

1. A function like
        func (v Value) M() (...) {
                return v.panicIfNot(K).(*kValue).M()
        }
becomes
        func (v Value) M() (...) {
                vv := v.panicIfNot(K).(*kValue)

                // body of (*kValue).M, s/v./vv./g
        }

2. A function like
        func (v Value) M() (...) {
                return v.panicIfNots(kList).(mer).M()
        }
becomes
        func (v Value) M() (...) {
                switch vv := v.panicIfNots(kList).(type) {
                case *k1Value:
                        // body of (*k1Value).M, s/v./vv./g
                case *k2Value:
                        // body of (*k2Value).M, s/v./vv./g
                ...
                }
                panic("not reached")
        }

3. The rewrite of Value.Set follows 2, but each case
is built from the bodies of (*kValue).SetValue and (*kValue).Set.
        func (v *kValue) SetValue(x Value) {
                v.Set(x.panicIfNot(K).(*kValue)
        }
        func (v *kValue) Set(x *kValue) {
                ... body
        }
becomes, in the switch from 2,
                case *kValue:
                        xx := x.panicIfNot(K).(*kValue)
                        ... body, s/v./vv./g; s/x./xx./g

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

14 years agogofix: fix embarrassing typo in osopen.go
Rob Pike [Wed, 13 Apr 2011 20:49:24 +0000 (13:49 -0700)]
gofix: fix embarrassing typo in osopen.go

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

14 years agolibmach: fix freebsd compiler errors
Russ Cox [Wed, 13 Apr 2011 20:26:25 +0000 (16:26 -0400)]
libmach: fix freebsd compiler errors

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

14 years agobuild: tidy intermediate files during build
Russ Cox [Wed, 13 Apr 2011 20:24:57 +0000 (16:24 -0400)]
build: tidy intermediate files during build

This CL changes the behavior of 'make install' and 'make test'
in the src/cmd directory and the src/pkg directory to have
each recursive make clean up after itself immediately.

It does the same in test/run, removing $F.$A and $A.out
(the common byproducts) between runs.

On machines with slow disks and aggressive kernel caching,
cleaning up immediately can mean that the intermediate
objects never get written to disk.

This change eliminates almost all the disk waiting during
all.bash on my laptop (a Thinkpad X201s with an SSD running Linux).

147.50u 19.95s 277.34r before
148.53u 21.64s 179.59r after

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

14 years agobuild: use gcc -Werror
Russ Cox [Wed, 13 Apr 2011 20:18:09 +0000 (16:18 -0400)]
build: use gcc -Werror

Better to fix the warnings that we find.

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

14 years agoos/inotify: use _test for test files, not _obj
Russ Cox [Wed, 13 Apr 2011 20:17:49 +0000 (16:17 -0400)]
os/inotify: use _test for test files, not _obj

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

14 years agobufio: add ReadLine
Adam Langley [Wed, 13 Apr 2011 19:12:28 +0000 (15:12 -0400)]
bufio: add ReadLine

It matches encoding/line exactly and the tests are copied from there.
If we land this, then encoding/line will get marked as deprecated then
deleted in time.

R=rsc, rog, peterGo
CC=golang-dev
https://golang.org/cl/4389046

14 years agoio: clarify that ReadAt shouldn't move the seek offset
Brad Fitzpatrick [Wed, 13 Apr 2011 18:18:38 +0000 (11:18 -0700)]
io: clarify that ReadAt shouldn't move the seek offset

R=r, mkrautz, r2, rsc
CC=golang-dev
https://golang.org/cl/4415041

14 years agogofmt: avoid endless loops
Robert Griesemer [Wed, 13 Apr 2011 16:38:13 +0000 (09:38 -0700)]
gofmt: avoid endless loops

With the (partial) resolution of identifiers done
by the go/parser, ast.Objects point may introduce
cycles in the AST. Don't follow *ast.Objects, and
replace them with nil instead (they are likely
incorrect after a rewrite anyway).

- minor manual cleanups after reflect change automatic rewrite
- includes fix by rsc related to reflect change

Fixes #1667.

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

14 years agogo/ast: fixed bug in NotNilFilter, added test
Robert Griesemer [Wed, 13 Apr 2011 16:37:13 +0000 (09:37 -0700)]
go/ast: fixed bug in NotNilFilter, added test

- fixed a couple of comments
- cleanups after reflect change

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

14 years agobuilder: fix documentation s/\.gobuilder/.gobuildkey/
Andrew Gerrand [Wed, 13 Apr 2011 04:49:56 +0000 (14:49 +1000)]
builder: fix documentation s/\.gobuilder/.gobuildkey/

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

14 years agomisc/vim: add plugin with Fmt command.
Dmitry Chestnykh [Wed, 13 Apr 2011 01:55:41 +0000 (11:55 +1000)]
misc/vim: add plugin with Fmt command.

Fmt command filters the current Go buffer through gofmt.
It tries to preserve cursor position and avoids replacing
the buffer with stderr output.

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

14 years agoarchive/tar: fix example's handling of os.EOF.
David Symonds [Wed, 13 Apr 2011 00:56:33 +0000 (10:56 +1000)]
archive/tar: fix example's handling of os.EOF.

Fixes #1677.

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

14 years agogodashboard: Show packages at launchpad.net
Gustavo Niemeyer [Wed, 13 Apr 2011 00:34:35 +0000 (10:34 +1000)]
godashboard: Show packages at launchpad.net

The changes were not tested for real in an App Engine environment,
so extra care should be taken.  That said, some static testing
was done with pyflakes, and a few existent problems were fixed on
the way.

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

14 years agoos: fix Readdir in Plan 9
Fazlul Shahriar [Tue, 12 Apr 2011 23:58:56 +0000 (16:58 -0700)]
os: fix Readdir in Plan 9

'TestReaddir.*' tests now passes.

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

14 years ago8l: correct Plan 9 compiler warnings
Lucio De Re [Tue, 12 Apr 2011 20:21:01 +0000 (16:21 -0400)]
8l: correct Plan 9 compiler warnings

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

14 years agofmt: allow %U for unsigned integers.
Rob Pike [Tue, 12 Apr 2011 18:03:05 +0000 (11:03 -0700)]
fmt: allow %U for unsigned integers.
Suggested by jan.mercl@nic.cz.

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

14 years agold: ELF header function declarations.
Lucio De Re [Tue, 12 Apr 2011 18:00:09 +0000 (11:00 -0700)]
ld: ELF header function declarations.

Added "void" inside "()" for two functions.

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

14 years agoC+A: Add Lucio De Re
Rob Pike [Tue, 12 Apr 2011 17:58:54 +0000 (10:58 -0700)]
C+A: Add Lucio De Re
I entered only one of his several addresses, the one that recent CLs use.

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

14 years agohttp: client gzip support
Brad Fitzpatrick [Tue, 12 Apr 2011 16:35:07 +0000 (09:35 -0700)]
http: client gzip support

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

14 years agoopenpgp: Fix improper := shadowing
Gustavo Niemeyer [Tue, 12 Apr 2011 14:48:05 +0000 (11:48 -0300)]
openpgp: Fix improper := shadowing

R=golang-dev, agl1, jnml
CC=golang-dev
https://golang.org/cl/4381058

14 years agoimage/ycbcr: new package.
Nigel Tao [Tue, 12 Apr 2011 12:32:03 +0000 (22:32 +1000)]
image/ycbcr: new package.

R=r, rsc, nigeltao_gnome
CC=golang-dev, raph
https://golang.org/cl/4374043

14 years agonet: fix laddr typo in test code.
Nigel Tao [Tue, 12 Apr 2011 00:36:41 +0000 (10:36 +1000)]
net: fix laddr typo in test code.

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

14 years agold: fix dwarf decoding of strings for struct's fieldnames
Luuk van Dijk [Mon, 11 Apr 2011 20:38:37 +0000 (16:38 -0400)]
ld: fix dwarf decoding of strings for struct's fieldnames

Moved Sym printing to Yconv.
Fixed warning in data.c

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

14 years agohttp: fix incorrect prints found by govet
Robert Hencke [Mon, 11 Apr 2011 20:05:08 +0000 (13:05 -0700)]
http: fix incorrect prints found by govet

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4370053

14 years agosyscall: fix StartProcess in Plan 9
Fazlul Shahriar [Mon, 11 Apr 2011 19:39:53 +0000 (12:39 -0700)]
syscall: fix StartProcess in Plan 9

This makes os_test.TestStartProcess test from os package pass.

R=paulzhol, r2, r
CC=golang-dev
https://golang.org/cl/4385052

14 years agocrypto/x509: expose complete DER data
Mikkel Krautz [Mon, 11 Apr 2011 15:20:12 +0000 (11:20 -0400)]
crypto/x509: expose complete DER data

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

14 years agoasn1: Implement correct marshalling of length octets
Luit van Drongelen [Mon, 11 Apr 2011 14:28:34 +0000 (10:28 -0400)]
asn1: Implement correct marshalling of length octets

Fixes #1683

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

14 years agoA+C: Luit van Drongelen (individual CLA)
Russ Cox [Mon, 11 Apr 2011 14:20:42 +0000 (10:20 -0400)]
A+C: Luit van Drongelen (individual CLA)

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

14 years agonet: disable multicast tests by default.
Dave Cheney [Mon, 11 Apr 2011 00:39:21 +0000 (10:39 +1000)]
net: disable multicast tests by default.

Fixes #1649.

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

14 years agomisc/vim: update type highlighting for new reflect package
David Symonds [Sun, 10 Apr 2011 22:48:19 +0000 (08:48 +1000)]
misc/vim: update type highlighting for new reflect package

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

14 years agoarchive/zip: add new type ReadCloser, make OpenReader return it.
Dmitry Chestnykh [Sun, 10 Apr 2011 01:23:23 +0000 (11:23 +1000)]
archive/zip: add new type ReadCloser, make OpenReader return it.
Fixes #1678.

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

14 years agold: 25% faster
Russ Cox [Sat, 9 Apr 2011 13:44:20 +0000 (09:44 -0400)]
ld: 25% faster

The ld time was dominated by symbol table processing, so
  * increase hash table size
  * emit fewer symbols in gc (just 1 per string, 1 per type)
  * add read-only lookup to avoid creating spurious symbols
  * add linked list to speed whole-table traversals

Breaks dwarf generator (no idea why), so disable dwarf.

Reduces time for 6l to link godoc by 25%.

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

14 years agogo/printer, gofmt: use blank to separate import rename from import path
Robert Griesemer [Fri, 8 Apr 2011 22:47:21 +0000 (15:47 -0700)]
go/printer, gofmt: use blank to separate import rename from import path

Note that declarations.golden is not using spaces for alignment (so
that the alignment tabs are visible) which is why this change affects
the test cases significantly. gofmt uses spaces for alignment (by default)
and only tabs for indentation.

gofmt -w src misc (no changes)

Fixes #1673.

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

14 years agobig: don't crash when printing nil ints
Adam Langley [Fri, 8 Apr 2011 19:43:19 +0000 (15:43 -0400)]
big: don't crash when printing nil ints

"%#v" of a structure with *big.Int's tends to crash a lot otherwise.

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

14 years ago8g: optimize byte mov
Russ Cox [Fri, 8 Apr 2011 17:53:59 +0000 (13:53 -0400)]
8g: optimize byte mov

Rewrite MOVB with less expensive
instruction when possible.

Suggested by atomic symbol.

benchmark                                        old ns/op    new ns/op    delta
crc32.BenchmarkCrc32KB                               13066         3942  -69.83%
crc64.BenchmarkCrc64KB                                8780         5949  -32.24%
lzw.BenchmarkDecoder1e4                             771224       636538  -17.46%
lzw.BenchmarkDecoder1e5                            7101218      6096634  -14.15%
lzw.BenchmarkDecoder1e6                           69762020     60789400  -12.86%
lzw.BenchmarkEncoder1e4                             707968       638812   -9.77%
lzw.BenchmarkEncoder1e5                            6567122      5965552   -9.16%
lzw.BenchmarkEncoder1e6                           65006000     58911680   -9.38%
utf8_test.BenchmarkRuneCountTenASCIIChars              166          165   -0.60%
utf8_test.BenchmarkRuneCountTenJapaneseChars           246          258   +4.88%
utf8_test.BenchmarkEncodeASCIIRune                      13           10  -23.08%
utf8_test.BenchmarkEncodeJapaneseRune                   37           16  -56.76%
utf8_test.BenchmarkDecodeASCIIRune                      23           21   -8.70%
utf8_test.BenchmarkDecodeJapaneseRune                   58           32  -44.83%

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

14 years agogc: fix weird error message
Russ Cox [Fri, 8 Apr 2011 17:53:32 +0000 (13:53 -0400)]
gc: fix weird error message

Fixes #1670.

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

14 years agoio: fixes for Read with n > 0, os.EOF
Robert Hencke [Fri, 8 Apr 2011 17:45:56 +0000 (13:45 -0400)]
io: fixes for Read with n > 0, os.EOF

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

14 years agobug327: document what's being tested
Russ Cox [Fri, 8 Apr 2011 17:42:20 +0000 (13:42 -0400)]
bug327: document what's being tested

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

14 years agold: fix arm build
Russ Cox [Fri, 8 Apr 2011 17:42:11 +0000 (13:42 -0400)]
ld: fix arm build

R=ken2
CC=golang-dev, mikkel
https://golang.org/cl/4384048

14 years agohttp: do not listen on 0.0.0.0 during test
Russ Cox [Fri, 8 Apr 2011 17:04:29 +0000 (13:04 -0400)]
http: do not listen on 0.0.0.0 during test

Quiets the pop-up boxes on OS X.

R=bradfitzgo, r2
CC=golang-dev
https://golang.org/cl/4387042

14 years agocodereview: automatically port old diffs forward
Russ Cox [Fri, 8 Apr 2011 17:00:40 +0000 (13:00 -0400)]
codereview: automatically port old diffs forward

In the current codereview, if a patch was written against
a version of a file that had subsequently been edited,
hg clpatch would fail, even if the patch and the edits were
in different parts of the file.  In this situation the reviewer
typically wrote back saying "please hg sync and hg mail
to update the patch".

This change rewrites the patch automatically, using the
same transformation that hg sync + hg mail would.

If the interim changes (since the patch was created)
affect the same line ranges as the patch, clpatch will
still refuse to apply it.  But this CL should make
of the trivial conflicts we see just go away.

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

14 years agogotest: Fix fix for \r\n on windows.
Rob Pike [Fri, 8 Apr 2011 16:50:20 +0000 (09:50 -0700)]
gotest: Fix fix for \r\n on windows.

R=rsc, brainman, rh, r2
CC=golang-dev
https://golang.org/cl/4366045

14 years agoupdate go tree for reflect changes
Russ Cox [Fri, 8 Apr 2011 16:27:58 +0000 (12:27 -0400)]
update go tree for reflect changes

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

14 years agogofix: reflect changes
Russ Cox [Fri, 8 Apr 2011 16:27:24 +0000 (12:27 -0400)]
gofix: reflect changes

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

14 years agogofix: add -diff, various fixes and helpers
Russ Cox [Fri, 8 Apr 2011 16:27:08 +0000 (12:27 -0400)]
gofix: add -diff, various fixes and helpers

  * add -diff command line option
  * use scoping information in refersTo, isPkgDot, isPtrPkgDot.
  * add new scoping-based helpers countUses, rewriteUses, assignsTo, isTopName.
  * rename rewrite to walk, add walkBeforeAfter.
  * add toy typechecker, a placeholder for go/types

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

14 years agoreflect: new Type and Value definitions
Russ Cox [Fri, 8 Apr 2011 16:26:51 +0000 (12:26 -0400)]
reflect: new Type and Value definitions

Type is now an interface that implements all the possible type methods.
Instead of a type switch on a reflect.Type t, switch on t.Kind().
If a method is invoked on the wrong kind of type (for example,
calling t.Field(0) when t.Kind() != Struct), the call panics.

There is one method renaming: t.(*ChanType).Dir() is now t.ChanDir().

Value is now a struct value that implements all the possible value methods.
Instead of a type switch on a reflect.Value v, switch on v.Kind().
If a method is invoked on the wrong kind of value (for example,
calling t.Recv() when t.Kind() != Chan), the call panics.

Since Value is now a struct, not an interface, its zero value
cannot be compared to nil.  Instead of v != nil, use v.IsValid().
Instead of other uses of nil as a Value, use Value{}, the zero value.

Many methods have been renamed, most due to signature conflicts:

           OLD                          NEW

    v.(*ArrayValue).Elem             v.Index
    v.(*BoolValue).Get               v.Bool
    v.(*BoolValue).Set               v.SetBool
    v.(*ChanType).Dir                v.ChanDir
    v.(*ChanValue).Get               v.Pointer
    v.(*ComplexValue).Get            v.Complex
    v.(*ComplexValue).Overflow       v.OverflowComplex
    v.(*ComplexValue).Set            v.SetComplex
    v.(*FloatValue).Get              v.Float
    v.(*FloatValue).Overflow         v.OverflowFloat
    v.(*FloatValue).Set              v.SetFloat
    v.(*FuncValue).Get               v.Pointer
    v.(*InterfaceValue).Get          v.InterfaceData
    v.(*IntValue).Get                v.Int
    v.(*IntValue).Overflow           v.OverflowInt
    v.(*IntValue).Set                v.SetInt
    v.(*MapValue).Elem               v.MapIndex
    v.(*MapValue).Get                v.Pointer
    v.(*MapValue).Keys               v.MapKeys
    v.(*MapValue).SetElem            v.SetMapIndex
    v.(*PtrValue).Get                v.Pointer
    v.(*SliceValue).Elem             v.Index
    v.(*SliceValue).Get              v.Pointer
    v.(*StringValue).Get             v.String
    v.(*StringValue).Set             v.SetString
    v.(*UintValue).Get               v.Uint
    v.(*UintValue).Overflow          v.OverflowUint
    v.(*UintValue).Set               v.SetUint
    v.(*UnsafePointerValue).Get      v.Pointer
    v.(*UnsafePointerValue).Set      v.SetPointer

Part of the motivation for this change is to enable a more
efficient implementation of Value, one that does not allocate
memory during most operations.  To reduce the size of the CL,
this CL's implementation is a wrapper around the old API.
Later CLs will make the implementation more efficient without
changing the API.

Other CLs to be submitted at the same time as this one
add support for this change to gofix (4343047) and update
the Go source tree (4353043).

R=gri, iant, niemeyer, r, rog, gustavo, r2
CC=golang-dev
https://golang.org/cl/4281055

14 years agogofix: be more conservative about rewrite to os.Create
Russ Cox [Fri, 8 Apr 2011 14:59:25 +0000 (10:59 -0400)]
gofix: be more conservative about rewrite to os.Create

Rewrite only if we understood all the flags we saw.

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

14 years agogotest: handle \r\n returned by gomake on Windows (fixes build)
Alex Brainman [Fri, 8 Apr 2011 13:53:57 +0000 (23:53 +1000)]
gotest: handle \r\n returned by gomake on Windows (fixes build)

R=golang-dev, peterGo, rsc1
CC=Joe Poirier, golang-dev
https://golang.org/cl/4370048

14 years agogo/types: fix build: use the right compiler to compile test case
Robert Griesemer [Fri, 8 Apr 2011 05:10:39 +0000 (22:10 -0700)]
go/types: fix build: use the right compiler to compile test case

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

14 years agogotype: use go/types GcImporter
Robert Griesemer [Fri, 8 Apr 2011 04:42:30 +0000 (21:42 -0700)]
gotype: use go/types GcImporter

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

14 years agogo/types: New Go type hierarchy implementation for AST.
Robert Griesemer [Fri, 8 Apr 2011 04:40:37 +0000 (21:40 -0700)]
go/types: New Go type hierarchy implementation for AST.

This CL defines a new, more Go-like representation of
Go types (different structs for different types as
opposed to a single Type node). It also implements
an ast.Importer for object/archive files generated
by the gc compiler tool chain. Besides the individual
type structs, the main difference is the handling of
named types: In the old world, a named type had a
non-nil *Object pointer but otherwise looked no
different from other types. In this new model, named
types have their own representation types.Name. As
a result, resolving cycles is a bit simpler during
construction, at the cost of having to deal with
types.Name nodes explicitly later. It remains to be
seen if this is a good approach. Nevertheless, code
involving types reads more nicely and benefits from
full type checking. Also, the representation seems
to more closely match the spec wording.

Credits: The original version of the gc importer was
written by Evan Shaw (chickencha@gmail.com). The new
version in this CL is based largely on Evan's original
code but contains bug fixes, a few simplifications,
some restructuring, and was adjusted to use the
new type hierarchy. I have added a comprehensive test
that imports all packages found under $GOROOT/pkg (with
a 3s time-out to limit the run-time of the test). Run
gotest -v for details.

The original version of ExportData (exportdata.go) was
written by Russ Cox (rsc@golang.org). The current version
is returning the internal buffer positioned at the beginning
of the export data instead of printing the export data to
stdout.

With the new types package, the existing in-progress
typechecker package is deprecated. I will delete it
once all functionality has been brought over.

R=eds, rog, rsc
CC=golang-dev
https://golang.org/cl/4314054

14 years agoscanner: better TokenString output
Robert Griesemer [Fri, 8 Apr 2011 02:41:55 +0000 (19:41 -0700)]
scanner: better TokenString output

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

14 years agoA codewalk through a simple program that illustrates several aspects of Go functions...
John DeNero [Fri, 8 Apr 2011 01:05:15 +0000 (18:05 -0700)]
A codewalk through a simple program that illustrates several aspects of Go functions: function objects, higher-order functions, variadic functions, tail recursion, etc.  The example program simulates the game of Pig, a dice game with simple rules but a nontrivial solution.

R=adg, rsc, iant2, r
CC=golang-dev
https://golang.org/cl/4306045

14 years agotest/bench: enable build and test on Windows
Alex Brainman [Fri, 8 Apr 2011 00:43:25 +0000 (10:43 +1000)]
test/bench: enable build and test on Windows

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4366043

14 years agomisc/cgo/life: enable build and test on Windows
Alex Brainman [Fri, 8 Apr 2011 00:35:35 +0000 (10:35 +1000)]
misc/cgo/life: enable build and test on Windows

R=golang-dev, rsc1
CC=golang-dev, vcc
https://golang.org/cl/4374044

14 years agosyscall: fix Windows Signalled
Alex Brainman [Fri, 8 Apr 2011 00:27:47 +0000 (10:27 +1000)]
syscall: fix Windows Signalled

Thanks to fhs.

R=golang-dev, r2
CC=ality, fhs, golang-dev
https://golang.org/cl/4375044

14 years agogc: bug327
Russ Cox [Thu, 7 Apr 2011 22:53:47 +0000 (18:53 -0400)]
gc: bug327

Fixes #1674.

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

14 years agosyscall: fix freebsd/386 again
Russ Cox [Thu, 7 Apr 2011 19:44:10 +0000 (15:44 -0400)]
syscall: fix freebsd/386 again

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

14 years agosyscall: freebsd/386 Syscall9 (fix build)
Russ Cox [Thu, 7 Apr 2011 19:35:04 +0000 (15:35 -0400)]
syscall: freebsd/386 Syscall9 (fix build)

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

14 years agosyscall: fix build
Mikio Hara [Thu, 7 Apr 2011 19:03:45 +0000 (12:03 -0700)]
syscall: fix build

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

14 years agold: fix Mach-O X86_64_RELOC_SIGNED relocations
Mikkel Krautz [Thu, 7 Apr 2011 18:20:42 +0000 (14:20 -0400)]
ld: fix Mach-O X86_64_RELOC_SIGNED relocations

Fixes #1658.

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

14 years agold: fix Mach-O bss bug
Mikkel Krautz [Thu, 7 Apr 2011 17:17:28 +0000 (13:17 -0400)]
ld: fix Mach-O bss bug

Fixes #1559.

R=rsc
CC=golang-dev, peterGo, rog
https://golang.org/cl/4356046

14 years agocodereview: fix clpatch
Russ Cox [Thu, 7 Apr 2011 17:06:02 +0000 (13:06 -0400)]
codereview: fix clpatch

I love Python.  Write once, crash anywhere.

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

14 years agocodereview: drop Author: line on self-clpatch
Russ Cox [Thu, 7 Apr 2011 17:03:06 +0000 (13:03 -0400)]
codereview: drop Author: line on self-clpatch

Right now if a Go developer makes a patch on one machine
and then clpatches it onto another machine, changes
subsequently made to the description are kept only
locally, under the assumption that you are running
clpatch because someone else wrote the CL, so you
don't have permission to update the web.

This change makes clpatch discard the "this was a
clpatch" information from the metadata when you
clpatch your own CLs from one machine to another.

This should eliminate some confusion (for example
in CL 4314054) but will no doubt introduce other
confusion.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4387041

14 years agosyscall: fix typo in mmap comment
Dave Cheney [Thu, 7 Apr 2011 03:07:32 +0000 (23:07 -0400)]
syscall: fix typo in mmap comment

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