]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/ld, runtime: restrict stack root scan to locals and arguments
Carl Shapiro [Thu, 28 Mar 2013 21:36:23 +0000 (14:36 -0700)]
cmd/ld, runtime: restrict stack root scan to locals and arguments

Updates #5134

R=golang-dev, bradfitz, cshapiro, daniel.morsing, ality, iant
CC=golang-dev
https://golang.org/cl/8022044

12 years agonet/http: parse Request-Line in a function, remove an allocation
Brad Fitzpatrick [Thu, 28 Mar 2013 21:19:51 +0000 (14:19 -0700)]
net/http: parse Request-Line in a function, remove an allocation

Removes another per-request allocation. Also makes the code more
readable, IMO. And more testable.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10539        10324   -2.04%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           20           19   -5.00%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1609         1559   -3.11%

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

12 years agonet/url: use strings.Index instead of a loop
Brad Fitzpatrick [Thu, 28 Mar 2013 20:43:34 +0000 (13:43 -0700)]
net/url: use strings.Index instead of a loop

We already depend on strings in this file, so use it.

Plus strings.Index will be faster than a manual loop
once issue 3751 is finished.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/8116043

12 years agogo/doc: fix typo in comment
Robert Griesemer [Thu, 28 Mar 2013 20:13:55 +0000 (13:13 -0700)]
go/doc: fix typo in comment

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

12 years agonet/http: inline chunkWriter in response
Brad Fitzpatrick [Thu, 28 Mar 2013 20:13:28 +0000 (13:13 -0700)]
net/http: inline chunkWriter in response

A chunkWriter and a response are 1:1. Make them contiguous in
memory and save an allocation.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10715        10539   -1.64%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           21           20   -4.76%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1626         1609   -1.05%

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

12 years agonet/http: remove two more server allocations per-request
Brad Fitzpatrick [Thu, 28 Mar 2013 20:07:14 +0000 (13:07 -0700)]
net/http: remove two more server allocations per-request

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        11031        10689   -3.10%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           23           21   -8.70%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1668         1626   -2.52%

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

12 years agocmd/godoc: cleanups
Robert Griesemer [Thu, 28 Mar 2013 20:05:30 +0000 (13:05 -0700)]
cmd/godoc: cleanups

- removed gratuitous empty lines that creeped into command line output
- changed comment color to a dark green so that links don't visually melt into them
- removed some TODOs
- updated doc.go

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

12 years agonet/http: more tests, better comments, remove an allocation
Brad Fitzpatrick [Thu, 28 Mar 2013 18:35:24 +0000 (11:35 -0700)]
net/http: more tests, better comments, remove an allocation

Add more tests around the various orders handlers can access
and flush response headers.

Also clarify the documentation on fields of response and
chunkWriter.

While there, remove an allocation (a header clone) for simple
handlers.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        15245        14966   -1.83%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           24           23   -4.17%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1717         1668   -2.85%

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

12 years agocmd/ld: when using host linker pass -r option as -rpath
Ian Lance Taylor [Thu, 28 Mar 2013 16:37:32 +0000 (09:37 -0700)]
cmd/ld: when using host linker pass -r option as -rpath

R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/8070043

12 years agocmd/godoc: don't crash if there's no documentation
Robert Griesemer [Thu, 28 Mar 2013 15:46:17 +0000 (08:46 -0700)]
cmd/godoc: don't crash if there's no documentation

Fixes regression introduced by CL 7860049.

R=golang-dev, kamil.kisiel, dave
CC=golang-dev
https://golang.org/cl/8069044

12 years agovet: add a progress message to asmdecl.go
Rob Pike [Wed, 27 Mar 2013 23:55:16 +0000 (16:55 -0700)]
vet: add a progress message to asmdecl.go
Analogous to the one for .go files, it's for .s only and is protected
by the verbose flag.

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

12 years agotext/template: fix bug in evaluating a chain starting with a function.
Rob Pike [Wed, 27 Mar 2013 23:31:14 +0000 (16:31 -0700)]
text/template: fix bug in evaluating a chain starting with a function.

R=golang-dev, alberto.garcia.hierro
CC=golang-dev
https://golang.org/cl/7861046

