]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/godoc: use go/build to determine package and example files
Robert Griesemer [Tue, 19 Feb 2013 19:19:58 +0000 (11:19 -0800)]
cmd/godoc: use go/build to determine package and example files

Also:
- faster code for example extraction
- simplify handling of command documentation:
  all "main" packages are treated as commands
- various minor cleanups along the way

For commands written in Go, any doc.go file containing
documentation must now be part of package main (rather
then package documentation), otherwise the documentation
won't show up in godoc (it will still build, though).

For commands written in C, documentation may still be
in doc.go files defining package documentation, but the
recommended way is to explicitly ignore those files with
a +build ignore constraint to define package main.

Fixes #4806.

R=adg, rsc, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7333046

12 years agopath/filepath: add examples for SplitList and Rel.
Kamil Kisiel [Tue, 19 Feb 2013 18:41:35 +0000 (10:41 -0800)]
path/filepath: add examples for SplitList and Rel.

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

12 years agopath/filepath: document Dir better
Russ Cox [Tue, 19 Feb 2013 18:24:03 +0000 (13:24 -0500)]
path/filepath: document Dir better

This comment matches the one in path.

Fixes #4837.

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

12 years agogo/types: Use left-hand side's type as hint for right-hand
Andrew Wilkins [Tue, 19 Feb 2013 17:20:56 +0000 (09:20 -0800)]
go/types: Use left-hand side's type as hint for right-hand
side expression evaluation in assignment operations.

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

12 years agodebug/dwarf: add flag_present attribute encoding.
Robin Eklind [Tue, 19 Feb 2013 16:58:31 +0000 (00:58 +0800)]
debug/dwarf: add flag_present attribute encoding.

ref: http://www.dwarfstd.org/doc/DWARF4.pdf

Update #4829

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

12 years agostrings: faster Count, Index
Donovan Hide [Tue, 19 Feb 2013 15:36:15 +0000 (10:36 -0500)]
strings: faster Count, Index

Slightly better benchmarks for when string and separator are equivalent and also less branching in inner loops.
benchmark                        old ns/op    new ns/op    delta
BenchmarkGenericNoMatch               3430         3442   +0.35%
BenchmarkGenericMatch1               23590        22855   -3.12%
BenchmarkGenericMatch2              108031       105025   -2.78%
BenchmarkSingleMaxSkipping            2969         2704   -8.93%
BenchmarkSingleLongSuffixFail         2826         2572   -8.99%
BenchmarkSingleMatch                205268       197832   -3.62%
BenchmarkByteByteNoMatch               987          921   -6.69%
BenchmarkByteByteMatch                2014         1749  -13.16%
BenchmarkByteStringMatch              3083         3050   -1.07%
BenchmarkHTMLEscapeNew                 922          915   -0.76%
BenchmarkHTMLEscapeOld                1654         1570   -5.08%
BenchmarkByteByteReplaces            11897        11556   -2.87%
BenchmarkByteByteMap                  4485         4255   -5.13%
BenchmarkIndexRune                     174          121  -30.46%
BenchmarkIndexRuneFastPath              41           41   -0.24%
BenchmarkIndex                          45           44   -0.22%
BenchmarkMapNoChanges                  433          431   -0.46%
BenchmarkIndexHard1                4015336      3316490  -17.40%
BenchmarkIndexHard2                3976254      3395627  -14.60%
BenchmarkIndexHard3                3973158      3378329  -14.97%
BenchmarkCountHard1                4403549      3448512  -21.69%
BenchmarkCountHard2                4387437      3413059  -22.21%
BenchmarkCountHard3                4403891      3382661  -23.19%
BenchmarkIndexTorture                28354        25864   -8.78%
BenchmarkCountTorture                29625        27463   -7.30%
BenchmarkFields                   38752040     39169840   +1.08%
BenchmarkFieldsFunc               38797765     38888060   +0.23%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkSingleMaxSkipping         3367.07      3697.62    1.10x
BenchmarkSingleLongSuffixFail       354.51       389.47    1.10x
BenchmarkSingleMatch                 73.07        75.82    1.04x
BenchmarkFields                      27.06        26.77    0.99x
BenchmarkFieldsFunc                  27.03        26.96    1.00x

R=dave, fullung, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/7350045

12 years agoA+C: Donovan Hide (individual CLA)
Russ Cox [Tue, 19 Feb 2013 15:36:03 +0000 (10:36 -0500)]
A+C: Donovan Hide (individual CLA)

Generated by addca.

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

12 years agocodereview: give up on http fetch after 30 seconds
Russ Cox [Tue, 19 Feb 2013 15:18:16 +0000 (10:18 -0500)]
codereview: give up on http fetch after 30 seconds

