]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agosync: faster Cond
Dmitriy Vyukov [Tue, 13 Aug 2013 10:45:36 +0000 (14:45 +0400)]
sync: faster Cond
The new version does not require any memory allocations and is 30-50% faster.
Also detect and painc if Cond is copied after first.

benchmark            old ns/op    new ns/op    delta
BenchmarkCond1             317          195  -38.49%
BenchmarkCond1-2           875          607  -30.63%
BenchmarkCond1-4          1116          548  -50.90%
BenchmarkCond1-8          1013          613  -39.49%
BenchmarkCond1-16          983          450  -54.22%
BenchmarkCond2             559          352  -37.03%
BenchmarkCond2-2          1916         1378  -28.08%
BenchmarkCond2-4          1518         1322  -12.91%
BenchmarkCond2-8          2313         1291  -44.19%
BenchmarkCond2-16         1885         1078  -42.81%
BenchmarkCond4            1070          614  -42.62%
BenchmarkCond4-2          4899         3047  -37.80%
BenchmarkCond4-4          3813         3006  -21.16%
BenchmarkCond4-8          3605         3045  -15.53%
BenchmarkCond4-16         4148         2637  -36.43%
BenchmarkCond8            2086         1264  -39.41%
BenchmarkCond8-2          9961         6736  -32.38%
BenchmarkCond8-4          8135         7689   -5.48%
BenchmarkCond8-8          9623         7517  -21.89%
BenchmarkCond8-16        11661         8093  -30.60%

R=sougou, rsc, bradfitz, r
CC=golang-dev
https://golang.org/cl/11573043

11 years agoruntime: eliminate excessive notewakeup calls in timers
Dmitriy Vyukov [Tue, 13 Aug 2013 10:14:24 +0000 (14:14 +0400)]
runtime: eliminate excessive notewakeup calls in timers
If the timer goroutine is wakeup by timeout,
other goroutines will still notewakeup because sleeping is still set.

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

11 years agosyscall: disable cpu profiling around fork
Dmitriy Vyukov [Tue, 13 Aug 2013 09:01:30 +0000 (13:01 +0400)]
syscall: disable cpu profiling around fork
Fixes #5517.
Fixes #5659.

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

11 years agoruntime: fix network timers related crash
Dmitriy Vyukov [Tue, 13 Aug 2013 08:55:57 +0000 (12:55 +0400)]
runtime: fix network timers related crash
Fixes #6103.

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

11 years agotag go1.1.2
Andrew Gerrand [Tue, 13 Aug 2013 06:33:59 +0000 (16:33 +1000)]
tag go1.1.2

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

11 years agogo/doc: permit a package synopsis to end with ":\n".
David Symonds [Tue, 13 Aug 2013 06:20:17 +0000 (16:20 +1000)]
go/doc: permit a package synopsis to end with ":\n".

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

11 years agodoc: release notes for go1.1.2
Andrew Gerrand [Tue, 13 Aug 2013 05:08:10 +0000 (15:08 +1000)]
doc: release notes for go1.1.2

R=golang-dev, go.peter.90, rsc, r
CC=golang-dev
https://golang.org/cl/12016043

11 years agocmd/gc: add temporary-merging optimization pass
Russ Cox [Tue, 13 Aug 2013 04:09:31 +0000 (00:09 -0400)]
cmd/gc: add temporary-merging optimization pass

The compilers assume they can generate temporary variables
as needed to preserve the right semantics or simplify code
generation and the back end will still generate good code.
This turns out not to be true. The back ends will only
track the first 128 variables per function and give up
on the remainder. That needs to be fixed too, in a later CL.

This CL merges temporary variables with equal types and
non-overlapping lifetimes using the greedy algorithm in
Poletto and Sarkar, "Linear Scan Register Allocation",
ACM TOPLAS 1999.

The result can be striking in the right functions.

Top 20 frame size changes in a 6g godoc binary by bytes saved:

5464 1984 (-3480, -63.7%) go/build.(*Context).Import
4456 1824 (-2632, -59.1%) go/printer.(*printer).expr1
2560   80 (-2480, -96.9%) time.nextStdChunk
3496 1608 (-1888, -54.0%) go/printer.(*printer).stmt
1896  272 (-1624, -85.7%) net/http.init
2688 1400 (-1288, -47.9%) fmt.(*pp).printReflectValue
2800 1512 (-1288, -46.0%) main.main
3296 2016 (-1280, -38.8%) crypto/tls.(*Conn).clientHandshake
1664  488 (-1176, -70.7%) time.loadZoneZip
1760  608 (-1152, -65.5%) time.parse
4104 3072 (-1032, -25.1%) runtime/pprof.writeHeap
1680  712 ( -968, -57.6%) go/ast.Walk
2488 1560 ( -928, -37.3%) crypto/x509.parseCertificate
1128  392 ( -736, -65.2%) math/big.nat.divLarge
1528  864 ( -664, -43.5%) go/printer.(*printer).fieldList
1360  712 ( -648, -47.6%) regexp/syntax.(*parser).factor
2104 1528 ( -576, -27.4%) encoding/asn1.parseField
1064  504 ( -560, -52.6%) encoding/xml.(*Decoder).text
 584   48 ( -536, -91.8%) html.init
1400  864 ( -536, -38.3%) go/doc.playExample

In the same godoc build, cuts the number of functions with
too many vars from 83 to 32.

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

11 years agodoc/go1.2.txt: bufio.{Writer,Reader}.Reset
Rob Pike [Tue, 13 Aug 2013 03:39:45 +0000 (13:39 +1000)]
doc/go1.2.txt: bufio.{Writer,Reader}.Reset

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

11 years agocmd/api: don't fail API check if there's no network
Brad Fitzpatrick [Tue, 13 Aug 2013 02:18:47 +0000 (19:18 -0700)]
cmd/api: don't fail API check if there's no network

If the hg checkout of go.tools fails, check for Internet
connectivity before failing.

R=golang-dev, shivakumar.gn
CC=golang-dev
https://golang.org/cl/12814043