12 years agovet: fix test_deadcode.go's tests
Rob Pike [Wed, 27 Mar 2013 23:30:20 +0000 (16:30 -0700)]
vet: fix test_deadcode.go's tests
This is a totally mechanical change.
Errors are reported for the beginning of the statement, not the end,
so the errchk markers need to be on the opening brace, not the closing
one. It seems this test was never run.

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

12 years agocmd/vet: fix assembly test files
Rob Pike [Wed, 27 Mar 2013 23:29:12 +0000 (16:29 -0700)]
cmd/vet: fix assembly test files
They should be build-tagged for vet_test not ignore,
and not have a Go package clause.

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

12 years agoruntime: allocate maps' first bucket table lazily
Brad Fitzpatrick [Wed, 27 Mar 2013 23:28:51 +0000 (16:28 -0700)]
runtime: allocate maps' first bucket table lazily

Motivated by garbage profiling in HTTP benchmarks. This
changes means new empty maps are just one small allocation
(the HMap) instead the HMap + the relatively larger h->buckets
allocation. This helps maps which remain empty throughout
their life.

benchmark               old ns/op    new ns/op    delta
BenchmarkNewEmptyMap          196          107  -45.41%

benchmark              old allocs   new allocs    delta
BenchmarkNewEmptyMap            2            1  -50.00%

benchmark               old bytes    new bytes    delta
BenchmarkNewEmptyMap          195           50  -74.36%

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

12 years agocmd/ld: fix OpenBSD (third try)
Ian Lance Taylor [Wed, 27 Mar 2013 23:00:58 +0000 (16:00 -0700)]
cmd/ld: fix OpenBSD (third try)

On OpenBSD don't mark runtime.{g,m} as STT_TLS symbols.

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

12 years agofaq: update with some links and 1.1-specific details
Rob Pike [Wed, 27 Mar 2013 22:26:57 +0000 (15:26 -0700)]
faq: update with some links and 1.1-specific details

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

12 years agocmd/godoc: emit id's for constants and variables
Robert Griesemer [Wed, 27 Mar 2013 22:14:28 +0000 (15:14 -0700)]
cmd/godoc: emit id's for constants and variables

Fixes #5077.

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

12 years agocmd/ld, cmd/8l: Fix OpenBSD build.
Ian Lance Taylor [Wed, 27 Mar 2013 22:00:11 +0000 (15:00 -0700)]
cmd/ld, cmd/8l: Fix OpenBSD build.

Don't generate TLS sections on OpenBSD.

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

12 years agocmd/6l: fix OpenBSD build
Ian Lance Taylor [Wed, 27 Mar 2013 21:32:51 +0000 (14:32 -0700)]
cmd/6l: fix OpenBSD build

Avoid generating TLS relocations on OpenBSD.

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

12 years agocmd/gc: update runtime.go for new map implementation.
Rémy Oudompheng [Wed, 27 Mar 2013 20:51:07 +0000 (21:51 +0100)]
cmd/gc: update runtime.go for new map implementation.

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

12 years agonet/http: server optimization; reduce GCs, generate ~half the garbage
Brad Fitzpatrick [Wed, 27 Mar 2013 20:35:49 +0000 (13:35 -0700)]
net/http: server optimization; reduce GCs, generate ~half the garbage

There was another bufio.Writer not being reused, found with
GOGC=off and -test.memprofile.

benchmark                               old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAlive        18270        16046  -12.17%

benchmark                              old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAlive           38           36   -5.26%

benchmark                               old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAlive         4598         2488  -45.89%

Update #5100

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

12 years agonet/http: new server-only, single-connection keep-alive benchmark
Brad Fitzpatrick [Wed, 27 Mar 2013 20:35:41 +0000 (13:35 -0700)]
net/http: new server-only, single-connection keep-alive benchmark

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

12 years agocmd/ld: emit TLS relocations during external linking
Ian Lance Taylor [Wed, 27 Mar 2013 20:27:35 +0000 (13:27 -0700)]
cmd/ld: emit TLS relocations during external linking

This CL was written by rsc.  I just tweaked 8l.

This CL adds TLS relocation to the ELF .o file we write during external linking,
so that the host linker (gcc) can decide the final location of m and g.

Similar relocations are not necessary on OS X because we use an alternate
program start-time mechanism to acquire thread-local storage.

Similar relocations are not necessary on ARM or Plan 9 or Windows
because external linking mode is not yet supported on those systems.