If Python blocks in the SSL handshake it seems to be
completely uninterruptible, and I've been seeing it
block for at least hours recently. I don't know if the
problem is on the client side or the server side or
somewhere in the network, but setting the timeout
at least means you're guaranteed a new shell prompt
(after printing some errors).

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

12 years agoruntime: replace bubble sort with heap sort in select
Russ Cox [Tue, 19 Feb 2013 15:15:13 +0000 (10:15 -0500)]
runtime: replace bubble sort with heap sort in select

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

12 years agoreflect: document tie-breaking in Select
Russ Cox [Tue, 19 Feb 2013 15:13:53 +0000 (10:13 -0500)]
reflect: document tie-breaking in Select

The exact words are taken from the spec.

Fixes some confusion on golang-nuts.

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

12 years agosrc: use internal tests if possible
Robin Eklind [Tue, 19 Feb 2013 15:02:01 +0000 (10:02 -0500)]
src: use internal tests if possible

If a test can be placed in the same package ("internal"), it is placed
there. This facilitates testing of package-private details. Because of
dependency cycles some packages cannot be tested by internal tests.

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

12 years agodoc/gccgo_contribute: mention gofrontend-dev@googlegroups.com mailing list
Shenghou Ma [Tue, 19 Feb 2013 11:20:44 +0000 (19:20 +0800)]
doc/gccgo_contribute: mention gofrontend-dev@googlegroups.com mailing list

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

12 years agosrc/run.rc: "go env -9" is not valid, the correct command is "go tool dist env -9".
Lucio De Re [Tue, 19 Feb 2013 11:02:18 +0000 (19:02 +0800)]
src/run.rc: "go env -9" is not valid, the correct command is "go tool dist env -9".

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

12 years agoexp/cookiejar: store cookies under TLD+1 on nil public suffix list
Volker Dobler [Tue, 19 Feb 2013 08:12:36 +0000 (19:12 +1100)]
exp/cookiejar: store cookies under TLD+1 on nil public suffix list

The current implementation would store all cookies received from
any .com domain under "com" in the entries map if a nil public
suffix list is used in constructing the Jar. This is inefficient.