11 years agocmd/6l: fix printing of frame size in TEXT instruction
Russ Cox [Tue, 13 Aug 2013 02:04:24 +0000 (22:04 -0400)]
cmd/6l: fix printing of frame size in TEXT instruction

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

11 years agocmd/gc: move flow graph into portable opt
Russ Cox [Tue, 13 Aug 2013 02:02:10 +0000 (22:02 -0400)]
cmd/gc: move flow graph into portable opt

Now there's only one copy of the flow graph construction
and dominator computation, and different optimizations
can attach different annotations to the instructions.

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

11 years agogo/build: change the wording of NoGoError and comment it better
Rob Pike [Tue, 13 Aug 2013 01:32:32 +0000 (11:32 +1000)]
go/build: change the wording of NoGoError and comment it better
Out of context, it can be very confusing because there can be lots of Go
files in the directory, but the error message says there aren't.

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

11 years agotext/template: Make function call builtin handle nil errors correctly
Elias Naur [Tue, 13 Aug 2013 01:11:05 +0000 (11:11 +1000)]
text/template: Make function call builtin handle nil errors correctly

The call builtin unconditionally tries to convert a second return value from a function to the error type. This fails in case nil is returned, effectively making call useless for functions returning two values.

This CL adds a nil check for the second return value, and adds a test.

Note that for regular function and method calls the nil error case is handled correctly and is verified by a test.

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

11 years agocmd/6g, cmd/8g: proginfo carry fixes
Russ Cox [Tue, 13 Aug 2013 01:02:55 +0000 (21:02 -0400)]
cmd/6g, cmd/8g: proginfo carry fixes

Bugs pointed out by cshapiro in CL 12637051.

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

11 years agocmd/gc: support for "portable" optimization logic
Russ Cox [Mon, 12 Aug 2013 23:14:02 +0000 (19:14 -0400)]
cmd/gc: support for "portable" optimization logic

Code in gc/popt.c is compiled as part of 5g, 6g, and 8g,
meaning it can use arch-specific headers but there's
just one copy of the code.

This is the same arrangement we use for the portable
code generation logic in gc/pgen.c.

Move fixjmp and noreturn there to get the ball rolling.

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

11 years agonet/http: do not send malformed cookie domain attribute
Volker Dobler [Mon, 12 Aug 2013 22:14:34 +0000 (15:14 -0700)]
net/http: do not send malformed cookie domain attribute

Malformed domain attributes are not sent in a Set-Cookie header.
Instead the domain attribute is dropped which turns the cookie
into a host-only cookie. This is much safer than dropping characters
from domain attribute.

Domain attributes with a leading dot '.' are still allowed, even
if discouraged by RFC 6265 section 4.1.1.

Fixes #6013

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

11 years agoruntime: change textflags from numbers to symbols
Keith Randall [Mon, 12 Aug 2013 20:47:18 +0000 (13:47 -0700)]
runtime: change textflags from numbers to symbols

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

11 years agoruntime/race: add end-to-end test
Dmitriy Vyukov [Mon, 12 Aug 2013 18:04:10 +0000 (22:04 +0400)]
runtime/race: add end-to-end test
Fixes #5933.

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

11 years agoruntime: remove unused m->racepc
Dmitriy Vyukov [Mon, 12 Aug 2013 17:48:19 +0000 (21:48 +0400)]
runtime: remove unused m->racepc
The original plan was to collect allocation stacks
for all memory blocks. But it was never implemented
and it's not in near plans and it's unclear how to do it at all.

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

11 years agosync/atomic: specify argsize for asm routines
Dmitriy Vyukov [Mon, 12 Aug 2013 17:46:33 +0000 (21:46 +0400)]
sync/atomic: specify argsize for asm routines
Fixes #6098.

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

11 years agocmd/5g: factor out prog information
Russ Cox [Mon, 12 Aug 2013 17:42:23 +0000 (13:42 -0400)]
cmd/5g: factor out prog information

Like CL 12637051, but for 5g instead of 6g.

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

11 years agocmd/5l: fix encoding of new MOVB, MOVH instructions
Russ Cox [Mon, 12 Aug 2013 17:42:04 +0000 (13:42 -0400)]
cmd/5l: fix encoding of new MOVB, MOVH instructions

They are just like MOVW and should be setting only
two register fields, not three.

R=ken2
CC=golang-dev, remyoudompheng
https://golang.org/cl/12781043

11 years agoruntime: fix ARM assembly formatting
Dmitriy Vyukov [Mon, 12 Aug 2013 17:36:33 +0000 (21:36 +0400)]
runtime: fix ARM assembly formatting

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

11 years agoall: change textflags from numbers to symbols.
Keith Randall [Mon, 12 Aug 2013 17:25:36 +0000 (10:25 -0700)]
all: change textflags from numbers to symbols.

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

11 years agomath: convert textflags from numbers to symbols
Keith Randall [Mon, 12 Aug 2013 17:25:18 +0000 (10:25 -0700)]
math: convert textflags from numbers to symbols

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

11 years agosyscall: Convert textflags from numbers to symbols.
Keith Randall [Mon, 12 Aug 2013 17:24:30 +0000 (10:24 -0700)]
syscall: Convert textflags from numbers to symbols.

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

11 years agocmd/8g: factor out prog information
Russ Cox [Mon, 12 Aug 2013 17:05:40 +0000 (13:05 -0400)]
cmd/8g: factor out prog information

Like CL 12637051, but for 8g instead of 6g.
Fix a few minor 6g errors too.

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

11 years agobufio: add Writer example
Andrew Gerrand [Mon, 12 Aug 2013 03:03:50 +0000 (13:03 +1000)]
bufio: add Writer example

Update #5530

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

11 years agobufio: make it clear that the client must call Writer.Flush
Rob Pike [Mon, 12 Aug 2013 02:55:33 +0000 (12:55 +1000)]
bufio: make it clear that the client must call Writer.Flush

Fixes #5530.

R=golang-dev, iant, com.liigo
CC=golang-dev
https://golang.org/cl/12688044

11 years agocrypto/rand: simplify example to exploit properties of ReadFull
Rob Pike [Mon, 12 Aug 2013 02:52:23 +0000 (12:52 +1000)]
crypto/rand: simplify example to exploit properties of ReadFull
No need for the complex condition.
Fixes #6089

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