On almost all ELF systems, the references we use are like %fs:-0x4 or %gs:-0x4,
which we write in 6a/8a as -0x4(FS) or -0x4(GS). On Linux/ELF, however,
Xen's lack of support for this mode forced us long ago to use a two-instruction
sequence: first we load %gs:0x0 into a register r, and then we use -0x4(r).
(The ELF program loader arranges that %gs:0x0 contains a regular pointer to
that same memory location.) In order to relocate those -0x4(r) references,
the linker must know where they are. This CL adds the equivalent notation
-0x4(r)(GS*1) for this purpose: it assembles to the same encoding as -0x4(r)
but the (GS*1) indicates to the linker that this is one of those thread-local
references that needs relocation.

Thanks to Elias Naur for reminding me about this missing piece and
also for writing the test.

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

12 years agoruntime/race: mark failing test as such.
Rémy Oudompheng [Wed, 27 Mar 2013 20:15:05 +0000 (21:15 +0100)]
runtime/race: mark failing test as such.

Fixes race builder.

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

12 years agocmd/gc: fix race instrumentation of append and type switches.
Rémy Oudompheng [Wed, 27 Mar 2013 19:33:17 +0000 (20:33 +0100)]
cmd/gc: fix race instrumentation of append and type switches.

The remaining issues are about runtime and sync package
instrumentation.

Update #4228

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

12 years agodoc: fix go1.1.html typos
Jonathan Rudenberg [Wed, 27 Mar 2013 18:09:14 +0000 (11:09 -0700)]
doc: fix go1.1.html typos

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

12 years agonet/http: improve test leak checker flakiness
Brad Fitzpatrick [Wed, 27 Mar 2013 17:07:22 +0000 (10:07 -0700)]
net/http: improve test leak checker flakiness

And make it have more useful output on failure.

Update #5005

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

12 years agolibmach: respect symbol table boundaries
Anthony Martin [Wed, 27 Mar 2013 12:59:06 +0000 (05:59 -0700)]
libmach: respect symbol table boundaries

Since fp->symsz includes the size of the header
in the new symbol table format, we were reading
past the end and decoding a few garbage symbols
from data in the pc/line table.

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

12 years agonet/textproto: add "Cookie" to the common headers list
Brad Fitzpatrick [Wed, 27 Mar 2013 06:08:08 +0000 (23:08 -0700)]
net/textproto: add "Cookie" to the common headers list

Seems to have been omitted before.

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

12 years agogodoc: pass *PageInfos instead of *token.FileSets in templates
Robert Griesemer [Wed, 27 Mar 2013 01:28:16 +0000 (18:28 -0700)]
godoc: pass *PageInfos instead of *token.FileSets in templates

- convert all formatters that require a *token.FileSet to
  consistenly use a *PageInfo as first argument instead
- adjust templates correspondingly
- fix outstanding bug from previous CL 8005044

Going forward, with this change the affected functions have
access to the full page "context" (PageInfo), not just the
respective file set. This will permit better context-dependent
formatting in the future.

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

12 years agolib/codereview/codereview.py: fix crash when hg gofmt has no files
Rob Pike [Wed, 27 Mar 2013 00:32:22 +0000 (17:32 -0700)]
lib/codereview/codereview.py: fix crash when hg gofmt has no files
The gofmt function was returning a string, which isn't the right type.
Three cheers for dynamic typing.

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

12 years agocmd/gc: enable racewalk of HMUL nodes.
Rémy Oudompheng [Tue, 26 Mar 2013 22:35:42 +0000 (23:35 +0100)]
cmd/gc: enable racewalk of HMUL nodes.

A HMUL node appears in some constant divisions, but
to observe a false negative in race detector the divisor must be
suitably chosen to make sure the only memory access is
done for HMUL.

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

12 years agodoc: consistent path names in example
Dave Cheney [Tue, 26 Mar 2013 22:22:23 +0000 (09:22 +1100)]
doc: consistent path names in example

Always use /home/you for $HOME in examples.

Trivial enough that someone else can integrate this change if they are editing go1.1.html

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

12 years agopkg/runtime: ignore runtime.memlimit when allocating heap
Ian Lance Taylor [Tue, 26 Mar 2013 21:01:12 +0000 (14:01 -0700)]
pkg/runtime: ignore runtime.memlimit when allocating heap

For Go 1.1, stop checking the rlimit, because it broke now
that mheap is allocated using SysAlloc.  See issue 5049.

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