This CL uses the TLD+1 of the domain if the public suffix list
is nil which has two advantages:
 - It uses the entries map efficiently.
 - It prevents a host foo.com to set cookies for bar.com.
   (It may set the cookie, but it won't be returned to bar.com.)
A domain like www.british-library.uk may still set a domain
cookie for .british-library.uk in this case.

The behavior for a non-nil public suffix list is unchanged, cookies
are stored under eTLD+1 in this case.

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

12 years agogo/types: Permit dereferencing of named pointer types.
Andrew Wilkins [Tue, 19 Feb 2013 03:03:10 +0000 (19:03 -0800)]
go/types: Permit dereferencing of named pointer types.

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

12 years agogo/types: Pkg *Package field for all objects
Robert Griesemer [Mon, 18 Feb 2013 22:40:47 +0000 (14:40 -0800)]
go/types: Pkg *Package field for all objects

The field is nil for predeclared (universe)
objects and parameter/result variables.

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

12 years agoruntime: preparation for non-Go threads running Go code
Russ Cox [Mon, 18 Feb 2013 18:43:12 +0000 (13:43 -0500)]
runtime: preparation for non-Go threads running Go code

* Handle p==nil in signalstack by setting SS_DISABLE flag.
* Make minit only allocate a signal g if there's not one already.

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

12 years agocmd/6c: fix build
Russ Cox [Mon, 18 Feb 2013 18:29:55 +0000 (13:29 -0500)]
cmd/6c: fix build

copy+paste error while cleaning up CL 7303099 before submit

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

12 years agocmd/6c, cmd/8c: cut stack frames by about half
Russ Cox [Mon, 18 Feb 2013 18:24:04 +0000 (13:24 -0500)]
cmd/6c, cmd/8c: cut stack frames by about half

The routine that adds an automatic to the stack was
adding ptrsize-1 to the size before rounding up.
That addition would only make sense to turn a round down
into a round up. Before a round up, it just wastes a word.

The effect was that a 6c function with one local and
one two-word function call used (8+8)+(16+8) = 40 bytes
instead of 8+16 = 24 bytes.

The wasted space mostly didn't matter, but one place where
it does matter is when trying to stay within the 128-byte
total frame constraint for #pragma textflag 7 functions.

This only affects the C compilers, not the Go compilers.

5c already had correct code, which is now copied to 6c and 8c.

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

12 years agoruntime/debug: make TestFreeOSMemory repeatable
Dmitriy Vyukov [Mon, 18 Feb 2013 11:46:36 +0000 (15:46 +0400)]
runtime/debug: make TestFreeOSMemory repeatable
Fixes #4835.

R=golang-dev, fullung
CC=golang-dev
https://golang.org/cl/7319050

12 years agomisc/vim: update installation instructions to work better with some Linux distributions.
David Symonds [Mon, 18 Feb 2013 03:03:47 +0000 (14:03 +1100)]
misc/vim: update installation instructions to work better with some Linux distributions.

Fixes #3308.

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

12 years agoexp/cookiejar: make cookie sorting deterministic.
Volker Dobler [Mon, 18 Feb 2013 00:27:41 +0000 (11:27 +1100)]
exp/cookiejar: make cookie sorting deterministic.

Re-enable TestUpdateAndDelete, TestExpiration, TestChromiumDomain and
TestChromiumDeletion on Windows.

Sorting of cookies with same path length and same creation
time is done by an additional seqNum field.
This makes the order in which cookies are returned in Cookies
deterministic, even if the system clock is manipulated or on
systems with a low-resolution clock.

The tests now use a synthetic time: This makes cookie testing
reliable in case of bogus system clocks and speeds up the
expiration tests.

R=nigeltao, alex.brainman, dave
CC=golang-dev
https://golang.org/cl/7323063

12 years agoruntime: fix sigaction struct on freebsd
Joel Sing [Sun, 17 Feb 2013 16:23:29 +0000 (03:23 +1100)]
runtime: fix sigaction struct on freebsd

Fix the sa_mask member of the sigaction struct - on FreeBSD this is
declared as a sigset_t, which is an array of four unsigned ints.
Replace the current int64 with Sigset from defs_freebsd_GOARCH, which
has the correct definition.

Unbreaks the FreeBSD builds.

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

12 years agostrings: better mean complexity for Count and Index.
Rémy Oudompheng [Sun, 17 Feb 2013 12:07:17 +0000 (13:07 +0100)]
strings: better mean complexity for Count and Index.

The O(n+m) complexity is obtained probabilistically
by using Rabin-Karp algorithm, which provides the needed complexity
unless exceptional collisions occur, without memory allocation.

benchmark                 old ns/op    new ns/op    delta
BenchmarkIndexHard1         6532331      4045886  -38.06%
BenchmarkIndexHard2         8178173      4038975  -50.61%
BenchmarkIndexHard3         6973687      4042591  -42.03%
BenchmarkCountHard1         6270864      4071090  -35.08%
BenchmarkCountHard2         7838039      4072853  -48.04%
BenchmarkCountHard3         6697828      4071964  -39.20%
BenchmarkIndexTorture       2730546        28934  -98.94%
BenchmarkCountTorture       2729622        29064  -98.94%

Fixes #4600.

R=rsc, donovanhide, remyoudompheng
CC=golang-dev
https://golang.org/cl/7314095

12 years agoruntime: fix build on openbsd
Georg Reinke [Sat, 16 Feb 2013 15:06:59 +0000 (02:06 +1100)]
runtime: fix build on openbsd

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/7312104

12 years agonet: add IPConn through Conn test
Mikio Hara [Sat, 16 Feb 2013 03:55:39 +0000 (12:55 +0900)]
net: add IPConn through Conn test

Also refactors mock ICMP stuff.

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

12 years agoruntime: fix unused variable warning
Dave Cheney [Sat, 16 Feb 2013 03:32:04 +0000 (14:32 +1100)]
runtime: fix unused variable warning

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

12 years agoundo CL 7310096 / 59da6744d66d
Russ Cox [Fri, 15 Feb 2013 22:54:46 +0000 (17:54 -0500)]
undo CL 7310096 / 59da6744d66d

broke windows build

««« original CL description
runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.

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

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

12 years agoos: point users of ProcessState.SysUsage to getrusage(2)
Russ Cox [Fri, 15 Feb 2013 22:11:13 +0000 (17:11 -0500)]
os: point users of ProcessState.SysUsage to getrusage(2)

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

12 years agobuild: clang support
Russ Cox [Fri, 15 Feb 2013 21:37:43 +0000 (13:37 -0800)]
build: clang support

This works with at least one version of clang
that existed at one moment in time.
No guarantees about clangs past or future.

To try:
        CC=clang all.bash

It does not work with the Xcode clang,
because that clang fails at printing a useful answer
to:
        clang -print-libgcc-file-name
The clang that works prints a full path name for
that command, not just "libgcc.a".

Fixes #4713.

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

12 years agoapi: refresh next.txt
Russ Cox [Fri, 15 Feb 2013 21:33:14 +0000 (16:33 -0500)]
api: refresh next.txt

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

12 years agoruntime: allow mem profiles with GOGC=off
Russ Cox [Fri, 15 Feb 2013 19:48:58 +0000 (14:48 -0500)]
runtime: allow mem profiles with GOGC=off

Fixes #3586.

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

12 years agoruntime: show frame pointer values during throw
Russ Cox [Fri, 15 Feb 2013 19:48:47 +0000 (14:48 -0500)]
runtime: show frame pointer values during throw

Should help if stack overflows start happening again.

Fixes #3582.

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

12 years agoruntime: make return from main wait for active panic
Russ Cox [Fri, 15 Feb 2013 19:48:35 +0000 (14:48 -0500)]
runtime: make return from main wait for active panic

Arguably if this happens the program is buggy anyway,
but letting the panic continue looks better than interrupting it.
Otherwise things like this are possible, and confusing:

$ go run x.go
panic: $ echo $?
0
$

Fixes #3934.

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

12 years agocmd/go: reject case-insensitive file name, import collisions
Russ Cox [Fri, 15 Feb 2013 19:39:39 +0000 (14:39 -0500)]
cmd/go: reject case-insensitive file name, import collisions

To make sure that Go code will work when moved to a
system with a case-insensitive file system, like OS X or Windows,
reject any package built from files with names differing
only in case, and also any package built from imported
dependencies with names differing only in case.

Fixes #4773.

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

12 years agospec: clarify when range x does not evaluate x
Russ Cox [Fri, 15 Feb 2013 19:39:28 +0000 (14:39 -0500)]
spec: clarify when range x does not evaluate x

Fixes #4644.

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

12 years agoruntime/pprof: adjust reported line numbers to show call sites
Russ Cox [Fri, 15 Feb 2013 19:27:16 +0000 (14:27 -0500)]
runtime/pprof: adjust reported line numbers to show call sites

This is the same logic used in the standard tracebacks.
The caller pc is the pc after the call, so except in the
fake "call" caused by a panic, back up the pc enough
that the lookup will use the previous instruction.

Fixes #4150.
Fixes #4151.

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

12 years agoruntime: allocate heap metadata at run time
Russ Cox [Fri, 15 Feb 2013 19:27:03 +0000 (14:27 -0500)]
runtime: allocate heap metadata at run time

Before, the mheap structure was in the bss,
but it's quite large (today, 256 MB, much of
which is never actually paged in), and it makes
Go binaries run afoul of exec-time bss size
limits on some BSD systems.