11 years agocmd/6g: move opt instruction decode into common function
Russ Cox [Mon, 12 Aug 2013 01:46:38 +0000 (21:46 -0400)]
cmd/6g: move opt instruction decode into common function

Add new proginfo function that returns information about a
Prog*. The information includes various instruction
description bits as well as a list of required registers set
and used and indexing registers used.

Convert the large instruction switches to use proginfo.

This information was formerly duplicated in multiple
optimization passes, inconsistently. For example, the
information about which registers an instruction requires
appeared three times for most instructions.

Most of the switches were incomplete or incorrect in some way.
For example, the switch in copyu did not list cases for INCB,
JPS, MOVAPD, MOVBWSX, MOVBWZX, PCDATA, POPQ, PUSHQ, STD,
TESTB, TESTQ, and XCHGL. Those were all falling into the
"unknown instruction" default case and stopping the rewrite,
perhaps unnecessarily. Similarly, the switch in needc only
listed a handful of the instructions that use or set the carry bit.

We still need to decide whether to use proginfo to generalize
a few of the remaining smaller switches in peep.c.

If this goes well, we'll make similar changes in 8g and 5g.

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

11 years agodoc/go1.2.txt: json and ampersands
Rob Pike [Mon, 12 Aug 2013 01:28:25 +0000 (11:28 +1000)]
doc/go1.2.txt: json and ampersands

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

11 years agoruntime/pprof: add block profile test
Dmitriy Vyukov [Sun, 11 Aug 2013 09:05:51 +0000 (13:05 +0400)]
runtime/pprof: add block profile test
Fixes #5993.

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

11 years agonet/http: simplify server, use bufio Reader.Reset and Writer.Reset
Brad Fitzpatrick [Sun, 11 Aug 2013 02:22:44 +0000 (19:22 -0700)]
net/http: simplify server, use bufio Reader.Reset and Writer.Reset

Update #5100
Update #6086

Remove switchReader, switchWriter, switchReaderPair,
switchWriterPair, etc.

Now it only maintains pools of bufio Readers and Writers, but
uses Reset instead of working around all their
previously-associated state.

Compared to before the bufio Reset change, it's the same number of
allocations, and also faster:

benchmark                                   old ns/op    new ns/op    delta
BenchmarkClientServer                          111218       109828   -1.25%
BenchmarkClientServerParallel4                  70580        70013   -0.80%
BenchmarkClientServerParallel64                 72636        68919   -5.12%
BenchmarkServer                                139858       137068   -1.99%
BenchmarkServerFakeConnNoKeepAlive              14619        14314   -2.09%
BenchmarkServerFakeConnWithKeepAlive            12390        11361   -8.31%
BenchmarkServerFakeConnWithKeepAliveLite         7630         7306   -4.25%
BenchmarkServerHandlerTypeLen                    9688         9342   -3.57%
BenchmarkServerHandlerNoLen                      8700         8470   -2.64%
BenchmarkServerHandlerNoType                     9255         8949   -3.31%
BenchmarkServerHandlerNoHeader                   7058         6806   -3.57%

benchmark                                  old allocs   new allocs    delta
BenchmarkClientServer                              61           61    0.00%
BenchmarkClientServerParallel4                     61           61    0.00%
BenchmarkClientServerParallel64                    61           61    0.00%
BenchmarkServer                                    16           16    0.00%
BenchmarkServerFakeConnNoKeepAlive                 24           24    0.00%
BenchmarkServerFakeConnWithKeepAlive               19           19    0.00%
BenchmarkServerFakeConnWithKeepAliveLite            9            9    0.00%
BenchmarkServerHandlerTypeLen                      17           17    0.00%
BenchmarkServerHandlerNoLen                        14           14    0.00%
BenchmarkServerHandlerNoType                       15           15    0.00%
BenchmarkServerHandlerNoHeader                      9            9    0.00%

benchmark                                   old bytes    new bytes    delta
BenchmarkClientServer                            6988         6985   -0.04%
BenchmarkClientServerParallel4                   6979         6985    0.09%
BenchmarkClientServerParallel64                  7002         7019    0.24%
BenchmarkServer                                  1846         1848    0.11%
BenchmarkServerFakeConnNoKeepAlive               2420         2412   -0.33%
BenchmarkServerFakeConnWithKeepAlive             2126         2129    0.14%
BenchmarkServerFakeConnWithKeepAliveLite          989          990    0.10%
BenchmarkServerHandlerTypeLen                    1818         1819    0.06%
BenchmarkServerHandlerNoLen                      1775         1777    0.11%
BenchmarkServerHandlerNoType                     1783         1785    0.11%
BenchmarkServerHandlerNoHeader                    989          990    0.10%

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

11 years agobufio: drop buffer recycling, add Reader.Reset and Writer.Reset
Brad Fitzpatrick [Sun, 11 Aug 2013 02:22:19 +0000 (19:22 -0700)]
bufio: drop buffer recycling, add Reader.Reset and Writer.Reset

Fixes #6086

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

11 years agocmd/gc: zero pointers on entry to function
Russ Cox [Sat, 10 Aug 2013 03:10:58 +0000 (23:10 -0400)]
cmd/gc: zero pointers on entry to function

On entry to a function, zero the results and zero the pointer
section of the local variables.

This is an intermediate step on the way to precise collection
of Go frames.

This can incur a significant (up to 30%) slowdown, but it also ensures
that the garbage collector never looks at a word in a Go frame
and sees a stale pointer value that could cause a space leak.
(C frames and assembly frames are still possibly problematic.)

This CL is required to start making collection of interface values
as precise as collection of pointer values are today.
Since we have to dereference the interface type to understand
whether the value is a pointer, it is critical that the type field be
initialized.

A future CL by Carl will make the garbage collection pointer
bitmaps context-sensitive. At that point it will be possible to
remove most of the zeroing. The only values that will still need
zeroing are values whose addresses escape the block scoping
of the function but do not escape to the heap.