12 years agogodoc: internal cleanup: remove a TODO
Robert Griesemer [Tue, 26 Mar 2013 20:12:38 +0000 (13:12 -0700)]
godoc: internal cleanup: remove a TODO

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

12 years agoreflect: add garbage collection info in ChanOf, MapOf, PtrTo, SliceOf
Russ Cox [Tue, 26 Mar 2013 18:50:29 +0000 (11:50 -0700)]
reflect: add garbage collection info in ChanOf, MapOf, PtrTo, SliceOf

ArrayOf will remain unexported (and therefore unused) for Go 1.1.

Fixes #4375.

R=0xe2.0x9a.0x9b, r, iant
CC=golang-dev
https://golang.org/cl/7716048

12 years agodoc/go1.1.html: net/mail, net/smtp
Rob Pike [Tue, 26 Mar 2013 18:47:27 +0000 (11:47 -0700)]
doc/go1.1.html: net/mail, net/smtp

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

12 years agoruntime: ensure forward progress when unwinding an arm stack frame
Carl Shapiro [Tue, 26 Mar 2013 18:43:09 +0000 (11:43 -0700)]
runtime: ensure forward progress when unwinding an arm stack frame

The arm gentraceback mishandled frame linkage values pointing
to the assembly return function.  This function is special as
its frame size is zero and it contains only one instruction.
These conditions would preserve the frame pointer and result
in an off by one error when unwinding the caller.

Fixes #5124

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

12 years agogodoc: link identifiers to declarations
Robert Griesemer [Tue, 26 Mar 2013 18:14:30 +0000 (11:14 -0700)]
godoc: link identifiers to declarations

The changes are almost completely self-contained
in the new file linkify.go. The other changes are
minimal and should not disturb the currently
working godoc, in anticipation of Go 1.1.

To disable the feature in case of problems, set
-links=false.

Fixes #2063.

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

12 years agobuiltin: add linkable-to declarations for iota and nil
Rob Pike [Tue, 26 Mar 2013 18:05:06 +0000 (11:05 -0700)]
builtin: add linkable-to declarations for iota and nil
Aids godoc.

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

12 years agodoc/go1.1.html: describe Zone and other net changes
Rob Pike [Tue, 26 Mar 2013 17:54:55 +0000 (10:54 -0700)]
doc/go1.1.html: describe Zone and other net changes
Mild adaptation of rsc's 8021043, which I was unable to clpatch.
(rsc is offline)

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

12 years agodoc: fix typo in go 1.1 doc
Andrew Gerrand [Tue, 26 Mar 2013 16:37:17 +0000 (09:37 -0700)]
doc: fix typo in go 1.1 doc

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

12 years agoruntime: does not report duplicate errors in netpoll
Dmitriy Vyukov [Tue, 26 Mar 2013 16:25:43 +0000 (20:25 +0400)]
runtime: does not report duplicate errors in netpoll
Prevents storm of error messages if something goes wrong.
In the case of issue 5073 the epoll fd was closed by the test.
Update #5073.

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

12 years agonet: fix test data corruption in repetitive test runs by -cpu
Mikio Hara [Tue, 26 Mar 2013 16:06:48 +0000 (01:06 +0900)]
net: fix test data corruption in repetitive test runs by -cpu

This CL avoids test data sharing in repetitive test runs;
e.g., go test net -cpu=1,1,1

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

12 years agocmd/gc: more race instrumentation.
Rémy Oudompheng [Tue, 26 Mar 2013 07:27:18 +0000 (08:27 +0100)]
cmd/gc: more race instrumentation.

Handle interface comparison correctly,
add a few more tests, mark more nodes as impossible.

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

12 years agocmd/gc: fix nil pointer dereferences.
Rémy Oudompheng [Tue, 26 Mar 2013 07:20:10 +0000 (08:20 +0100)]
cmd/gc: fix nil pointer dereferences.

Fixes #5119.

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

12 years agomisc/vim: make Godoc command work with "log.Print".
Yasuhiro Matsumoto [Tue, 26 Mar 2013 06:39:46 +0000 (17:39 +1100)]
misc/vim: make Godoc command work with "log.Print".

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

12 years agoimage/gif: make test repeatable
Dave Cheney [Tue, 26 Mar 2013 05:20:17 +0000 (16:20 +1100)]
image/gif: make test repeatable