Fixes #4447.

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

12 years agoruntime: ensure forward progress of runtime.Gosched() for locked goroutines
Dmitriy Vyukov [Fri, 15 Feb 2013 18:22:13 +0000 (22:22 +0400)]
runtime: ensure forward progress of runtime.Gosched() for locked goroutines
The removed code leads to the situation when M executes the same locked G again and again.
Fixes #4820.

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

12 years agoruntime: check rt_sigaction return values on linux
Russ Cox [Fri, 15 Feb 2013 18:13:19 +0000 (13:13 -0500)]
runtime: check rt_sigaction return values on linux

(If the mask size is wrong the system call fails.)

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

12 years agoencoding/binary: make type error more specific
Russ Cox [Fri, 15 Feb 2013 18:12:28 +0000 (13:12 -0500)]
encoding/binary: make type error more specific

Right now it says 'invalid type S' for a struct type S.
Instead, say which type inside the struct is the problem.

Fixes #4825.

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

12 years agoexp/cookiejar: fix windows/386 build
Russ Cox [Fri, 15 Feb 2013 17:43:28 +0000 (12:43 -0500)]
exp/cookiejar: fix windows/386 build

More mysteriously broken tests.

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

12 years agoruntime: fix build on linux
Russ Cox [Fri, 15 Feb 2013 17:18:33 +0000 (12:18 -0500)]
runtime: fix build on linux

In addition to the compile failure fixed in signal*.c,
preserving the signal mask led to very strange crashes.
Testing shows that looking for SIG_IGN is all that
matters to get along with nohup, so reintroduce
sigset_zero instead of trying to preserve the signal mask.

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

12 years agoexp/cookiejar: fix windows builder
Russ Cox [Fri, 15 Feb 2013 16:32:31 +0000 (11:32 -0500)]
exp/cookiejar: fix windows builder

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

12 years agoruntime: fix running under nohup
Russ Cox [Fri, 15 Feb 2013 16:18:55 +0000 (11:18 -0500)]
runtime: fix running under nohup

There are two ways nohup(1) might be implemented:
it might mask away the signal, or it might set the handler
to SIG_IGN, both of which are inherited across fork+exec.
So two fixes:

* Make sure to preserve the inherited signal mask at
minit instead of clearing it.

* If the SIGHUP handler is SIG_IGN, leave it that way.

Fixes #4491.

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

12 years agocrypto/x509: support IP SANs.
Adam Langley [Fri, 15 Feb 2013 15:40:17 +0000 (10:40 -0500)]
crypto/x509: support IP SANs.

Subject Alternative Names in X.509 certificates may include IP
addresses. This change adds support for marshaling, unmarshaling and
verifying this form of SAN.