benchmark                         old ns/op    new ns/op    delta
BenchmarkBinaryTree17            4420289180   4331060459   -2.02%
BenchmarkFannkuch11              3442469663   3277706251   -4.79%
BenchmarkFmtFprintfEmpty                100          142  +42.00%
BenchmarkFmtFprintfString               262          310  +18.32%
BenchmarkFmtFprintfInt                  213          281  +31.92%
BenchmarkFmtFprintfIntInt               355          431  +21.41%
BenchmarkFmtFprintfPrefixedInt          321          383  +19.31%
BenchmarkFmtFprintfFloat                444          533  +20.05%
BenchmarkFmtManyArgs                   1380         1559  +12.97%
BenchmarkGobDecode                 10240054     11794915  +15.18%
BenchmarkGobEncode                 17350274     19970478  +15.10%
BenchmarkGzip                     455179460    460699139   +1.21%
BenchmarkGunzip                   114271814    119291574   +4.39%
BenchmarkHTTPClientServer             89051        89894   +0.95%
BenchmarkJSONEncode                40486799     52691558  +30.15%
BenchmarkJSONDecode                94193361    112428781  +19.36%
BenchmarkMandelbrot200              4747060      4748043   +0.02%
BenchmarkGoParse                    6363798      6675098   +4.89%
BenchmarkRegexpMatchEasy0_32            129          171  +32.56%
BenchmarkRegexpMatchEasy0_1K            365          395   +8.22%
BenchmarkRegexpMatchEasy1_32            106          152  +43.40%
BenchmarkRegexpMatchEasy1_1K            952         1245  +30.78%
BenchmarkRegexpMatchMedium_32           198          283  +42.93%
BenchmarkRegexpMatchMedium_1K         79006       101097  +27.96%
BenchmarkRegexpMatchHard_32            3478         5115  +47.07%
BenchmarkRegexpMatchHard_1K          110245       163582  +48.38%
BenchmarkRevcomp                  777384355    793270857   +2.04%
BenchmarkTemplate                 136713089    157093609  +14.91%
BenchmarkTimeParse                     1511         1761  +16.55%
BenchmarkTimeFormat                     535          850  +58.88%

benchmark                          old MB/s     new MB/s  speedup
BenchmarkGobDecode                    74.95        65.07    0.87x
BenchmarkGobEncode                    44.24        38.43    0.87x
BenchmarkGzip                         42.63        42.12    0.99x
BenchmarkGunzip                      169.81       162.67    0.96x
BenchmarkJSONEncode                   47.93        36.83    0.77x
BenchmarkJSONDecode                   20.60        17.26    0.84x
BenchmarkGoParse                       9.10         8.68    0.95x
BenchmarkRegexpMatchEasy0_32         247.24       186.31    0.75x
BenchmarkRegexpMatchEasy0_1K        2799.20      2591.93    0.93x
BenchmarkRegexpMatchEasy1_32         299.31       210.44    0.70x
BenchmarkRegexpMatchEasy1_1K        1074.71       822.45    0.77x
BenchmarkRegexpMatchMedium_32          5.04         3.53    0.70x
BenchmarkRegexpMatchMedium_1K         12.96        10.13    0.78x
BenchmarkRegexpMatchHard_32            9.20         6.26    0.68x
BenchmarkRegexpMatchHard_1K            9.29         6.26    0.67x
BenchmarkRevcomp                     326.95       320.40    0.98x
BenchmarkTemplate                     14.19        12.35    0.87x

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

11 years agodoc: update go1.2.txt
Russ Cox [Sat, 10 Aug 2013 02:25:49 +0000 (22:25 -0400)]
doc: update go1.2.txt

I skimmed the submitted CLs back to Monday.

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

11 years agostrconv: fix typo in docs
ChaiShushan [Sat, 10 Aug 2013 01:38:42 +0000 (11:38 +1000)]
strconv: fix typo in docs

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

11 years agonet: move InvalidAddrError type into net.go
Mikio Hara [Sat, 10 Aug 2013 00:46:22 +0000 (09:46 +0900)]
net: move InvalidAddrError type into net.go

Probably we should remove this type before Go 1 contract has settled,
but too late. Instead, keep InvalidAddrError close to package generic
error types.

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

11 years agodoc/go1.2.txt: Added missing changes since 1st of August
Pieter Droogendijk [Fri, 9 Aug 2013 23:48:43 +0000 (09:48 +1000)]
doc/go1.2.txt: Added missing changes since 1st of August

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

11 years agocmd/cc, cmd/gc, runtime: Uniquely encode iface and eface pointers in the pointer...
Carl Shapiro [Fri, 9 Aug 2013 23:48:12 +0000 (16:48 -0700)]
cmd/cc, cmd/gc, runtime: Uniquely encode iface and eface pointers in the pointer map.

Prior to this change, pointer maps encoded the disposition of
a word using a single bit.  A zero signaled a non-pointer
value and a one signaled a pointer value.  Interface values,
which are a effectively a union type, were conservatively
labeled as a pointer.

This change widens the logical element size of the pointer map
to two bits per word.  As before, zero signals a non-pointer
value and one signals a pointer value.  Additionally, a two
signals an iface pointer and a three signals an eface pointer.

Following other changes to the runtime, values two and three
will allow a type information to drive interpretation of the
subsequent word so only those interface values containing a
pointer value will be scanned.

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

11 years agoencoding/binary: better description for intReadSize
Rob Pike [Fri, 9 Aug 2013 23:11:58 +0000 (09:11 +1000)]
encoding/binary: better description for intReadSize
It used to be called intDestSize; the new name is better too.

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

11 years agocmd/api: eliminate duplicate package import work
Russ Cox [Fri, 9 Aug 2013 22:44:00 +0000 (18:44 -0400)]
cmd/api: eliminate duplicate package import work

On my Mac, cuts the API checks from 15 seconds to 6 seconds.
Also clean up some tag confusion: go run list-of-files ignores tags.

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

11 years agoencoding/binary: fast path for reading slices
Rob Pike [Fri, 9 Aug 2013 22:40:32 +0000 (08:40 +1000)]
encoding/binary: fast path for reading slices