Fixes issue with go test -cpu=1,1

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

12 years agodoc/articles: update reference to obsolete "package documentation".
David Symonds [Tue, 26 Mar 2013 02:01:24 +0000 (13:01 +1100)]
doc/articles: update reference to obsolete "package documentation".

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

12 years agodatabase/sql: optimized []byte copy + []byte(nil) -> *interface fix
Julien Schmidt [Tue, 26 Mar 2013 00:43:30 +0000 (17:43 -0700)]
database/sql: optimized []byte copy + []byte(nil) -> *interface fix

Make the copy directly in the convert switch instead of an extra loop.
Also stops converting nil-[]byte to zero-[]byte when assigning to *interface

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

12 years agodoc/go1.1.html: introduction
Rob Pike [Tue, 26 Mar 2013 00:41:12 +0000 (17:41 -0700)]
doc/go1.1.html: introduction

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

12 years agodatabase/sql: link to driver wiki page
Brad Fitzpatrick [Tue, 26 Mar 2013 00:38:51 +0000 (17:38 -0700)]
database/sql: link to driver wiki page

Fixes #5127

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

12 years agodatabase/sql: don't close a driver.Conn until its Stmts are closed
Brad Fitzpatrick [Mon, 25 Mar 2013 23:50:27 +0000 (16:50 -0700)]
database/sql: don't close a driver.Conn until its Stmts are closed

Fixes #5046

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

12 years agocrypto/rsa: don't correct private exponent unless needed.
Adam Langley [Mon, 25 Mar 2013 23:08:29 +0000 (19:08 -0400)]
crypto/rsa: don't correct private exponent unless needed.

At some point in the past, I believe the GCD algorithm was setting d to
be negative. The RSA code has been correcting that ever since but, now,
it appears to have changed and the correction isn't needed.

Having d be too large is harmless, it's just a little odd and I
happened to notice.

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

12 years agocmd/ld: permit sym to be both cgo_export_static and cgo_export_dynamic
Ian Lance Taylor [Mon, 25 Mar 2013 22:37:54 +0000 (15:37 -0700)]
cmd/ld: permit sym to be both cgo_export_static and cgo_export_dynamic

Fixes SWIG callbacks.  Previously crosscall2 was only
cgo_export_static, despite the use of two #pragma declarations
in runtime/cgo/callbacks.c.

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

12 years agodoc: add summary of net/http additions to Go 1.1
Brad Fitzpatrick [Mon, 25 Mar 2013 22:17:44 +0000 (15:17 -0700)]
doc: add summary of net/http additions to Go 1.1

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

12 years agoruntime: pass setmg function to cgo_init
Russ Cox [Mon, 25 Mar 2013 22:14:02 +0000 (18:14 -0400)]
runtime: pass setmg function to cgo_init

This keeps the logic about how to set the thread-local variables
m and g in code compiled and linked by the gc toolchain,
an important property for upcoming cgo changes.

It's also just a nice cleanup: one less place to update when
these details change.

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

12 years agoruntime: delete mkasmh.sh
Russ Cox [Mon, 25 Mar 2013 21:46:11 +0000 (17:46 -0400)]
runtime: delete mkasmh.sh

This functionality moved into cmd/dist for Go 1.0.
Changes to this script have no effect.

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

12 years agocmd/gc: instrument logical && and ||.
Rémy Oudompheng [Mon, 25 Mar 2013 21:12:47 +0000 (22:12 +0100)]
cmd/gc: instrument logical && and ||.

The right operand of a && and || is only executed conditionnally,
so the instrumentation must be more careful. In particular
it should not turn nodes assumed to be cheap after walk into
expensive ones.

Update #4228

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

12 years agoruntime: store asmcgocall return PC where the ARM unwind expects it
Carl Shapiro [Mon, 25 Mar 2013 21:10:28 +0000 (14:10 -0700)]
runtime: store asmcgocall return PC where the ARM unwind expects it

The ARM implementation of runtime.cgocallback_gofunc diverged
from the calling convention by leaving a word of garbage at
the top of the stack and storing the return PC above the
locals.  This change stores the return PC at the top of the
stack and removes the save area above the locals.

Update #5124
This CL fixes first part of the ARM issues and added the unwind test.

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