It also causes IP addresses to only be checked against IP SANs,
rather than against hostnames as was previously the case. This
reflects RFC 6125.

Fixes #4658.

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

12 years agoruntime: fix debug output
Dmitriy Vyukov [Fri, 15 Feb 2013 13:04:02 +0000 (17:04 +0400)]
runtime: fix debug output

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

12 years agomime: do not test for .wav on windows
Alex Brainman [Fri, 15 Feb 2013 05:55:51 +0000 (16:55 +1100)]
mime: do not test for .wav on windows

Even builders don't have that mime type

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

12 years agomime: use .wav instead of .bmp during windows tests
Alex Brainman [Fri, 15 Feb 2013 04:52:54 +0000 (15:52 +1100)]
mime: use .wav instead of .bmp during windows tests

Some systems do not have .bmp mime.

Update #4723.

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

12 years agonet: delete TestDialTimeoutHandleLeak
Alex Brainman [Fri, 15 Feb 2013 04:52:12 +0000 (15:52 +1100)]
net: delete TestDialTimeoutHandleLeak

It is too flaky. Tried to make it more reliable,
but that affects other tests (they run too long),
because we do unusual things here, like attempting
to connect to non-existing address and interrupt.

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

12 years agoruntime: expand error for signal received on non-Go thread.
Alan Donovan [Fri, 15 Feb 2013 04:37:14 +0000 (23:37 -0500)]
runtime: expand error for signal received on non-Go thread.

We call runtime.findnull dynamically to avoid exceeding the
static nosplit stack limit check.  (Thanks minux!)

Fixes #4048.

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

12 years agocmd/godoc: add support for doc.Package.Notes
Cosmos Nicolaou [Fri, 15 Feb 2013 04:35:08 +0000 (20:35 -0800)]
cmd/godoc: add support for doc.Package.Notes

Add support for displaying the notes of the form 'MARKER(userid): comment' now collected by the go/doc package. Any two or more uppercase letters are recognised as a marker.

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

12 years agogo/doc: add support for arbitrary notes
Cosmos Nicolaou [Fri, 15 Feb 2013 04:20:32 +0000 (20:20 -0800)]
go/doc: add support for arbitrary notes

Add support for arbitrary notes of the form // MARKER(userid): comment
in the same vein as BUG(userid): A marker must be two or more upper case [A-Z] letters.

R=gri, rsc, bradfitz, jscrockett01
CC=golang-dev
https://golang.org/cl/7322061

12 years agodoc/contribute: fix some tags, remove extra space.
Oling Cat [Fri, 15 Feb 2013 03:01:12 +0000 (14:01 +1100)]
doc/contribute: fix some tags, remove extra space.

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

12 years agocmd/ld: fix -s flag for ELF executables
Anthony Martin [Fri, 15 Feb 2013 02:43:54 +0000 (18:43 -0800)]
cmd/ld: fix -s flag for ELF executables

This fixes a regression introduced in changeset 98034d036d03
which added support for producing host object files.

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

12 years agolog/syslog: fix channel race in test.
Rémy Oudompheng [Fri, 15 Feb 2013 00:07:31 +0000 (11:07 +1100)]
log/syslog: fix channel race in test.

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

12 years agomisc/dashboard/builder: record build result on dashboard
Dave Cheney [Thu, 14 Feb 2013 23:44:29 +0000 (10:44 +1100)]
misc/dashboard/builder: record build result on dashboard

This is part one of two changes intended to make it easier to debug builder failures.

runOutput allows us to control the io.Writer passed to a subcommand. The intention is to add additional debugging information before and after the build which will then be capture and sent to the dashboard.

In this proposal, the only additional information is the build status. See http://build.golang.org/log/e7b5bf435b4de1913fc61781b3295fb3f03aeb6e

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

12 years agosrc/cmd/gc: fix some typos in the escape analysis comments
Carl Shapiro [Thu, 14 Feb 2013 23:38:57 +0000 (15:38 -0800)]
src/cmd/gc: fix some typos in the escape analysis comments

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

12 years agogo/parser: cleanups following CL 7307085
Robert Griesemer [Thu, 14 Feb 2013 21:36:40 +0000 (13:36 -0800)]
go/parser: cleanups following CL 7307085

- use the new AllErrors flag where appropriate
- unless AllErrors is set, eliminate spurious
  errors before they are added to the errors list
  (it turns out that reporting spurious errors always
  leads to too many uninformative errors after all)

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

12 years agoC: add Cosmos Nicolaou (Google CLA)
Robert Griesemer [Thu, 14 Feb 2013 21:35:52 +0000 (13:35 -0800)]
C: add Cosmos Nicolaou (Google CLA)

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