Again, it still allocates but the code is simple.

benchmark                       old ns/op    new ns/op    delta
BenchmarkReadSlice1000Int32s        35580        11465  -67.78%

benchmark                        old MB/s     new MB/s  speedup
BenchmarkReadSlice1000Int32s       112.42       348.86    3.10x

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

11 years agogo/build: add AllTags to Package
Russ Cox [Fri, 9 Aug 2013 22:34:08 +0000 (18:34 -0400)]
go/build: add AllTags to Package

AllTags lists all the tags that can affect the decision
about which files to include. Tools scanning packages
can use this to decide how many variants there are
and what they are.

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

11 years agoencoding/json: escape & always
Russ Cox [Fri, 9 Aug 2013 22:33:57 +0000 (18:33 -0400)]
encoding/json: escape & always

There are a few different places in the code that escape
possibly-problematic characters like < > and &.
This one was the only one missing &, so add it.

This means that if you Marshal a string, you get the
same answer you do if you Marshal a string and
pass it through the compactor. (Ironically, the
compaction makes the string longer.)

Because html/template invokes json.Marshal to
prepare escaped strings for JavaScript, this changes
the form of some of the escaped strings, but not
their meaning.

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

11 years agoruntime: Better test tracebackability of jmpdefer when running a nil defer.
Keith Randall [Fri, 9 Aug 2013 22:27:45 +0000 (15:27 -0700)]
runtime: Better test tracebackability of jmpdefer when running a nil defer.

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

11 years agonet/http: Make ReadResponse work with a nil Request parameter
Taru Karttunen [Fri, 9 Aug 2013 22:11:03 +0000 (15:11 -0700)]
net/http: Make ReadResponse work with a nil Request parameter

Fixes #5583

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

11 years agomisc/emacs: add support for mode=count coverage
Dominik Honnef [Fri, 9 Aug 2013 21:42:43 +0000 (14:42 -0700)]
misc/emacs: add support for mode=count coverage

Use the same algorithm that go tool cover uses when producing HTML
output to render coverage intensity.

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

11 years agonet: fix LookupSRV ordering on plan 9
Nicolas Owens [Fri, 9 Aug 2013 21:16:43 +0000 (14:16 -0700)]
net: fix LookupSRV ordering on plan 9

lookup_plan9.go's lookupSRV is using the wrong order for srv results. order should be weight, priority, port, following the response from /net/dns:

  chi Aug  9 20:31:13 Rread tag 20 count 61 '_xmpp-client._tcp.offblast.org srv 5 0 5222 iota.offblast.org' 72

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

11 years agomime: escape backslash in attribute values
Pieter Droogendijk [Fri, 9 Aug 2013 20:10:53 +0000 (13:10 -0700)]
mime: escape backslash in attribute values

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

11 years agocmd/cc: use a temporary bitmap when constructing pointer maps
Carl Shapiro [Fri, 9 Aug 2013 20:02:33 +0000 (13:02 -0700)]
cmd/cc: use a temporary bitmap when constructing pointer maps

This change makes the way cc constructs pointer maps closer to
what gc does and is being done in preparation for changes to
the internal content of the pointer map such as a change to
distinguish interface pointers from ordinary pointers.

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

11 years agostrings: add test for Count
Pieter Droogendijk [Fri, 9 Aug 2013 19:51:21 +0000 (12:51 -0700)]
strings: add test for Count

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

11 years agoio/ioutil: add WriteString to Discard
Brad Fitzpatrick [Fri, 9 Aug 2013 18:27:29 +0000 (11:27 -0700)]
io/ioutil: add WriteString to Discard

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

11 years agoruntime: fix netbsd build
Dmitriy Vyukov [Fri, 9 Aug 2013 18:17:12 +0000 (22:17 +0400)]
runtime: fix netbsd build
I've placed net.runtime_Semacquire into netpoll.goc,
but netbsd does not yet use netpoll.goc.

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

11 years agonet: add special netFD mutex
Dmitriy Vyukov [Fri, 9 Aug 2013 17:43:00 +0000 (21:43 +0400)]
net: add special netFD mutex
The mutex, fdMutex, handles locking and lifetime of sysfd,
and serializes Read and Write methods.
This allows to strip 2 sync.Mutex.Lock calls,
2 sync.Mutex.Unlock calls, 1 defer and some amount
of misc overhead from every network operation.

On linux/amd64, Intel E5-2690:
benchmark                             old ns/op    new ns/op    delta
BenchmarkTCP4Persistent                    9595         9454   -1.47%
BenchmarkTCP4Persistent-2                  8978         8772   -2.29%
BenchmarkTCP4ConcurrentReadWrite           4900         4625   -5.61%
BenchmarkTCP4ConcurrentReadWrite-2         2603         2500   -3.96%

In general it strips 70-500 ns from every network operation depending
on processor model. On my relatively new E5-2690 it accounts to ~5%
of network op cost.

Fixes #6074.

R=golang-dev, bradfitz, alex.brainman, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/12418043

11 years agoencoding/json: faster encoding
Brad Fitzpatrick [Fri, 9 Aug 2013 16:46:47 +0000 (09:46 -0700)]
encoding/json: faster encoding

The old code was caching per-type struct field info. Instead,
cache type-specific encoding funcs, tailored for that
particular type to avoid unnecessary reflection at runtime.
Once the machine is built once, future encodings of that type
just run the func.

benchmark               old ns/op    new ns/op    delta
BenchmarkCodeEncoder     48424939     36975320  -23.64%

benchmark                old MB/s     new MB/s  speedup
BenchmarkCodeEncoder        40.07        52.48    1.31x

Additionally, the numbers seem stable now at ~52 MB/s, whereas
the numbers for the old code were all over the place: 11 MB/s,
40 MB/s, 13 MB/s, 39 MB/s, etc.  In the benchmark above I compared
against the best I saw the old code do.

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

11 years agonet: give C.getaddrinfo a hint that we only want SOCK_STREAM answers
Ian Lance Taylor [Fri, 9 Aug 2013 16:23:27 +0000 (09:23 -0700)]
net: give C.getaddrinfo a hint that we only want SOCK_STREAM answers