12 years agocmd/5l, cmd/6l, cmd/8l: fix segfault on reading LOCALS for a duplicate definition.
Rémy Oudompheng [Mon, 25 Mar 2013 21:09:55 +0000 (22:09 +0100)]
cmd/5l, cmd/6l, cmd/8l: fix segfault on reading LOCALS for a duplicate definition.

Fixes #5105.

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

12 years agomath: make Hypot special cases look like others
Russ Cox [Mon, 25 Mar 2013 21:01:40 +0000 (17:01 -0400)]
math: make Hypot special cases look like others

The edit makes Hypot's description match the form
used in the other routines in this package.

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

12 years agoruntime: optionally check all allocations in hashmap.c
Jan Ziak [Mon, 25 Mar 2013 20:35:46 +0000 (21:35 +0100)]
runtime: optionally check all allocations in hashmap.c

Adds the new debugging constant 'checkgc'. If its value is non-zero
all calls to mallocgc() from hashmap.c will start a garbage collection.

Fixes #5074.

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

12 years agodoc: add DialOpt and friends to go1.1.html
Brad Fitzpatrick [Mon, 25 Mar 2013 17:31:19 +0000 (10:31 -0700)]
doc: add DialOpt and friends to go1.1.html

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

12 years agonet: band-aid for windows network poller
Dmitriy Vyukov [Mon, 25 Mar 2013 16:57:36 +0000 (20:57 +0400)]
net: band-aid for windows network poller
Fixes performance of the current windows network poller
with the new scheduler.
Gives runtime a hint when GetQueuedCompletionStatus() will block.
Fixes #5068.

benchmark                    old ns/op    new ns/op    delta
BenchmarkTCP4Persistent        4004000        33906  -99.15%
BenchmarkTCP4Persistent-2        21790        17513  -19.63%
BenchmarkTCP4Persistent-4        44760        34270  -23.44%
BenchmarkTCP4Persistent-6        45280        43000   -5.04%

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

12 years agomisc/emacs: Derive mode from prog-mode if possible
Dominik Honnef [Mon, 25 Mar 2013 15:58:13 +0000 (08:58 -0700)]
misc/emacs: Derive mode from prog-mode if possible

R=golang-dev, bradfitz
CC=adonovan, cw, golang-dev, patrick.allen.higgins
https://golang.org/cl/7956044

12 years agomath: modify a comment to the convention format.
Oling Cat [Mon, 25 Mar 2013 15:43:51 +0000 (08:43 -0700)]
math: modify a comment to the convention format.

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

12 years agocmd/cc, cmd/ld: do not overflow strings in symbol lookup.
Rémy Oudompheng [Mon, 25 Mar 2013 07:20:22 +0000 (08:20 +0100)]
cmd/cc, cmd/ld: do not overflow strings in symbol lookup.

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

12 years agonet/http: deflake BenchmarkServerFakeConnNoKeepAlive.
Rémy Oudompheng [Mon, 25 Mar 2013 07:17:10 +0000 (08:17 +0100)]
net/http: deflake BenchmarkServerFakeConnNoKeepAlive.

Fixes #5121.

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

12 years agonet: disable tests with controlling network facilities in short mode
Mikio Hara [Mon, 25 Mar 2013 04:25:28 +0000 (13:25 +0900)]
net: disable tests with controlling network facilities in short mode

Perhaps it would make FreeBSD 10-CURRENT/ARM on Raspberry Pi builders happy.

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

12 years agoall.bat,make.bat,run.bat: make these work even when directory has space in it
Alex Brainman [Mon, 25 Mar 2013 01:13:34 +0000 (12:13 +1100)]
all.bat,make.bat,run.bat: make these work even when directory has space in it

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

12 years agobuild, cmd/5l: actually report failures for -linkmode tests
Shenghou Ma [Sun, 24 Mar 2013 19:18:05 +0000 (03:18 +0800)]
build, cmd/5l: actually report failures for -linkmode tests

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

12 years agocmd/cc: fix typo leading to index out of range.
Rémy Oudompheng [Sun, 24 Mar 2013 10:38:57 +0000 (11:38 +0100)]
cmd/cc: fix typo leading to index out of range.

Detected by GCC static analysis.

Fixes #5117.

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

12 years agobuild: increase timeout for ARM
Shenghou Ma [Sun, 24 Mar 2013 08:31:28 +0000 (16:31 +0800)]
build: increase timeout for ARM
in an effort to make builder freebsd-arm-pi and netbsd-arm-qemu pass again.

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