12 years agocmd/gc: remove node printing in redeclare errors
Daniel Morsing [Thu, 14 Feb 2013 20:11:47 +0000 (21:11 +0100)]
cmd/gc: remove node printing in redeclare errors

I suspect this is some debugging which got through the submission process.

Fixes #4789.

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

12 years agoruntime: add more tests for LockOSThread()
Dmitriy Vyukov [Thu, 14 Feb 2013 20:02:12 +0000 (00:02 +0400)]
runtime: add more tests for LockOSThread()
Just test some additional paths through the scheduler.

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

12 years agocmd/go: fix vet
Russ Cox [Thu, 14 Feb 2013 20:00:51 +0000 (15:00 -0500)]
cmd/go: fix vet

The IgnoredGoFiles are already listed in allgofiles,
so they were being run twice. Worse, the ones in
IgnoredGoFiles are not fully qualified paths, so they
weren't being found when executed outside the
package directory.

Fixes #4764.

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

12 years agoencoding/json: document and test use of unicode.ReplacementChar
Russ Cox [Thu, 14 Feb 2013 19:56:01 +0000 (14:56 -0500)]
encoding/json: document and test use of unicode.ReplacementChar

Fixes #4783.

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

12 years agocmd/gc: replace x*8 by x<<3 etc
Russ Cox [Thu, 14 Feb 2013 19:54:00 +0000 (14:54 -0500)]
cmd/gc: replace x*8 by x<<3 etc

Fixes #4199.

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

12 years agocmd/8g: fix sse2 compare code gen
Russ Cox [Thu, 14 Feb 2013 19:49:04 +0000 (14:49 -0500)]
cmd/8g: fix sse2 compare code gen

Fixes #4785.

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

12 years agoencoding/json: roll back Unmarshal optimization + test
Russ Cox [Thu, 14 Feb 2013 19:46:15 +0000 (14:46 -0500)]
encoding/json: roll back Unmarshal optimization + test

The second attempt at the Unmarshal optimization allowed
panics to get out of the json package. Add test for that bug
and remove the optimization.

Let's stop trying to optimize Unmarshal.

Fixes #4784.

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

12 years agogo/types: avoid os.Getwd if not necessary
Russ Cox [Thu, 14 Feb 2013 19:46:03 +0000 (14:46 -0500)]
go/types: avoid os.Getwd if not necessary

Getwd can be very expensive.

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

12 years agogo/parser: stop ParseFile after ten errors.
Michael Matloob [Thu, 14 Feb 2013 19:26:21 +0000 (11:26 -0800)]
go/parser: stop ParseFile after ten errors.

There wil be a panic if more than ten errors are encountered. ParseFile
will recover and return the ErrorList.

Fixes #3943.

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

12 years agoC: add Michael Matloob (Google CLA)
Robert Griesemer [Thu, 14 Feb 2013 19:25:33 +0000 (11:25 -0800)]
C: add Michael Matloob (Google CLA)

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

12 years agosyscall: don't make //sys lines be doc comments
Brad Fitzpatrick [Thu, 14 Feb 2013 19:23:58 +0000 (11:23 -0800)]
syscall: don't make //sys lines be doc comments