This should be more efficient everywhere, and appears to be
required on Solaris.

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

11 years agomisc/emacs: clear previous overlays before adding new ones
Dominik Honnef [Fri, 9 Aug 2013 15:56:15 +0000 (08:56 -0700)]
misc/emacs: clear previous overlays before adding new ones

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

11 years agotest: update bug086.go for current gccgo behaviour
Ian Lance Taylor [Fri, 9 Aug 2013 15:43:19 +0000 (08:43 -0700)]
test: update bug086.go for current gccgo behaviour

bug086.go:14:1: error: missing return at end of function

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

11 years agoencoding/binary: fix 32-bit build
Rob Pike [Fri, 9 Aug 2013 13:23:34 +0000 (23:23 +1000)]
encoding/binary: fix 32-bit build
Sigh.

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

11 years agoencoding/binary: speed up writing slices of integers
Rob Pike [Fri, 9 Aug 2013 13:15:08 +0000 (23:15 +1000)]
encoding/binary: speed up writing slices of integers

Simple approach. Still generates garbage, but not as much.

benchmark                        old ns/op    new ns/op    delta
BenchmarkWriteSlice1000Int32s        40260        18791  -53.33%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkWriteSlice1000Int32s        99.35       212.87    2.14x

Fixes #2634.

R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/12680046

11 years agocmd/go: cgo programs depend on syscall
Russ Cox [Fri, 9 Aug 2013 13:03:25 +0000 (09:03 -0400)]
cmd/go: cgo programs depend on syscall

Fixes #5048.

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

11 years agoruntime: traceback running goroutines
Dmitriy Vyukov [Fri, 9 Aug 2013 08:53:35 +0000 (12:53 +0400)]
runtime: traceback running goroutines
Introduce freezetheworld function that is a best-effort attempt to stop any concurrently running goroutines. Call it during crash.
Fixes #5873.

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

11 years agoencoding/binary: document its goals better
Rob Pike [Fri, 9 Aug 2013 07:08:02 +0000 (17:08 +1000)]
encoding/binary: document its goals better
It's a modest package with modest goals and limitations.
Make that clear.

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

11 years agocmd/gc: make missing package error fatal
Rick Arnold [Fri, 9 Aug 2013 06:05:40 +0000 (16:05 +1000)]
cmd/gc: make missing package error fatal

No longer continue assuming package main.

Fixes #4776.

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

11 years agoencoding/csv: always allow trailing commas
Pieter Droogendijk [Fri, 9 Aug 2013 05:46:01 +0000 (15:46 +1000)]
encoding/csv: always allow trailing commas

Original CL by rsc (11916045):

The motivation for disallowing them was RFC 4180 saying
"The last field in the record must not be followed by a comma."
I believe this is an admonition to CSV generators, not readers.
When reading, anything followed by a comma is not the last field.

Fixes #5892.

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

11 years agocmd/5c, cmd/5g, cmd/5l: turn MOVB, MOVH into plain moves, optimize short arithmetic.
Rémy Oudompheng [Fri, 9 Aug 2013 04:43:17 +0000 (06:43 +0200)]
cmd/5c, cmd/5g, cmd/5l: turn MOVB, MOVH into plain moves, optimize short arithmetic.

Pseudo-instructions MOVBS and MOVHS are used to clarify
the semantics of short integers vs. registers:
 * 8-bit and 16-bit values in registers are assumed to always
   be zero-extended or sign-extended depending on their type.
 * MOVB is truncation or move of an already extended value
   between registers.
 * MOVBU enforces zero-extension at the destination (register).
 * MOVBS enforces sign-extension at the destination (register).
And similarly for MOVH/MOVS/MOVHU.

The linker is adapted to assemble MOVB and MOVH to an ordinary
mov. Also a peephole pass in 5g that aims at eliminating
redundant zero/sign extensions is improved.

encoding/binary:
benchmark                              old ns/op    new ns/op    delta
BenchmarkReadSlice1000Int32s              220387       217185   -1.45%
BenchmarkReadStruct                        12839        12910   +0.55%
BenchmarkReadInts                           5692         5534   -2.78%
BenchmarkWriteInts                          6137         6016   -1.97%
BenchmarkPutUvarint32                        257          241   -6.23%
BenchmarkPutUvarint64                        812          754   -7.14%
benchmark                               old MB/s     new MB/s  speedup
BenchmarkReadSlice1000Int32s               18.15        18.42    1.01x
BenchmarkReadStruct                         5.45         5.42    0.99x
BenchmarkReadInts                           5.27         5.42    1.03x
BenchmarkWriteInts                          4.89         4.99    1.02x
BenchmarkPutUvarint32                      15.56        16.57    1.06x
BenchmarkPutUvarint64                       9.85        10.60    1.08x

crypto/des:
benchmark                              old ns/op    new ns/op    delta
BenchmarkEncrypt                            7002         5169  -26.18%
BenchmarkDecrypt                            7015         5195  -25.94%
benchmark                               old MB/s     new MB/s  speedup
BenchmarkEncrypt                            1.14         1.55    1.36x
BenchmarkDecrypt                            1.14         1.54    1.35x

strconv:
benchmark                              old ns/op    new ns/op    delta
BenchmarkAtof64Decimal                       457          385  -15.75%
BenchmarkAtof64Float                         574          479  -16.55%
BenchmarkAtof64FloatExp                     1035          906  -12.46%
BenchmarkAtof64Big                          1793         1457  -18.74%
BenchmarkAtof64RandomBits                   2267         2066   -8.87%
BenchmarkAtof64RandomFloats                 1416         1194  -15.68%
BenchmarkAtof32Decimal                       451          379  -15.96%
BenchmarkAtof32Float                         547          435  -20.48%
BenchmarkAtof32FloatExp                     1095          986   -9.95%
BenchmarkAtof32Random                       1154         1006  -12.82%
BenchmarkAtoi                               1415         1380   -2.47%
BenchmarkAtoiNeg                            1414         1401   -0.92%
BenchmarkAtoi64                             1744         1671   -4.19%
BenchmarkAtoi64Neg                          1737         1662   -4.32%