12 years agocmd/5l, cmd/6l, cmd/8l: remove declaration on non-existent variables.
Rémy Oudompheng [Sun, 24 Mar 2013 07:55:08 +0000 (08:55 +0100)]
cmd/5l, cmd/6l, cmd/8l: remove declaration on non-existent variables.

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

12 years agomisc/kate: fix multiline raw string syntax highlighting error.
Oling Cat [Sat, 23 Mar 2013 22:16:58 +0000 (15:16 -0700)]
misc/kate: fix multiline raw string syntax highlighting error.
From VisualFC.
Fixes #4862.

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

12 years agodoc/go1.1.html: performance
Rob Pike [Sat, 23 Mar 2013 15:29:59 +0000 (08:29 -0700)]
doc/go1.1.html: performance
An overview is all that's required.

R=golang-dev, remyoudompheng, bradfitz, adg
CC=golang-dev
https://golang.org/cl/7577050

12 years agonet: use original raddr if getpeername fails
Mikio Hara [Sat, 23 Mar 2013 13:32:19 +0000 (22:32 +0900)]
net: use original raddr if getpeername fails

This CL updates CL 7511043;
- adds new test cases for both UDPConn and UnixConn,
- makes sure unnamed UnixAddr handling,
- replaces t.Errorf with t.Fatalf in sockname related test cases.

Fixes #3721 (again).
Fixes #3838 (again).

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

12 years agonet: support IPv6 scoped addressing zone
Mikio Hara [Sat, 23 Mar 2013 00:57:40 +0000 (09:57 +0900)]
net: support IPv6 scoped addressing zone

This CL provides IPv6 scoped addressing zone support as defined
in RFC 4007 for internet protocol family connection setups.

Follwoing types and functions allow a literal IPv6 address with
zone identifer as theirs parameter.

pkg net, func Dial(string, string) (Conn, error)
pkg net, func DialOpt(string, ...DialOption) (Conn, error)
pkg net, func DialTimeout(string, string, time.Duration) (Conn, error)
pkg net, func Listen(string, string) (Listener, error)
pkg net, func ListenPacket(string, string) (PacketConn, error)
pkg net, func ResolveIPAddr(string, string) (*IPAddr, error)
pkg net, func ResolveTCPAddr(string, string) (*TCPAddr, error)
pkg net, func ResolveUDPAddr(string, string) (*UDPAddr, error)
pkg net, type IPAddr struct, Zone string
pkg net, type TCPAddr struct, Zone string
pkg net, type UDPAddr struct, Zone string

Also follwoing methods return a literal IPv6 address with zone
identifier string if possible.

pkg net, method (*IPAddr) String() string
pkg net, method (*TCPAddr) String() string
pkg net, method (*UDPAddr) String() string

Fixes #4234.
Fixes #4501.
Update #5081.

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

12 years agoruntime: remove declaration of non-existent function
Ian Lance Taylor [Sat, 23 Mar 2013 00:52:55 +0000 (17:52 -0700)]
runtime: remove declaration of non-existent function

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

12 years agoruntime: correct misplaced right brace in Linux SIGBUS handling
Ian Lance Taylor [Sat, 23 Mar 2013 00:32:04 +0000 (17:32 -0700)]
runtime: correct misplaced right brace in Linux SIGBUS handling

I'm not sure how to write a test for this.  The change in
behaviour is that if you somehow get a SIGBUS signal for an
address >= 0x1000, the program will now crash rather than
calling panic.  As far as I know, on x86 GNU/Linux, the only
way to get a SIGBUS (rather than a SIGSEGV) is to set the
stack pointer to an invalid value.

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

12 years agodoc/go1.1.html: fix broken links
Robert Griesemer [Fri, 22 Mar 2013 23:41:27 +0000 (16:41 -0700)]
doc/go1.1.html: fix broken links

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

12 years agodoc/go1.1.html: blockprofile, method values, ListenUnixgram, etc.
Rob Pike [Fri, 22 Mar 2013 22:45:16 +0000 (15:45 -0700)]
doc/go1.1.html: blockprofile, method values, ListenUnixgram, etc.

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