Cleans up godoc and makes it consistent. (some had it, some
didn't)

This still keeps the information there, though, for people
looking at the source directly.

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

12 years agocmd/go: set $PWD when running commands
Russ Cox [Thu, 14 Feb 2013 19:21:44 +0000 (14:21 -0500)]
cmd/go: set $PWD when running commands

This makes os.Getwd inside those commands much faster.

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

12 years agotest/run: use correct $PWD to make os.Getwd less expensive
Russ Cox [Thu, 14 Feb 2013 19:21:26 +0000 (14:21 -0500)]
test/run: use correct $PWD to make os.Getwd less expensive

The commands being run are 'go tool this' and 'go tool that',
and the go command will call Getwd during its init.

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

12 years agoos: cache Getwd result as hint for next time
Russ Cox [Thu, 14 Feb 2013 19:21:09 +0000 (14:21 -0500)]
os: cache Getwd result as hint for next time

Avoids the dot-dot-based algorithm on repeated calls
when the directory hasn't changed.

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

12 years agonet: document OpError
Brad Fitzpatrick [Thu, 14 Feb 2013 17:29:34 +0000 (09:29 -0800)]
net: document OpError

Fixes #4797

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

12 years agoexp/cookiejar: implement Cookies and provided tests
Volker Dobler [Thu, 14 Feb 2013 08:41:58 +0000 (19:41 +1100)]
exp/cookiejar: implement Cookies and provided tests

This CL provides the implementation of Cookies and
the complete test suite. Several tests have been ported
from the Chromium project as a cross check.

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

12 years agoruntime: move stack management related code to stack.c
Dmitriy Vyukov [Thu, 14 Feb 2013 08:37:55 +0000 (12:37 +0400)]
runtime: move stack management related code to stack.c
No code changes.
This is mainly in preparation to scheduler changes,
oldstack/newstack are not related to scheduling.

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

12 years agonet/textproto: more efficient header parsing
Dave Cheney [Thu, 14 Feb 2013 08:35:38 +0000 (19:35 +1100)]
net/textproto: more efficient header parsing

A co creation with bradfitz

* add fast path for header lines which are not continuations
* pass hint to better size initial mime header map

lucky(~/go/src/pkg/net/http) % ~/go/misc/benchcmp {golden,new}.txt
benchmark                          old ns/op    new ns/op    delta
BenchmarkReadRequestChrome             10073         8348  -17.12%
BenchmarkReadRequestCurl                4368         4350   -0.41%
BenchmarkReadRequestApachebench         4412         4397   -0.34%
BenchmarkReadRequestSiege               6431         5924   -7.88%
BenchmarkReadRequestWrk                 2820         3146  +11.56%

benchmark                           old MB/s     new MB/s  speedup
BenchmarkReadRequestChrome             60.66        73.18    1.21x
BenchmarkReadRequestCurl               17.85        17.93    1.00x
BenchmarkReadRequestApachebench        18.58        18.65    1.00x
BenchmarkReadRequestSiege              23.48        25.49    1.09x
BenchmarkReadRequestWrk                14.18        12.71    0.90x

benchmark                         old allocs   new allocs    delta
BenchmarkReadRequestChrome                32           26  -18.75%
BenchmarkReadRequestCurl                  15           15    0.00%
BenchmarkReadRequestApachebench           16           15   -6.25%
BenchmarkReadRequestSiege                 22           19  -13.64%
BenchmarkReadRequestWrk                   11           11    0.00%

benchmark                          old bytes    new bytes    delta
BenchmarkReadRequestChrome              3148         2216  -29.61%
BenchmarkReadRequestCurl                 905         1413   56.13%
BenchmarkReadRequestApachebench          956         1413   47.80%
BenchmarkReadRequestSiege               1397         1522    8.95%
BenchmarkReadRequestWrk                  757         1369   80.85%

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

12 years agoarchive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.
Robin Eklind [Thu, 14 Feb 2013 06:32:48 +0000 (17:32 +1100)]
archive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader.

FileInfoHeader can now handle fifo, setuid, setgid and sticky bits.

Fixes #4695.

R=golang-dev, donovanhide, r.eklind.87, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7305072

12 years agosort: use fewer comparisons when choosing pivot.
David Symonds [Thu, 14 Feb 2013 04:04:22 +0000 (15:04 +1100)]
sort: use fewer comparisons when choosing pivot.

This is based on rsc's code posted to issue 2585.

Benchmark results are greatly improved:
        benchmark                old ns/op    new ns/op    delta
        BenchmarkSortString1K       564397       445897  -21.00%
        BenchmarkSortInt1K          270889       221249  -18.32%
        BenchmarkSortInt64K       26850765     21351967  -20.48%

Eyeballing a sampling of the raw number of comparisons shows a drop
on the order of 20-30% almost everywhere. The test input data that
doesn't match that are some of sawtooth/rand/plateau distributions,
where there is no change in the number of comparisons; that is,
there are no situations where this makes *more* comparisons.

Fixes #2585.

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

12 years agocmd/vet: drop column information from error
Russ Cox [Thu, 14 Feb 2013 03:34:37 +0000 (22:34 -0500)]
cmd/vet: drop column information from error

The column information can be misleading.

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

12 years agoruntime: tweak addfinroots to preserve original pointer
Russ Cox [Thu, 14 Feb 2013 03:31:45 +0000 (22:31 -0500)]
runtime: tweak addfinroots to preserve original pointer

Use local variable so that stack trace will show value of v.

Fixes #4790.

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

12 years agodatabase/sql: fix doc references to old package name
Brad Fitzpatrick [Thu, 14 Feb 2013 02:47:25 +0000 (18:47 -0800)]
database/sql: fix doc references to old package name

It used to be package "db" but was long ago renamed
to be "sql".

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

12 years agonet/http: test that we preserve Go 1.0 Request.Write Host behavior
Brad Fitzpatrick [Thu, 14 Feb 2013 02:33:15 +0000 (18:33 -0800)]
net/http: test that we preserve Go 1.0 Request.Write Host behavior

Fixes #4792

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

12 years agocmd/8c: disable use of prefetch with GO386=387
Russ Cox [Thu, 14 Feb 2013 02:13:07 +0000 (21:13 -0500)]
cmd/8c: disable use of prefetch with GO386=387

Fixes #4798.

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

12 years agodatabase/sql: Add an optional Queryer-Interface (like Execer)
Julien Schmidt [Wed, 13 Feb 2013 23:25:39 +0000 (15:25 -0800)]
database/sql: Add an optional Queryer-Interface (like Execer)

Completly the same like the Execer-Interface, just for Queries.
This allows Drivers to execute Queries without preparing them first

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

12 years agonet: remove noisy test for issue 3590
Dave Cheney [Wed, 13 Feb 2013 23:11:16 +0000 (10:11 +1100)]
net: remove noisy test for issue 3590

The test for issue 3590 causes an error to be printed to stderr when run (although the error is obscured during go test std). This is confusing for people who get breakage in the net package as the error is harmless and most likely unrelated to their build breakage.

Given the way the test works, by reaching into the guts of the netFD, I can't see a way to silence the error without adding a bunch of code to support the test, therefore I am suggesting the test be removed before Go 1.1 ships.

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

12 years agonet: add test for Dial and Listen arguments
Mikio Hara [Wed, 13 Feb 2013 22:02:32 +0000 (07:02 +0900)]
net: add test for Dial and Listen arguments

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

12 years agoio: document and test new CopyN return behavior
Brad Fitzpatrick [Wed, 13 Feb 2013 21:52:00 +0000 (13:52 -0800)]
io: document and test new CopyN return behavior

Changed accidentally in 28966b7b2f0c (CopyN using Copy).
Updating docs to be consistent with 29bf5ff5064e (ReadFull & ReadAtLeast)

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

12 years agocmd/5l: fix print format
Lucio De Re [Wed, 13 Feb 2013 21:47:33 +0000 (16:47 -0500)]
cmd/5l: fix print format

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

12 years agodatabase/sql: add currently-disabled broken test
Brad Fitzpatrick [Wed, 13 Feb 2013 20:00:03 +0000 (12:00 -0800)]
database/sql: add currently-disabled broken test

Update #3865

R=golang-dev, alex.brainman, nightlyone
CC=golang-dev
https://golang.org/cl/7324051

12 years agogo/types: adjust gcimporter to actual gc export data
Robert Griesemer [Wed, 13 Feb 2013 18:21:24 +0000 (10:21 -0800)]
go/types: adjust gcimporter to actual gc export data

Unexported field and method names that appear in the
export data (as part of some exported type) are fully
qualified with a package id (path). In some cases, a
package with that id was never exported for any other
use (i.e. only the path is of interest).

We must not create a "real" package in those cases
because we don't have a package name. Entering an
unnamed package into the map of imported packages
makes that package accessible for other imports.
Such a subsequent import may find the unnamed
package in the map, and reuse it. That reused and
imported package is then entered into the importing
file scope, still w/o a name. References to that
package cannot resolved after that. Was bug.

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

12 years agoruntime: instrument slicebytetostring for race detection
Dmitriy Vyukov [Wed, 13 Feb 2013 14:29:59 +0000 (18:29 +0400)]
runtime: instrument slicebytetostring for race detection

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

12 years agoarchive/tar: append a slash when deriving header info from a directory
Christian Himpel [Wed, 13 Feb 2013 08:23:28 +0000 (19:23 +1100)]
archive/tar: append a slash when deriving header info from a directory

This behavior is identical to GNU tar 1.26.

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

12 years agodoc: adjust indentation in Effective Go commentary example.
David Symonds [Wed, 13 Feb 2013 05:43:55 +0000 (16:43 +1100)]
doc: adjust indentation in Effective Go commentary example.

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

12 years agonet: change server_test.go so we could see failure messages
Alex Brainman [Wed, 13 Feb 2013 05:17:47 +0000 (16:17 +1100)]
net: change server_test.go so we could see failure messages

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

12 years agoexp/ssa: add Instruction.Operands and Value.Referrers methods.
Alan Donovan [Wed, 13 Feb 2013 05:15:07 +0000 (00:15 -0500)]
exp/ssa: add Instruction.Operands and Value.Referrers methods.

Operands returns the SSA values used by an instruction.
Referrers returns the SSA instructions that use a value, for
some values.  These will be used for SSA renaming, to follow.

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

12 years agogo/types: print, println accept 0 or more arguments
Robert Griesemer [Wed, 13 Feb 2013 03:40:20 +0000 (19:40 -0800)]
go/types: print, println accept 0 or more arguments

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

12 years agoos: do not use hosts file for windows tests
Alex Brainman [Wed, 13 Feb 2013 02:19:06 +0000 (13:19 +1100)]
os: do not use hosts file for windows tests

Not everyone has the file (http://golang.org/issue/4723#c4).

Update #4723.

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

12 years agoexp/ssa: omit Function's package name when printing intra-package references.
Alan Donovan [Tue, 12 Feb 2013 21:13:14 +0000 (16:13 -0500)]
exp/ssa: omit Function's package name when printing intra-package references.

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