Fixes #1837.

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

11 years agocmd/go: install godoc into correct directory
Russ Cox [Fri, 9 Aug 2013 03:48:03 +0000 (23:48 -0400)]
cmd/go: install godoc into correct directory

Fixes #6043.

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

11 years agomisc/pprof: pprof on windows does not provide demangled names
Shivakumar GN [Fri, 9 Aug 2013 03:42:24 +0000 (13:42 +1000)]
misc/pprof: pprof on windows does not provide demangled names

Fixes #6034.

R=golang-dev, bradfitz, alex.brainman, dan.kortschak
CC=golang-dev
https://golang.org/cl/12311044

11 years agotext/template/parse: nicer error when comment ends before final delimiter
Rob Pike [Fri, 9 Aug 2013 02:57:21 +0000 (12:57 +1000)]
text/template/parse: nicer error when comment ends before final delimiter
By separating finding the end of the comment from the end of the action,
we can diagnose malformed comments better.
Also tweak the documentation to make the comment syntax clearer.

Fixes #6022.

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

11 years agocmd/cc: restore correct meaning of %Q
Russ Cox [Fri, 9 Aug 2013 01:06:06 +0000 (21:06 -0400)]
cmd/cc: restore correct meaning of %Q

g% 6c ~/x.c
/Users/rsc/x.c:1 duplicate types given: STRUCT s and VOID
/Users/rsc/x.c:1 no return at end of function: f
g%

Fixes #6083.

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

11 years agoreflect: avoid allocation when interface's contents are not addressable
Rob Pike [Fri, 9 Aug 2013 00:49:01 +0000 (10:49 +1000)]
reflect: avoid allocation when interface's contents are not addressable
See issue 4949 for a full explanation.

Allocs go from 1 to zero in the non-addressable case.
Fixes #4949.

BenchmarkInterfaceBig             90           14  -84.01%
BenchmarkInterfaceSmall           14           14   +0.00%

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

11 years agonet/mail: comment our divergence from RFC 5322.
David Symonds [Fri, 9 Aug 2013 00:17:57 +0000 (10:17 +1000)]
net/mail: comment our divergence from RFC 5322.

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

11 years agonet: separate unix pollster initialization from network file descriptor allocation
Mikio Hara [Fri, 9 Aug 2013 00:02:27 +0000 (09:02 +0900)]
net: separate unix pollster initialization from network file descriptor allocation

Unlike the existing net package own pollster, runtime-integrated
network pollster on BSD variants, actually kqueue, requires a socket
that has beed passed to syscall.Listen previously for a stream
listener.

This CL separates pollDesc.Init of Unix network pollster from newFD
to avoid any breakages in the transition from Unix network pollster
to runtime-integrated pollster. Upcoming CLs will rearrange the call
order of pollster and syscall functions like the following;

- For dialers that open active connections, pollDesc.Init will be
  called in between syscall.Bind and syscall.Connect.

- For stream listeners that open passive stream connections,
  pollDesc.Init will be called just after syscall.Listen.

- For datagram listeners that open datagram connections,
  pollDesc.Init will be called just after syscall.Bind.

This is in preparation for runtime-integrated network pollster for BSD
variants.

Update #5199

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

11 years agonet: avoid string operation and make valid domain names explicit
Volker Dobler [Thu, 8 Aug 2013 23:33:57 +0000 (16:33 -0700)]
net: avoid string operation and make valid domain names explicit

Having a trailing dot in the string doesn't really simplify
the checking loop in isDomainName. Avoid this unnecessary allocation.
Also make the valid domain names more explicit by adding some more
test cases.

benchmark            old ns/op    new ns/op    delta
BenchmarkDNSNames       2420.0        983.0  -59.38%

benchmark           old allocs   new allocs    delta
BenchmarkDNSNames           12            0  -100.00%

benchmark            old bytes    new bytes    delta
BenchmarkDNSNames          336            0  -100.00%

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

11 years agomisc/emacs: Add support for code coverage output of go test
Dominik Honnef [Thu, 8 Aug 2013 22:54:26 +0000 (15:54 -0700)]
misc/emacs: Add support for code coverage output of go test

Renders code coverage as an overlay, replicating the look of the
HTML that go tool cover produces.

Also some cleanups.

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

11 years agocmd/api: add a benchmark over the standard library
Brad Fitzpatrick [Thu, 8 Aug 2013 22:25:15 +0000 (15:25 -0700)]
cmd/api: add a benchmark over the standard library

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

11 years agocmd/5c, cmd/5g, cmd/5l: introduce MOVBS and MOVHS instructions.
Rémy Oudompheng [Thu, 8 Aug 2013 21:28:53 +0000 (23:28 +0200)]
cmd/5c, cmd/5g, cmd/5l: introduce MOVBS and MOVHS instructions.

MOVBS and MOVHS are defined as duplicates of MOVB and MOVH,
and perform sign-extension moving.
No change is made to code generation.

Update #1837

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

11 years agocmd/api: rewrite using go/types
Robert Griesemer [Thu, 8 Aug 2013 21:10:59 +0000 (14:10 -0700)]
cmd/api: rewrite using go/types

- adjusted test files so that they actually type-check
- adjusted go1.txt, go1.1.txt, next.txt
- to run, provide build tag: api_tool

Fixes #4538.

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

11 years agonet/http: fix early side effects in the ResponseWriter's ReadFrom
Brad Fitzpatrick [Thu, 8 Aug 2013 21:02:54 +0000 (14:02 -0700)]
net/http: fix early side effects in the ResponseWriter's ReadFrom

The ResponseWriter's ReadFrom method was causing side effects on
the output before any data was read.

Now, bail out early and do a normal copy (which does a read
before writing) when our input and output are known to not to
be the pair of types we need for sendfile.

Fixes #5660

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

11 years agocmd/gc: fix stkptrsize calculation
Russ Cox [Thu, 8 Aug 2013 20:44:16 +0000 (16:44 -0400)]
cmd/gc: fix stkptrsize calculation

I moved the pointer block from one end of the frame
to the other toward the end of working on the last CL,
and of course that made the optimization no longer work.