12 years agonet: fix documentation for UnixAddr
Mikio Hara [Fri, 22 Mar 2013 22:39:43 +0000 (07:39 +0900)]
net: fix documentation for UnixAddr

Also simplifies ResolveUnixAddr.

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

12 years agospec: remove most §links for the now more common in-text links
Robert Griesemer [Fri, 22 Mar 2013 22:36:04 +0000 (15:36 -0700)]
spec: remove most §links for the now more common in-text links

Also:
- more consistenly use "xxx" statement rather than <code>xxx</code> statement
- fix/remove unnecessary links

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

12 years agodoc/go1.1.html: return requirements
Rob Pike [Fri, 22 Mar 2013 21:51:22 +0000 (14:51 -0700)]
doc/go1.1.html: return requirements

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

12 years agocmd/gc: fix line number for 'missing return' in closure
Russ Cox [Fri, 22 Mar 2013 21:50:29 +0000 (17:50 -0400)]
cmd/gc: fix line number for 'missing return' in closure

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

12 years agocmd/vet: diagnose unreachable code
Russ Cox [Fri, 22 Mar 2013 21:46:45 +0000 (17:46 -0400)]
cmd/vet: diagnose unreachable code

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

12 years agobuild: remove dead code
Russ Cox [Fri, 22 Mar 2013 21:28:22 +0000 (17:28 -0400)]
build: remove dead code

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

12 years agoencoding/gob: delete dead code.
Rob Pike [Fri, 22 Mar 2013 21:22:55 +0000 (14:22 -0700)]
encoding/gob: delete dead code.

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

12 years agoruntime/cgo, go/build: re-enable cgo for FreeBSD/ARM.
Shenghou Ma [Fri, 22 Mar 2013 19:21:30 +0000 (03:21 +0800)]
runtime/cgo, go/build: re-enable cgo for FreeBSD/ARM.

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

12 years agodatabase/sql: add missing []byte and RawBytes conversions
Julien Schmidt [Fri, 22 Mar 2013 19:19:21 +0000 (12:19 -0700)]
database/sql: add missing []byte and RawBytes conversions

E.g conversions from numeric types to RawBytes are missing, what makes RawBytes unusable in some cases.

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

12 years agocmd/vet: add assembly checker
Russ Cox [Fri, 22 Mar 2013 19:14:40 +0000 (15:14 -0400)]
cmd/vet: add assembly checker

Fixes #5036.

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

12 years agospec: add example showing missing return statement
Rob Pike [Fri, 22 Mar 2013 17:03:55 +0000 (10:03 -0700)]
spec: add example showing missing return statement
Will help people find the rules by searching the spec by
having a comment saying "missing return";
"terminating statement" does not evoke the rule to the
uninitiated.

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

12 years agobuild: update assembly variable names for vet
Russ Cox [Fri, 22 Mar 2013 16:57:55 +0000 (12:57 -0400)]
build: update assembly variable names for vet

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

12 years agocrypto/cipher: fix vet warning
Russ Cox [Fri, 22 Mar 2013 16:57:34 +0000 (12:57 -0400)]
crypto/cipher: fix vet warning

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

12 years agoCONTRIBUTORS: add Joseph Bonneau (Google CLA)
Adam Langley [Fri, 22 Mar 2013 16:56:52 +0000 (12:56 -0400)]
CONTRIBUTORS: add Joseph Bonneau (Google CLA)

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

12 years agoimage/gif: reject a GIF image if frame bounds larger than image bounds
Jeff R. Allen [Fri, 22 Mar 2013 16:30:31 +0000 (09:30 -0700)]
image/gif: reject a GIF image if frame bounds larger than image bounds

The GIF89a spec says: "Each image must fit within the
boundaries of the Logical Screen, as defined in the
Logical Screen Descriptor." Also, do not accept
GIFs which have too much data for the image size.

R=nigeltao, jra, r
CC=bradfitz, golang-dev
https://golang.org/cl/7602045

12 years agoruntime: correct return value checks for mmap on darwin/freebsd
Joel Sing [Fri, 22 Mar 2013 15:17:01 +0000 (02:17 +1100)]
runtime: correct return value checks for mmap on darwin/freebsd

On Darwin and FreeBSD, the mmap syscall return value is returned
unmodified. This means that the return value will either be a
valid address or a positive error number.

Also check return value from mmap in SysReserve - the callers of
SysReserve expect nil to be returned if the allocation failed.

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