Now it works again:

0030 (bug361.go:12) DATA    gclocals·0+0(SB)/4,$4
0030 (bug361.go:12) DATA    gclocals·0+4(SB)/4,$3
0030 (bug361.go:12) GLOBL   gclocals·0+0(SB),8,$8

Fixes arm build (this time for sure!).

TBR=golang-dev
CC=cshapiro, golang-dev, iant
https://golang.org/cl/12627044

11 years agocmd/gc: make bitmaps shorter
Russ Cox [Thu, 8 Aug 2013 20:38:02 +0000 (16:38 -0400)]
cmd/gc: make bitmaps shorter

Sort non-pointer-containing data to the low end of the
stack frame, and make the bitmaps only cover the
pointer-containing top end.

Generates significantly less garbage collection bitmap
for programs with large byte buffers on the stack.

Only 2% shorter for godoc, but 99.99998% shorter
in some test cases.

Fixes arm build.

TBR=golang-dev
CC=cshapiro, golang-dev, iant
https://golang.org/cl/12541047

11 years agocmd/api: show output of api tool even if exit status is 0
Brad Fitzpatrick [Thu, 8 Aug 2013 20:36:22 +0000 (13:36 -0700)]
cmd/api: show output of api tool even if exit status is 0

We weren't seeing additions. (stuff to put in next.txt)

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

11 years agoos: fix windows and plan9 builds
Brad Fitzpatrick [Thu, 8 Aug 2013 18:13:00 +0000 (11:13 -0700)]
os: fix windows and plan9 builds

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

11 years agocmd/api: update run.go to fetch from go.tools when needed
Brad Fitzpatrick [Thu, 8 Aug 2013 18:06:38 +0000 (11:06 -0700)]
cmd/api: update run.go to fetch from go.tools when needed

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

11 years agomisc/notepadplus: fix functionList regex issue
ChaiShushan [Thu, 8 Aug 2013 17:57:32 +0000 (10:57 -0700)]
misc/notepadplus: fix functionList regex issue

The receiver name is optional. when Method's receiver name messing,
the functionList regex can't match the Method,
e.g. `func (*T) ProtoMessage() {}`.

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

11 years agoruntime: print scavenger details when forced with debug.FreeOSMemory
Dmitriy Vyukov [Thu, 8 Aug 2013 17:55:04 +0000 (21:55 +0400)]
runtime: print scavenger details when forced with debug.FreeOSMemory
Fixes #5900.

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

11 years agocmd/gc: move large stack variables to heap
Russ Cox [Thu, 8 Aug 2013 17:46:30 +0000 (13:46 -0400)]
cmd/gc: move large stack variables to heap

Individual variables bigger than 10 MB are now
moved to the heap, as if they had escaped on
their own.

This avoids ridiculous stacks for programs that
do things like
        x := [1<<30]byte{}
        ... use x ...

If 10 MB is too small, we can raise the limit.

Fixes #6077.

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

11 years agoos: make Readdir work as documented
Pieter Droogendijk [Thu, 8 Aug 2013 17:44:01 +0000 (10:44 -0700)]
os: make Readdir work as documented

Readdir's result should never contain a nil.

Fixes #5960.

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

11 years agoencoding/xml: allow attributes stored in pointers to be marshaled.
Dmitriy Shelenin [Thu, 8 Aug 2013 17:40:51 +0000 (10:40 -0700)]
encoding/xml: allow attributes stored in pointers to be marshaled.

Fixes #5334.

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

11 years agoA+C: add googlemail aliases for deemok
Brad Fitzpatrick [Thu, 8 Aug 2013 17:40:32 +0000 (10:40 -0700)]
A+C: add googlemail aliases for deemok

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

11 years agoA+C: Dmitriy Shelenin (individual CLA)
Brad Fitzpatrick [Thu, 8 Aug 2013 17:08:45 +0000 (10:08 -0700)]
A+C: Dmitriy Shelenin (individual CLA)

Generated by addca.

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

11 years agonet/mail: AddressList fails to parse addresses with a dot
Ryan Slade [Thu, 8 Aug 2013 17:00:24 +0000 (10:00 -0700)]
net/mail: AddressList fails to parse addresses with a dot

Fixes #4938.

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

11 years agodoc/go1.2.txt: document previously committed features
Pieter Droogendijk [Thu, 8 Aug 2013 16:57:31 +0000 (09:57 -0700)]
doc/go1.2.txt: document previously committed features

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

11 years agoruntime: use GetQueuedCompletionStatusEx on windows if available
Dmitriy Vyukov [Thu, 8 Aug 2013 13:41:57 +0000 (17:41 +0400)]
runtime: use GetQueuedCompletionStatusEx on windows if available
GetQueuedCompletionStatusEx allows to dequeue a batch of completion
notifications, which is more efficient than dequeueing one by one.

benchmark                           old ns/op    new ns/op    delta
BenchmarkClientServerParallel4         100605        90945   -9.60%
BenchmarkClientServerParallel4-2        90225        74504  -17.42%

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

11 years agonet: use SetFileCompletionNotificationModes on windows if available
Dmitriy Vyukov [Thu, 8 Aug 2013 13:36:43 +0000 (17:36 +0400)]
net: use SetFileCompletionNotificationModes on windows if available
This allows to skip GetQueuedCompletionStatus if an IO operation completes synchronously.
benchmark                    old ns/op    new ns/op    delta
BenchmarkTCP4Persistent          27669        25863   -6.53%
BenchmarkTCP4Persistent-2        18173        15908  -12.46%
BenchmarkTCP4Persistent-4        10390         9766   -6.01%

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

11 years agoregexp/syntax: make it clearer that \b and \B are ASCII-defined
Rob Pike [Thu, 8 Aug 2013 03:26:39 +0000 (13:26 +1000)]
regexp/syntax: make it clearer that \b and \B are ASCII-defined
Fixes #5896.

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

11 years agocontainer/list: fix typo in comment
Rob Pike [Thu, 8 Aug 2013 02:41:19 +0000 (12:41 +1000)]
container/list: fix typo in comment
Fixes #6058.

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