1
0
mirror of https://github.com/golang/go synced 2024-10-04 08:21:22 -06:00
Commit Graph

6249 Commits

Author SHA1 Message Date
Marcel van Lohuizen
9c9754409d bytes: fixed typo.
R=r
CC=golang-dev
https://golang.org/cl/6301096
2012-06-18 17:43:05 -07:00
Brad Fitzpatrick
61809cd182 net/url: sort keys in Encode; don't enumerate map randomly
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6303098
2012-06-18 12:54:36 -07:00
Robert Griesemer
417a7f80d2 go/ast: Walk: do not walk comment list
A comment to that effect was introduced
with rev d332f4b9cef5 but the respective
code wasn't deleted.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6304086
2012-06-15 16:55:15 -07:00
Nigel Tao
834edc4257 exp/html/atom: add some more atoms.
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/6298085
2012-06-15 15:39:25 +10:00
Shenghou Ma
9852614291 exp/types: clean up objects after test
Fixes #3739.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6295083
2012-06-15 02:52:18 +08:00
Shenghou Ma
a11e74daf7 crypto/elliptic: fix doc typo
Fixes #3735.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6301083
2012-06-14 22:43:15 +08:00
Nigel Tao
8f84328fdc cmd/gc: inline convT2E when T is uintptr-shaped.
GOARCH=amd64 benchmarks

src/pkg/runtime
benchmark                  old ns/op    new ns/op    delta
BenchmarkConvT2ESmall             10           10   +1.00%
BenchmarkConvT2EUintptr            9            0  -92.07%
BenchmarkConvT2EBig               74           74   -0.27%
BenchmarkConvT2I                  27           26   -3.62%
BenchmarkConvI2E                   4            4   -7.05%
BenchmarkConvI2I                  20           19   -2.99%

test/bench/go1
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    5930908000   5937260000   +0.11%
BenchmarkFannkuch11      3927057000   3933556000   +0.17%
BenchmarkGobDecode         21998090     21870620   -0.58%
BenchmarkGobEncode         12725310     12734480   +0.07%
BenchmarkGzip             567617600    567892800   +0.05%
BenchmarkGunzip           178284100    178706900   +0.24%
BenchmarkJSONEncode        87693550     86794300   -1.03%
BenchmarkJSONDecode       314212600    324115000   +3.15%
BenchmarkMandelbrot200      7016640      7073766   +0.81%
BenchmarkParse              7852100      7892085   +0.51%
BenchmarkRevcomp         1285663000   1286147000   +0.04%
BenchmarkTemplate         566823800    567606200   +0.14%

I'm not entirely sure why the JSON* numbers have changed, but
eyeballing the profile suggests that it could be spending less
and more time in runtime.{new,old}stack, so it could simply be
stack-split boundary noise.

R=rsc, dave, bsiegert, dsymonds
CC=golang-dev
https://golang.org/cl/6280049
2012-06-14 10:43:20 +10:00
Rob Pike
733ee91786 encoding/gob: don't cache broken encoding engines.
Fixes a situation where a nested bad type would still
permit the outer type to install a working engine, leading
to inconsistent behavior.

Fixes #3273.

R=bsiegert, rsc
CC=golang-dev
https://golang.org/cl/6294067
2012-06-13 15:55:43 -07:00
Brad Fitzpatrick
45969825b5 net/http: use index.html modtime (not directory) for If-Modified-Since
Thanks to Håvid Falch for finding the problem.

Fixes #3414

R=r, rsc
CC=golang-dev
https://golang.org/cl/6300081
2012-06-13 14:53:05 -07:00
Rémy Oudompheng
5468d16467 strconv: extend fast parsing algorithm to ParseFloat(s, 32)
benchmark                  old ns/op    new ns/op    delta
BenchmarkAtof32Decimal           215           73  -65.72%
BenchmarkAtof32Float             233           83  -64.21%
BenchmarkAtof32FloatExp         3351          209  -93.76%
BenchmarkAtof32Random           1939          260  -86.59%

R=rsc
CC=golang-dev, remy
https://golang.org/cl/6294071
2012-06-13 23:52:00 +02:00
Robert Griesemer
10b88888f6 math/big: correctly test for positive inputs in Int.GCD
Also: better GCD tests.

R=rsc
CC=golang-dev
https://golang.org/cl/6295076
2012-06-13 13:54:36 -07:00
Russ Cox
1c4e20744a syscall: fix windows copyFindData
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6301076
2012-06-13 16:44:19 -04:00
Robert Griesemer
f5f23e075e go/ast: comment map implementation
A comment map associates comments with AST nodes
and permits correct updating of the AST's comment
list when the AST is manipulated.

R=rsc
CC=golang-dev
https://golang.org/cl/6281044
2012-06-13 13:32:29 -07:00
Russ Cox
503aa6505e go/build: fix boolean negation
!(linux&cgo | darwin&cgo)
= (!linux|!cgo) & (!darwin|!cgo)
= (!linux&!darwin) | !cgo  // new comment
≠ !linux | !darwin | !cgo  // old comment

Fixes #3726.

R=golang-dev, bsiegert
CC=golang-dev
https://golang.org/cl/6306076
2012-06-13 16:24:56 -04:00
Jan Ziak
51fe5444fa runtime: improved continuity in hash computation
Fixes #3695.

R=r, dave, rsc
CC=golang-dev
https://golang.org/cl/6304062
2012-06-13 15:52:32 -04:00
Robert Griesemer
f4240666be math/big: fix binaryGCD
R=rsc
CC=golang-dev
https://golang.org/cl/6297085
2012-06-13 10:29:06 -07:00
Robert Griesemer
b7c5e23df0 math/big: various cleanups
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6295072
2012-06-13 09:37:47 -07:00
Christopher Swenson
38735b957c math/big: Implemented binary GCD algorithm
benchmark                    old ns/op    new ns/op    delta
BenchmarkGCD10x10                 4383         2126  -51.49%
BenchmarkGCD10x100                5612         2124  -62.15%
BenchmarkGCD10x1000               8843         2622  -70.35%
BenchmarkGCD10x10000             17025         6576  -61.37%
BenchmarkGCD10x100000           118985        48130  -59.55%
BenchmarkGCD100x100              45328        11683  -74.23%
BenchmarkGCD100x1000             50141        12678  -74.72%
BenchmarkGCD100x10000           110314        26719  -75.78%
BenchmarkGCD100x100000          630000       156041  -75.23%
BenchmarkGCD1000x1000           654809       137973  -78.93%
BenchmarkGCD1000x10000          985683       159951  -83.77%
BenchmarkGCD1000x100000        4920792       366399  -92.55%
BenchmarkGCD10000x10000       16848950      3732062  -77.85%
BenchmarkGCD10000x100000      55401500      4675876  -91.56%
BenchmarkGCD100000x100000   1126775000    258951800  -77.02%

R=gri, rsc, bradfitz, remyoudompheng, mtj
CC=golang-dev
https://golang.org/cl/6305065
2012-06-13 09:31:20 -07:00
Nigel Tao
66429dcf75 exp/html: simplify some of the parser's internal methods.
benchmark          old ns/op    new ns/op    delta
BenchmarkParser      4006888      3950604   -1.40%

R=r, andybalholm
CC=golang-dev
https://golang.org/cl/6301070
2012-06-13 10:13:05 +10:00
Robert Griesemer
008c62b2cd math/big: optimize common case of Int.Bit(0)
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/6306069
2012-06-12 09:36:35 -07:00
Rob Pike
ea3c3bb3a8 encoding/gob: better handling of nil pointers
- better message for top-level nil
- nil inside interface yields error, not panic

Fixes #3704.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6304064
2012-06-12 00:36:39 -04:00
Rob Pike
2a0fdf6ea0 fmt.Fscanf: don't read past newline
Makes interactive uses work line-by-line.
Fixes #3481.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/6297075
2012-06-11 17:52:09 -04:00
Robert Griesemer
49d6e49087 exp/types: testing resolution of qualified identifiers
Also: fix a bug with exp/types/GcImport.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6302060
2012-06-11 11:06:27 -07:00
Brad Fitzpatrick
1d609f9b9f encoding/gob: fix doc typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6300078
2012-06-09 18:30:44 -07:00
Dave Cheney
0b09425b5c runtime: use uintptr where possible in malloc stats
linux/arm OMAP4 pandaboard

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17   68723297000  37026214000  -46.12%
BenchmarkFannkuch11     34962402000  35958435000   +2.85%
BenchmarkGobDecode        137298600    124182150   -9.55%
BenchmarkGobEncode         60717160     60006700   -1.17%
BenchmarkGzip            5647156000   5550873000   -1.70%
BenchmarkGunzip          1196350000   1198670000   +0.19%
BenchmarkJSONEncode       863012800    782898000   -9.28%
BenchmarkJSONDecode      3312989000   2781800000  -16.03%
BenchmarkMandelbrot200     45727540     45703120   -0.05%
BenchmarkParse             74781800     59990840  -19.78%
BenchmarkRevcomp          140043650    139462300   -0.42%
BenchmarkTemplate        6467682000   5832153000   -9.83%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode             5.59         6.18    1.11x
BenchmarkGobEncode            12.64        12.79    1.01x
BenchmarkGzip                  3.44         3.50    1.02x
BenchmarkGunzip               16.22        16.19    1.00x
BenchmarkJSONEncode            2.25         2.48    1.10x
BenchmarkJSONDecode            0.59         0.70    1.19x
BenchmarkParse                 0.77         0.97    1.26x
BenchmarkRevcomp              18.15        18.23    1.00x
BenchmarkTemplate              0.30         0.33    1.10x

darwin/386 core duo

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17   10591616577   9678245733   -8.62%
BenchmarkFannkuch11     10758473315  10749303846   -0.09%
BenchmarkGobDecode         34379785     34121250   -0.75%
BenchmarkGobEncode         23523721     23475750   -0.20%
BenchmarkGzip            2486191492   2446539568   -1.59%
BenchmarkGunzip           444179328    444250293   +0.02%
BenchmarkJSONEncode       221138507    219757826   -0.62%
BenchmarkJSONDecode      1056034428   1048975133   -0.67%
BenchmarkMandelbrot200     19862516     19868346   +0.03%
BenchmarkRevcomp         3742610872   3724821662   -0.48%
BenchmarkTemplate         960283112    944791517   -1.61%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode            22.33        22.49    1.01x
BenchmarkGobEncode            32.63        32.69    1.00x
BenchmarkGzip                  7.80         7.93    1.02x
BenchmarkGunzip               43.69        43.68    1.00x
BenchmarkJSONEncode            8.77         8.83    1.01x
BenchmarkJSONDecode            1.84         1.85    1.01x
BenchmarkRevcomp              67.91        68.24    1.00x
BenchmarkTemplate              2.02         2.05    1.01x

R=rsc, 0xe2.0x9a.0x9b, mirtchovski
CC=golang-dev, minux.ma
https://golang.org/cl/6297047
2012-06-08 17:35:14 -04:00
Robert Griesemer
014d036d84 math/big: added nat.trailingZeroBits, simplified some code
Will simplify implementation of binaryGCD.

R=rsc, cswenson
CC=golang-dev
https://golang.org/cl/6299064
2012-06-08 13:00:49 -07:00
Russ Cox
7762a9dc1f syscall: unexport GetCurrentProcessId on Windows
This slipped in with the implementation of Getpid in CL 5909043.
I'd exclude that CL entirely but it is tangled up in the Win32finddata changes.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6297065
2012-06-08 14:28:29 -04:00
Russ Cox
56f5e6d845 syscall: fix windows build
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/6303061
2012-06-08 14:04:44 -04:00
Russ Cox
7ad37673e1 syscall: revert API changes in Windows Win32finddata fix.
Preserve old API by using correct struct in system call
and then copying the results, as we did for SetsockoptLinger.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6307065
2012-06-08 13:54:48 -04:00
Russ Cox
50452720ba regexp/syntax: unexport ErrUnexpectedParen
This new error is the only API change in the current draft of
Go 1.0.2 CLs. I'd like to include the CL that introduced it,
because it replaces a mysterious 'internal error' with a
useful error message, but I don't want any API changes,
so unexport the error constant for now. It can be
re-exported for Go 1.1.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6294055
2012-06-08 13:05:01 -04:00
Nigel Tao
6c204982e0 exp/html: check the context node for consistency when parsing fragments.
R=rsc
CC=golang-dev
https://golang.org/cl/6303053
2012-06-08 13:55:15 +10:00
Russ Cox
09b736a2ab encoding/json: fix panic unmarshaling into non-nil interface value
Fixes #3614.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6306051
2012-06-07 01:48:55 -04:00
Nigel Tao
c8fac7b967 exp/html: when parsing, compare atoms (ints) instead of strings.
This is the mechanical part of the 2-part change that started with
https://golang.org/cl/6305053/

R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/6295055
2012-06-07 13:46:57 +10:00
Nigel Tao
cd21eff705 exp/html: make the tokenizer return atoms for tag tokens.
This is part 1 of a 2 part changelist. Part 2 contains the mechanical
change to parse.go to compare atoms (ints) instead of strings.

The overall effect of the two changes are:
benchmark                      old ns/op    new ns/op    delta
BenchmarkParser                  4462274      4058254   -9.05%
BenchmarkRawLevelTokenizer        913202       912917   -0.03%
BenchmarkLowLevelTokenizer       1268626      1267836   -0.06%
BenchmarkHighLevelTokenizer      1947305      1968944   +1.11%

R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/6305053
2012-06-07 13:05:35 +10:00
Alex Brainman
f54d61061c runtime: include "typekind.h" to fix windows build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6305059
2012-06-07 09:37:05 +10:00
Nigel Tao
90fa13d2b7 exp/html/atom: add more atoms.
This completely covers the tags used by exp/html's parser.

Before:
295 atoms; 1406 string bytes + 2048 tables = 3454 total data
BenchmarkLookup    50000         59841 ns/op

After:
322 atoms; 1508 string bytes + 2048 tables = 3556 total data
BenchmarkLookup    50000         60159 ns/op

R=r
CC=golang-dev
https://golang.org/cl/6296045
2012-06-07 09:35:35 +10:00
Fazlul Shahriar
42a76efc92 net: pass tests on Plan 9 again
R=golang-dev
CC=golang-dev
https://golang.org/cl/6280045
2012-06-06 18:38:56 -04:00
Jan Ziak
ede6718cd7 runtime: move type kinds into a separate file
R=rsc
CC=golang-dev
https://golang.org/cl/6285047
2012-06-06 17:20:02 -04:00
Daniel Morsing
c8cbbd31f0 fmt: fix doc typo
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6308046
2012-06-06 16:54:02 -04:00
Markus Sonderegger
3476c23124 crypto/rand: enable rand.Reader on plan9
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6297044
2012-06-06 16:05:47 -04:00
Russ Cox
ee3c272611 fmt: fix inadvertent change to %#v
The reordering speedup in CL 6245068 changed the semantics
of %#v by delaying the clearing of some flags.  Restore the old
semantics and add a test.

Fixes #3706.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6302048
2012-06-06 15:08:00 -04:00
Shenghou Ma
58993e514e net: fix cgoAddrInfoFlags() on FreeBSD
CL 6250075 removed AI_MASK mask on all BSD variants,
        however FreeBSD's AI_MASK does not include AI_V4MAPPED
        and AI_ALL, and its libc is strict about the ai_flags.

        This will fix the FreeBSD builder.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6305054
2012-06-06 22:03:31 +08:00
Joel Sing
2cb7498455 runtime: fix tv_sec handling for netbsd/386
On netbsd/386, tv_sec is a 64-bit integer for both timeval and timespec.
Fix the time handling code so that it works correctly.

R=golang-dev, rsc, m4dh4tt3r
CC=golang-dev
https://golang.org/cl/6256056
2012-06-06 20:39:27 +10:00
Russ Cox
3a66bc415e runtime: use OS X vsyscall for gettimeofday (amd64)
Thanks to Dave Cheney for the magic words "comm page".

benchmark       old ns/op    new ns/op    delta
BenchmarkNow          197           33  -83.05%

This should make profiling a little better on OS X.
The raw time saved is unlikely to matter: what likely matters
more is that it seems like OS X sends profiling signals on the
way out of system calls more often than it should; avoiding
the system call should increase the accuracy of cpu profiles.

The 386 version would be similar but needs to do different
math for CPU speeds less than 1 GHz. (Apparently Apple has
never shipped a 64-bit CPU with such a slow clock.)

R=golang-dev, bradfitz, dave, minux.ma, r
CC=golang-dev
https://golang.org/cl/6275056
2012-06-05 16:24:37 -04:00
Russ Cox
c7be4defe3 runtime: use OS X vsyscall for gettimeofday (386)
amd64 was done in CL 6275056.

We don't attempt to handle machines with clock speeds
less than 1 GHz. Those will fall back to the system call.

benchmark       old ns/op    new ns/op    delta
BenchmarkNow          364           38  -89.53%

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6307045
2012-06-05 16:23:30 -04:00
Dave Cheney
09f48db3e1 runtime: use uintptr for block length in scanblock
Using an int64 for a block size doesn't make
sense on 32bit platforms but extracts a performance
penalty dealing with double word quantities on Arm.

linux/arm

benchmark                 old ns/op    new ns/op    delta
BenchmarkGobDecode        155401600    144589300   -6.96%
BenchmarkGobEncode         72772220     62460940  -14.17%
BenchmarkGzip               5822632      2604797  -55.26%
BenchmarkGunzip              326321       151721  -53.51%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode             4.94         5.31    1.07x
BenchmarkGobEncode            10.55        12.29    1.16x

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6272047
2012-06-05 18:55:14 +10:00
Rob Pike
2176869e4e net/http/httputil: fix typo in comment.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6272050
2012-06-04 18:37:31 -07:00
Russ Cox
dcc46388df time: accept .999 in Parse
The recent shuffle in parsing formats exposed probably unintentional
behavior in time.Parse, namely that it was mostly ignoring ".99999"
in the format, producing the following behavior:

fmt.Println(time.Parse("03:04:05.999 MST", "12:00:00.888 PDT")) // error (.888 unexpected)
fmt.Println(time.Parse("03:04:05.999", "12:00:00")) // error (input too short)
fmt.Println(time.Parse("03:04:05.999 MST", "12:00:00 PDT"))  // ok (extra bytes on input make it ok)

http://play.golang.org/p/ESJ1UYXzq2

API CHANGE:

This CL makes all three examples valid: ".999" can match an
empty string or else a fractional second with at most nine digits.

Fixes #3701.

R=r, r
CC=golang-dev
https://golang.org/cl/6267045
2012-06-04 13:09:19 -04:00
Robert Griesemer
cc1890cbe3 math/big: improved karatsuba calibration code, better mul benchmark
An attempt to profit from CL 6176043 (fix to superpolinomial
runtime of karatsuba multiplication) and determine a better
karatsuba threshold. The result indicates that 32 is still
a reasonable value. Left the threshold as is (== 32), but
made some minor changes to the calibrate code which are
worthwhile saving (use of existing benchmarking code for
better results, better use of package time).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6260062
2012-06-04 09:48:27 -07:00
Marcel van Lohuizen
de0c1c9cf5 exp/locale/collate: somehow an incorrect version of tables was checked in earlier.
Regenerated tables using maketables.

R=r, rsc
CC=golang-dev
https://golang.org/cl/6248067
2012-06-04 18:35:26 +02:00
Joel Sing
622ace8ffe net: fix botched cgo netbsd merge
Fix botched cgo_netbsd.go merge and remove redundant +build directive.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6282048
2012-06-05 02:12:23 +10:00
Joel Sing
5131deeeb2 cgo: enable cgo on netbsd/386 and netbsd/amd64
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6261056
2012-06-05 01:43:04 +10:00
Benny Siegert
677cdb800d syscall: use pipe instead of pipe2 on NetBSD
pipe2 is equivalent to pipe with flags set to 0.
However, pipe2 was only added recently. Using pipe
instead improves compatibility with NetBSD 5.

R=jsing
CC=golang-dev
https://golang.org/cl/6268045
2012-06-05 01:29:34 +10:00
Brad Fitzpatrick
afeaf554aa net/http: add new Server benchmark
The new BenchmarkServer avoids profiling the client code
by running it in a child process.

R=rsc
CC=golang-dev
https://golang.org/cl/6260053
2012-06-04 08:04:40 -07:00
Brad Fitzpatrick
6e3d87f315 net/textproto: add benchmark, cleanup, update comment
The cleanup also makes it ~5% faster, but that's
not the point of this CL.

Optimizations can come in future CLs.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6286043
2012-06-04 07:18:06 -07:00
Brad Fitzpatrick
6b31508e3d net/http: simplify ParseHTTPVersion
Removes code. No need for atoi helper.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6285045
2012-06-04 07:06:05 -07:00
Brad Fitzpatrick
290115fdf4 net/http: change a Del to delete
No need to fix case of "Host" string literal.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6278049
2012-06-03 22:40:16 -07:00
Mikio Hara
24075d33a5 path/filepath: fix test
Make it possible to run test over symlinked GOROOT.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6268046
2012-06-04 09:57:03 +09:00
Russ Cox
a76c8b2430 time: make Format 2.7x faster
benchmark             old ns/op    new ns/op    delta
BenchmarkFormat            2495          937  -62.44%
BenchmarkFormatNow         2308          889  -61.48%

Update #3679.

R=r
CC=golang-dev
https://golang.org/cl/6278047
2012-06-03 11:08:17 -04:00
Joel Sing
eb4138f481 net: move cgo address info flags to per-platform files
Move address info flags to per-platform files. This is needed to
enable cgo on NetBSD (and later OpenBSD), as some of the currently
used AI_* defines do not exist on these platforms.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6250075
2012-06-03 23:54:14 +10:00
Alex Brainman
8801402940 syscall: correct Win32finddata definition
Fixes #3685.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6261053
2012-06-03 19:27:17 +10:00
Luuk van Dijk
40af78c19e cmd/gc: inline slice[arr,str] in the frontend (mostly).
R=rsc, ality, rogpeppe, minux.ma, dave
CC=golang-dev
https://golang.org/cl/5966075
2012-06-02 22:50:57 -04:00
Russ Cox
192550592a exp/html/atom: faster Lookup with smaller tables
Use perfect cuckoo hash, to avoid binary search.
Define Atom bits as offset+len in long string instead
of enumeration, to avoid string headers.

Before: 1909 string bytes + 6060 tables = 7969 total data
After: 1406 string bytes + 2048 tables = 3454 total data

benchmark          old ns/op    new ns/op    delta
BenchmarkLookup        83878        64681  -22.89%

R=nigeltao, r
CC=golang-dev
https://golang.org/cl/6262051
2012-06-02 22:43:11 -04:00
Shenghou Ma
911f802b37 syscall: fix 32-bit uid calls
16-bit uid calls are not always supported in newer kernels.

R=dave, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6279047
2012-06-03 06:49:57 +08:00
Shenghou Ma
e8265f18e6 runtime: remove unnecessary macros in vlop_arm.s
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6270045
2012-06-03 04:03:09 +08:00
Shenghou Ma
d186d07eda cmd/5a, cmd/5l, math: add CLZ instruction for ARM
Supported in ARMv5 and above.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6284043
2012-06-03 03:08:49 +08:00
Jan Ziak
65e61d5770 runtime: add (unused for now) gc field to type information
R=rsc
CC=golang-dev
https://golang.org/cl/6255074
2012-06-02 14:02:44 -04:00
Charles L. Dorian
322057cbfc math: amd64 versions of Ceil, Floor and Trunc
Ceil  to 4.81 from 20.6 ns/op
Floor to 4.37 from 13.5 ns/op
Trunc to 3.97 from 14.3 ns/op
Also changed three MOVSDs to MOVAPDs in log_amd64.s

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/6262048
2012-06-02 13:06:12 -04:00
Jan Mercl
2b57a87678 path/filepath: implement documented SkipDir behavior
Currently walk() doesn't check for err == SkipDir when iterating
a directory list, but such promise is made in the docs for WalkFunc.

Fixes #3486.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6257059
2012-06-02 13:00:09 -04:00
Rob Pike
0e45890c8b text/template/parse: restore the goroutine
To avoid goroutines during init, the nextItem function was a
clever workaround. Now that init goroutines are permitted,
restore the original, simpler design.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6282043
2012-06-01 18:34:14 -07:00
Robert Griesemer
a04d4f02a4 go/parser: ~15% faster parsing
- only compute current line position if needed
  (i.e., if a comment is present)

- added benchmark

benchmark         old ns/op    new ns/op    delta
BenchmarkParse     10902990      9313330  -14.58%

benchmark          old MB/s     new MB/s  speedup
BenchmarkParse         5.31         6.22    1.17x

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6270043
2012-06-01 16:27:49 -07:00
Nigel Tao
d2a6098e9c exp/html/atom: faster, hash-based lookup.
exp/html/atom benchmark:
benchmark          old ns/op    new ns/op    delta
BenchmarkLookup       199226        80770  -59.46%

exp/html benchmark:
benchmark                      old ns/op    new ns/op    delta
BenchmarkParser                  4864890      4510834   -7.28%
BenchmarkHighLevelTokenizer      2209192      1969684  -10.84%
benchmark                       old MB/s     new MB/s  speedup
BenchmarkParser                    16.07        17.33    1.08x
BenchmarkHighLevelTokenizer        35.38        39.68    1.12x

R=r
CC=golang-dev
https://golang.org/cl/6261054
2012-06-01 09:36:05 +10:00
Rémy Oudompheng
baf91c313f runtime: lower memory overhead of heap profiling.
The previous code was preparing arrays of entries that would be
filled if there was one entry every 128 bytes. Moving to a 4096
byte interval reduces the overhead per megabyte of address space
to 2kB from 64kB (on 64-bit systems).
The performance impact will be negative for very small MemProfileRate.

test/bench/garbage/tree2 -heapsize 800000000 (default memprofilerate)
Before: mprof 65993056 bytes (1664 bucketmem + 65991392 addrmem)
After:  mprof  1989984 bytes (1680 bucketmem +  1988304 addrmem)

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6257069
2012-05-31 23:30:55 +02:00
Rémy Oudompheng
c4a814f2da runtime/pprof, misc/pprof: correct profile of total allocations.
The previous heap profile format did not include buckets with
zero used bytes. Also add several missing MemStats fields in
debug mode.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6249068
2012-05-31 07:57:49 +02:00
Nigel Tao
bb4a817a92 exp/html/atom: new package.
50% fewer mallocs in HTML tokenization, resulting in 25% fewer mallocs
in parsing go1.html.

Making the parser use integer comparisons instead of string comparisons
will be a follow-up CL, to be co-ordinated with Andy Balholm's work.

exp/html benchmarks before/after:

BenchmarkParser	     500	   4754294 ns/op	  16.44 MB/s
        parse_test.go:409: 500 iterations, 14651 mallocs per iteration
BenchmarkRawLevelTokenizer	    2000	    903481 ns/op	  86.51 MB/s
        token_test.go:678: 2000 iterations, 28 mallocs per iteration
BenchmarkLowLevelTokenizer	    2000	   1260485 ns/op	  62.01 MB/s
        token_test.go:678: 2000 iterations, 41 mallocs per iteration
BenchmarkHighLevelTokenizer	    1000	   2165964 ns/op	  36.09 MB/s
        token_test.go:678: 1000 iterations, 6616 mallocs per iteration

BenchmarkParser	     500	   4664912 ns/op	  16.76 MB/s
        parse_test.go:409: 500 iterations, 11266 mallocs per iteration
BenchmarkRawLevelTokenizer	    2000	    903065 ns/op	  86.55 MB/s
        token_test.go:678: 2000 iterations, 28 mallocs per iteration
BenchmarkLowLevelTokenizer	    2000	   1260032 ns/op	  62.03 MB/s
        token_test.go:678: 2000 iterations, 41 mallocs per iteration
BenchmarkHighLevelTokenizer	    1000	   2143356 ns/op	  36.47 MB/s
        token_test.go:678: 1000 iterations, 3231 mallocs per iteration

R=r, rsc, rogpeppe
CC=andybalholm, golang-dev
https://golang.org/cl/6255062
2012-05-31 15:37:18 +10:00
Rob Pike
43cf5505fc regexp: fix a couple of bugs in the documentation
Byte slices are not strings.

Fixes #3687.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6257074
2012-05-30 21:57:50 -07:00
Mikio Hara
aad8e95474 net: fix test to avoid unintentional nil pointer dereference
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6248065
2012-05-31 06:12:24 +09:00
Ivan Krasin
37f046bac6 compress/flate: fix overflow on 2GB input. Reset hashOffset every 16 MB.
This bug has been introduced in the following revision:

changeset:   11404:26dceba5c610
user:        Ivan Krasin <krasin@golang.org>
date:        Mon Jan 23 09:19:39 2012 -0500
summary:     compress/flate: reduce memory pressure at cost of additional arithmetic operation.

This is the review page for that CL: https://golang.org/cl/5555070/

R=rsc, imkrasin
CC=golang-dev
https://golang.org/cl/6249067
2012-05-30 16:08:38 -04:00
Joel Sing
deb93b0f7b runtime: always initialise procid on netbsd
The correct procid is needed for unparking LWPs on NetBSD - always
initialise procid in minit() so that cgo works correctly. The non-cgo
case already works correctly since procid is initialised via
lwp_create().

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6257071
2012-05-31 03:27:04 +10:00
Jan Ziak
334bf95f9e runtime: update field types in preparation for GC changes
R=rsc, remyoudompheng, minux.ma, ality
CC=golang-dev
https://golang.org/cl/6242061
2012-05-30 13:07:52 -04:00
Jan Ziak
46d7d5fcf5 runtime: hide symbol table from garbage collector
R=rsc
CC=golang-dev
https://golang.org/cl/6243059
2012-05-30 13:04:48 -04:00
Marcel van Lohuizen
c633f85f65 exp/locale/collate: avoid double building in maketables.go. Also added check.
R=r
CC=golang-dev
https://golang.org/cl/6202063
2012-05-30 17:47:56 +02:00
Nigel Tao
dbcdce5866 image/png: optimize paeth some more.
filterPaeth takes []byte arguments instead of byte arguments,
which avoids some redudant computation of the previous pixel
in the inner loop.

Also eliminate a bounds check in decoding the up filter.

benchmark                       old ns/op    new ns/op    delta
BenchmarkDecodeGray               3139636      2812531  -10.42%
BenchmarkDecodeNRGBAGradient     12341520     10971680  -11.10%
BenchmarkDecodeNRGBAOpaque       10740780      9612455  -10.51%
BenchmarkDecodePaletted           1819535      1818913   -0.03%
BenchmarkDecodeRGB                8974695      8178070   -8.88%

R=rsc
CC=golang-dev
https://golang.org/cl/6243061
2012-05-30 21:38:46 +10:00
Alex Brainman
994cdcea18 runtime: disable new TestCrashHandle on freebsd to fix build
R=golang-dev
CC=golang-dev
https://golang.org/cl/6256069
2012-05-30 16:41:15 +10:00
Rémy Oudompheng
348087877c runtime: do not unset the special bit after finalization.
A block with finalizer might also be profiled. The special bit
is needed to unregister the block from the profile. It will be
unset only when the block is freed.

Fixes #3668.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6249066
2012-05-30 08:04:11 +02:00
Andrew Balholm
4e0749a478 exp/html: Convert \r and \r\n to \n when tokenizing
Also escape "\r" as "&#13;" when rendering HTML.

Pass 2 additional tests.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6260046
2012-05-30 15:50:12 +10:00
Alex Brainman
afe0e97aa6 runtime: handle windows exceptions, even in cgo programs
Fixes #3543.

R=golang-dev, kardianos, rsc
CC=golang-dev, hectorchu, vcc.163
https://golang.org/cl/6245063
2012-05-30 15:10:54 +10:00
Nigel Tao
034fa90dc1 exp/html: add some tokenizer and parser benchmarks.
$GOROOT/src/pkg/exp/html/testdata/go1.html is an execution of the
$GOROOT/doc/go1.html template by godoc.

Sample numbers on my linux,amd64 desktop:
BenchmarkParser	     500	   4699198 ns/op	  16.63 MB/s
--- BENCH: BenchmarkParser
        parse_test.go:409: 1 iterations, 14653 mallocs per iteration
        parse_test.go:409: 100 iterations, 14651 mallocs per iteration
        parse_test.go:409: 500 iterations, 14651 mallocs per iteration
BenchmarkRawLevelTokenizer	    2000	    904957 ns/op	  86.37 MB/s
--- BENCH: BenchmarkRawLevelTokenizer
        token_test.go:657: 1 iterations, 28 mallocs per iteration
        token_test.go:657: 100 iterations, 28 mallocs per iteration
        token_test.go:657: 2000 iterations, 28 mallocs per iteration
BenchmarkLowLevelTokenizer	    2000	   1134300 ns/op	  68.91 MB/s
--- BENCH: BenchmarkLowLevelTokenizer
        token_test.go:657: 1 iterations, 41 mallocs per iteration
        token_test.go:657: 100 iterations, 41 mallocs per iteration
        token_test.go:657: 2000 iterations, 41 mallocs per iteration
BenchmarkHighLevelTokenizer	    1000	   2096179 ns/op	  37.29 MB/s
--- BENCH: BenchmarkHighLevelTokenizer
        token_test.go:657: 1 iterations, 6616 mallocs per iteration
        token_test.go:657: 100 iterations, 6616 mallocs per iteration
        token_test.go:657: 1000 iterations, 6616 mallocs per iteration

R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/6257067
2012-05-30 13:00:32 +10:00
Brad Fitzpatrick
397b687324 net: skip UnixShutdown test on windows
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6259052
2012-05-29 15:46:07 -07:00
Rémy Oudompheng
0ce90459e8 net: add CloseRead, CloseWrite methods to UnixConn.
Fixes #3345.

R=golang-dev, r, rsc, dave
CC=golang-dev, remy
https://golang.org/cl/6214061
2012-05-30 00:08:58 +02:00
Rob Pike
53bc19442d fmt: speed up 10-20%
The check for Stringer etc. can only fire if the test is not a builtin, so avoid
the expensive check if we know there's no chance.
Also put in a fast path for pad, which saves a more modest amount.

benchmark                      old ns/op    new ns/op    delta
BenchmarkSprintfEmpty                148          152   +2.70%
BenchmarkSprintfString               585          497  -15.04%
BenchmarkSprintfInt                  441          396  -10.20%
BenchmarkSprintfIntInt               718          603  -16.02%
BenchmarkSprintfPrefixedInt          676          621   -8.14%
BenchmarkSprintfFloat               1003          953   -4.99%
BenchmarkManyArgs                   2945         2312  -21.49%
BenchmarkScanInts                1704152      1734441   +1.78%
BenchmarkScanRecursiveInt        1837397      1828920   -0.46%

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6245068
2012-05-29 15:08:08 -07:00
Russ Cox
d61707f490 encoding/json: add round trip test in Unmarshal
Also convert table to use tagged literal.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6258061
2012-05-29 18:02:40 -04:00
Brad Fitzpatrick
253d7f0460 net/http: better comment in hasToken
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6249065
2012-05-29 14:27:07 -07:00
Robert Griesemer
bd7c626348 exp/types: properly read dotted identifiers
Fixes #3682.

R=rsc
CC=golang-dev
https://golang.org/cl/6256067
2012-05-29 13:15:13 -07:00
Brad Fitzpatrick
12b2022a3b net/http: flush server response gracefully when ignoring request body
This prevents clients from seeing RSTs and missing the response
body.

TCP stacks vary. The included test failed on Darwin before but
passed on Linux.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6256066
2012-05-29 12:40:13 -07:00
Russ Cox
c1b53d43e8 merge unexpected branch 2012-05-29 14:37:41 -04:00
Dmitriy Vyukov
a0efca84e6 time: fix deadlock in Sleep(0)
See time/sleep_test.go for repro.

R=golang-dev, r, rsc
CC=golang-dev, patrick.allen.higgins
https://golang.org/cl/6250072
2012-05-29 22:30:56 +04:00
Brad Fitzpatrick
93fe8c0c93 database/sql: use driver.ColumnConverter everywhere consistently
It was only being used for (*Stmt).Exec, not Query, and not for
the same two methods on *DB.

This unifies (*Stmt).Exec's old inline code into the old
subsetArgs function, renaming it in the process (changing the
old word "subset" to "driver", mostly converted earlier)

Fixes #3640

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6258045
2012-05-29 11:09:09 -07:00
Russ Cox
6dbaa206fb runtime: replace runtime·rnd function with ROUND macro
It's sad to introduce a new macro, but rnd shows up consistently
in profiles, and the function call overwhelms the two arithmetic
instructions it performs.

R=r
CC=golang-dev
https://golang.org/cl/6260051
2012-05-29 14:02:29 -04:00
Russ Cox
95ae5c180e exp/types: disable test
It's broken and seems to be exp/types's fault.

Update #3682.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6243068
2012-05-29 13:33:37 -04:00
Joel Sing
fb32d60cd1 runtime: make go work on netbsd/386
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6254055
2012-05-30 02:52:50 +10:00
Mikio Hara
8c8ab0552c net: fix comment on FileListener
R=rsc
CC=golang-dev
https://golang.org/cl/6242067
2012-05-30 01:52:50 +09:00
Russ Cox
992a11b88b crypto: housekeeping
Rename _Block to block, don't bother making it compute count.
Add benchmarks.

R=agl, agl
CC=golang-dev
https://golang.org/cl/6243053
2012-05-29 12:45:40 -04:00
Mikio Hara
14ad411407 undo CL 6248054 / 0f418a63cdf9
breaks public API document style

««« original CL description
net: fix comment on FileListener

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

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6242066
2012-05-30 01:42:36 +09:00
Andrew Balholm
9c14184e25 exp/html: implement Noah's Ark clause
Implement the (3-per-family) Noah's Ark clause (i.e. don't put
more than three identical elements on the list of active formatting
elements.

Also, when running tests, sort attributes by name before dumping
them.

Pass 4 additional tests with Noah's Ark clause (including one
that needs attributes to be sorted).

Pass 5 additional, unrelated tests because of sorting attributes.

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/6247056
2012-05-29 13:39:54 +10:00
Mikio Hara
7db8c779fe net: fix comment on FileListener
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6248054
2012-05-29 06:13:56 +09:00
Mikio Hara
ac486ab15c net: make parsePort as a function
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6256059
2012-05-29 06:12:06 +09:00
Brad Fitzpatrick
0605c0c656 net/http: avoid fmt.Fprintf in Header.WriteSubset
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/6242062
2012-05-28 11:26:45 -07:00
Brad Fitzpatrick
1e814df79b net/http: avoid a bunch of unnecessary CanonicalHeaderKey calls
CanonicalHeaderKey didn't allocate, but it did use unnecessary
CPU in the hot path, deciding it didn't need to allocate.

I considered using constants for all these common header keys
but I didn't think it would be prettier. "Content-Length" looks
better than contentLength or hdrContentLength, etc.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6255053
2012-05-28 11:07:24 -07:00
Brad Fitzpatrick
c238031b2d net/http: speed up ServeMux when no patterns contain hostnames
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6248053
2012-05-28 10:58:49 -07:00
Brad Fitzpatrick
469e3a91d4 net/http: correct and faster hasToken
Fixes #3535

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6245060
2012-05-28 10:55:39 -07:00
Alexey Borzenkov
cb62365f57 net/http: reuse http proxy connections for different http requests
Comment on cache keys above connectMethod says "http to proxy, http
anywhere after that", however in reality target address was always
included, which prevented http requests to different target
addresses to reuse the same http proxy connection.

R=golang-dev, r, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5901064
2012-05-28 10:46:51 -07:00
Alex Brainman
042848da65 syscall: simplify text returned by Errno.Error() when FormatMessage fails
Fixes #3623.

R=golang-dev, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/6218072
2012-05-27 18:57:16 +10:00
Alexey Borzenkov
dcc80e4553 net/rpc: improve response reading logic
CL 5956051 introduced too many call != nil checks, so
attempt to improve this by splitting logic into three
distinct parts.

R=r
CC=golang-dev
https://golang.org/cl/6248048
2012-05-26 14:27:36 -07:00
Nigel Tao
1423ecb126 image/png: optimize the paeth filter implementation.
image/png benchmarks:
benchmark                       old ns/op    new ns/op    delta
BenchmarkPaeth                         10            7  -29.21%
BenchmarkDecodeGray               2381745      2241620   -5.88%
BenchmarkDecodeNRGBAGradient      9535555      8835100   -7.35%
BenchmarkDecodeNRGBAOpaque        8189590      7611865   -7.05%
BenchmarkDecodePaletted           1300688      1301940   +0.10%
BenchmarkDecodeRGB                6760146      6317082   -6.55%
BenchmarkEncodePaletted           6048596      6122666   +1.22%
BenchmarkEncodeRGBOpaque         18891140     19474230   +3.09%
BenchmarkEncodeRGBA              78945350     78552600   -0.50%

Wall time for Denis Cheremisov's PNG-decoding program given in
https://groups.google.com/group/golang-nuts/browse_thread/thread/22aa8a05040fdd49
Before: 2.25s
After:  2.27s
Delta:  +1%

The same program, but with a different PNG input file
(http://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png)
and only 100 iterations instead of 1000
Before: 4.78s
After:  4.42s
Delta:  -8%

R=rsc
CC=golang-dev
https://golang.org/cl/6242056
2012-05-25 14:08:51 +10:00
Russ Cox
bf18d57d4a runtime: handle and test large map values
This is from CL 5451105 but was dropped from that CL.
See also CL 6137051.

The only change compared to 5451105 is to check for
h != nil in reflect·mapiterinit; allowing use of nil maps
must have happened after that original CL.

Fixes #3573.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6215078
2012-05-24 22:41:07 -04:00
Andrew Balholm
c23041efd9 exp/html: adjust parseForeignContent to match spec
Remove redundant checks for integration points.

Ignore null bytes in text.

Don't break out of foreign content for a <font> tag unless it
has a color, face, or size attribute.

Check for MathML text integration points when breaking out of
foreign content.

Pass two new tests.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6256045
2012-05-25 10:03:59 +10:00
Nigel Tao
60ffae25bc hash/adler32: optimize.
The bulk of the gains come from hoisting the modulo ops outside of
the inner loop.

Reducing the digest type from 8 bytes to 4 bytes gains another 1% on
the hash/adler32 micro-benchmark.

Benchmarks for $GOOS,$GOARCH = linux,amd64 below.

hash/adler32 benchmark:
benchmark             old ns/op    new ns/op    delta
BenchmarkAdler32KB         1660         1364  -17.83%

image/png benchmark:
benchmark                       old ns/op    new ns/op    delta
BenchmarkDecodeGray               2466909      2425539   -1.68%
BenchmarkDecodeNRGBAGradient      9884500      9751705   -1.34%
BenchmarkDecodeNRGBAOpaque        8511615      8379800   -1.55%
BenchmarkDecodePaletted           1366683      1330677   -2.63%
BenchmarkDecodeRGB                6987496      6884974   -1.47%
BenchmarkEncodePaletted           6292408      6040052   -4.01%
BenchmarkEncodeRGBOpaque         19780680     19178440   -3.04%
BenchmarkEncodeRGBA              80738600     79076800   -2.06%

Wall time for Denis Cheremisov's PNG-decoding program given in
https://groups.google.com/group/golang-nuts/browse_thread/thread/22aa8a05040fdd49
Before: 2.44s
After:  2.26s
Delta:  -7%

R=rsc
CC=golang-dev
https://golang.org/cl/6251044
2012-05-25 09:58:38 +10:00
Robert Griesemer
184209787c strconv: better documentation for FormatInt, FormatUint.
Fixes #3580.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6252047
2012-05-24 16:24:39 -07:00
Bill Thiede
132dbb61aa net/mail: more liberal parsing of Date headers.
Fixes #3639.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6243045
2012-05-25 09:19:21 +10:00
Alexey Borzenkov
161f50574a net/rpc: fix race condition when request write partially fails
When client fails to write a request is sends caller that error,
however server might have failed to read that request in the mean
time and replied with that error. When client then reads the
response the call would no longer be pending, so call will be nil

Handle this gracefully by discarding such server responses

R=golang-dev, r
CC=golang-dev, rsc
https://golang.org/cl/5956051
2012-05-24 16:07:08 -07:00
Brad Fitzpatrick
68f42ea27e archive/tar: fix windows test failure
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6249052
2012-05-24 14:32:18 -07:00
Rob Pike
11c1b1f96b runtime: fix docs for Caller and Callers
The previous attempt to explain this got it backwards (all the more reason to be
sad we couldn't make the two functions behave the same).

Fixes #3669.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6249051
2012-05-24 14:15:43 -07:00
Brad Fitzpatrick
2b98401a83 archive/tar: add FileInfoHeader function
Fixes #3295

R=adg, rsc, mike.rosset
CC=golang-dev
https://golang.org/cl/5796073
2012-05-24 14:10:54 -07:00
Russ Cox
ce69666273 exp/locale/collate: avoid 16-bit math
There's no need for the 16-bit arithmetic here,
and it tickles a long-standing compiler bug.
Fix the exp code not to use 16-bit math and
create an explicit test for the compiler bug.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6256048
2012-05-24 14:50:36 -04:00
Robert Griesemer
07612b8db0 math/big: make Rat.Denom() always return a reference
The documentation says so, but in the case of a normalized
integral Rat, the denominator was a new value. Changed the
internal representation to use an Int to represent the
denominator (with the sign ignored), so a reference to it
can always be returned.

Clarified documentation and added test cases.

Fixes #3521.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6237045
2012-05-24 10:49:38 -07:00
Dmitriy Vyukov
b0702bd0db runtime: faster GC mark phase
Also bump MaxGcproc to 8.

benchmark             old ns/op    new ns/op    delta
Parser               3796323000   3763880000   -0.85%
Parser-2             3591752500   3518560250   -2.04%
Parser-4             3423825250   3334955250   -2.60%
Parser-8             3304585500   3267014750   -1.14%
Parser-16            3313615750   3286160500   -0.83%

Tree                  984128500    942501166   -4.23%
Tree-2                932564444    883266222   -5.29%
Tree-4                835831000    799912777   -4.30%
Tree-8                819238500    789717333   -3.73%
Tree-16               880837833    837840055   -5.13%

Tree2                 604698100    579716900   -4.13%
Tree2-2               372414500    356765200   -4.20%
Tree2-4               187488100    177455900   -5.56%
Tree2-8               136315300    102086700  -25.11%
Tree2-16               93725900     76705800  -22.18%

ParserPause           157441210    166202783   +5.56%
ParserPause-2          93842650     85199900   -9.21%
ParserPause-4          56844404     53535684   -5.82%
ParserPause-8          35739446     30767613  -16.15%
ParserPause-16         32718255     27212441  -16.83%

TreePause              29610557     29787725   +0.60%
TreePause-2            24001659     20674421  -13.86%
TreePause-4            15114887     12842781  -15.03%
TreePause-8            13128725     10741747  -22.22%
TreePause-16           16131360     12506901  -22.47%

Tree2Pause           2673350920   2651045280   -0.83%
Tree2Pause-2         1796999200   1709350040   -4.88%
Tree2Pause-4         1163553320   1090706480   -6.67%
Tree2Pause-8          987032520    858916360  -25.11%
Tree2Pause-16         864758560    809567480   -6.81%

ParserLastPause       280537000    289047000   +3.03%
ParserLastPause-2     183030000    166748000   -8.90%
ParserLastPause-4     105817000     91552000  -13.48%
ParserLastPause-8      65127000     53288000  -18.18%
ParserLastPause-16     45258000     38334000  -15.30%

TreeLastPause          45072000     51449000  +12.39%
TreeLastPause-2        39269000     37866000   -3.57%
TreeLastPause-4        23564000     20649000  -12.37%
TreeLastPause-8        20881000     15807000  -24.30%
TreeLastPause-16       23297000     17309000  -25.70%

Tree2LastPause       6046912000   5797120000   -4.13%
Tree2LastPause-2     3724034000   3567592000   -4.20%
Tree2LastPause-4     1874831000   1774524000   -5.65%
Tree2LastPause-8     1363108000   1020809000  -12.79%
Tree2LastPause-16     937208000    767019000  -22.18%

R=rsc, 0xe2.0x9a.0x9b
CC=golang-dev
https://golang.org/cl/6223050
2012-05-24 10:55:50 +04:00
Andrew Balholm
82e2272566 exp/html: detect "integration points" in SVG and MathML content
Detect HTML integration points and MathML text integration points.
At these points, process tokens as HTML, not as foreign content.

Pass 33 more tests.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6249044
2012-05-24 13:46:41 +10:00
David Symonds
04f3cf0faa flag: include flag name in redefinition panic.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/6250043
2012-05-24 13:42:02 +10:00
Joel Sing
5a043de746 runtime: make go work on netbsd/amd64
R=golang-dev, rsc, devon.odell
CC=golang-dev
https://golang.org/cl/6222044
2012-05-24 11:33:11 +10:00
Andrew Balholm
e947eba291 exp/html: update test data
Import updated test data from the WebKit Subversion repository (SVN revision 118111).

Some of the old tests were failing because we were HTML5 compliant, but the tests weren't.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6228049
2012-05-24 10:35:31 +10:00
Brad Fitzpatrick
83771afe10 encoding/json: documentation fix
Fixes #3650

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6238046
2012-05-23 17:18:05 -07:00
Robert Griesemer
1f46cb0ba2 go/parser: resolve all parameter types
Fixes #3655.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6213065
2012-05-23 16:12:45 -07:00
Brad Fitzpatrick
e4ed9494e5 net/http: fix response Connection: close, close client connections
Fixes #3663
Updates #3540 (fixes it more)
Updates #1967 (fixes it more, re-enables a test)

R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/6213064
2012-05-23 11:19:38 -07:00
Robert Griesemer
7482822bba go/parser: minor cleanup
- there is no label scope at package level
- open/close all scopes symmetrically now
  that there is only one parse entry point
  (parseFile)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6230047
2012-05-23 09:37:48 -07:00
Brad Fitzpatrick
eacc3cc8a1 net/http: clarify ErrBodyNotAllowed error message
It's usually due to writing on HEAD requests.

R=golang-dev, rsc, r, r
CC=golang-dev
https://golang.org/cl/6206106
2012-05-23 09:31:24 -07:00
Alex Brainman
50e5951374 syscall: implement SetsockoptLinger for windows
R=rsc
CC=golang-dev
https://golang.org/cl/6225048
2012-05-23 13:05:05 +10:00
Andrew Balholm
33a89b5fda exp/html: adjust the last few insertion modes to match the spec
Handle text, comment, and doctype tokens in afterBodyIM, afterAfterBodyIM,
and afterAfterFramesetIM.

Pass three more tests.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6231043
2012-05-23 11:11:34 +10:00
Robert Griesemer
13a59b8c6d math/big: implement JSON un/marshaling support for Ints
Also: simplified some existing tests.

No support for Rats for now because the precision-preserving
default notation (fractions of the form a/b) is not a valid
JSON value.

Fixes #3657.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6211079
2012-05-22 17:20:37 -07:00
Ugorji Nwoke
4f7c33cd5a text/template: exec should accept interface value as valid.
Currently, if you pass some data to a template as an interface (e.g. interface{})
and extract that value that value as a parameter for a function, it fails, saying
wrong type.

This is because it is only looking at the interface type, not the interface content.

This CL uses the underlying content as the parameter to the func.

Fixes #3642.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/6218052
2012-05-22 15:21:35 -07:00
Shenghou Ma
090f9fc3ef sync/atomic: use cas64 to implement {Load,Store,Add}{Uint,Int}64 on Linux/ARM
Now with GOARM=5 our all.bash should pass on ARMv5 systems.
        Fixes #3331.

R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/6210071
2012-05-23 02:02:01 +08:00
Shenghou Ma
fb3a1b6821 runtime: support conditional execution in ARM softfloat
Fixes #3638.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6213057
2012-05-23 02:00:40 +08:00
Russ Cox
3d03ec8896 undo CL 6112054 / 2eec2501961c
Now that we've fixed the Expect: test, this CL should be okay.

««« original CL description
net/http: revert 97d027b3aa68

Revert the following change set:

        changeset:   13018:97d027b3aa68
        user:        Gustavo Niemeyer <gustavo@niemeyer.net>
        date:        Mon Apr 23 22:00:16 2012 -0300
        summary:     net/http: allow clients to disable keep-alive

This broke a test on Windows 64 and somebody else
will have to check.

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

Fixes #3540.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6228046
2012-05-22 13:56:40 -04:00
Russ Cox
77f00e5e5a unicode: fix comment about variable types
In both the web and command line tool,
the comment is shown after the declaration.
But in the code the comment is obviously before.
Make the text not refer to a specific order.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/6206094
2012-05-22 13:53:57 -04:00
Jan Ziak
fbaf59bf1e cmd/gc: export constants in hexadecimal
R=golang-dev, r, rsc, iant, remyoudompheng, dave
CC=golang-dev
https://golang.org/cl/6206077
2012-05-22 13:53:38 -04:00
Russ Cox
15436da232 crypto/md5: faster inner loop, 3x faster overall
The speedup is a combination of unrolling/specializing
the actual code and also making the compiler generate better code.

Go 1.0.1 (size: 1239 code + 320 data = 1559 total)
md5.BenchmarkHash1K   1000000	   7178 ns/op	 142.64 MB/s
md5.BenchmarkHash8K    200000	  56834 ns/op	 144.14 MB/s

Partial unroll  (size: 1115 code + 256 data = 1371 total)
md5.BenchmarkHash1K   5000000	   2513 ns/op	 407.37 MB/s
md5.BenchmarkHash8K    500000	  19406 ns/op	 422.13 MB/s

Complete unroll  (size: 1900 code + 0 data = 1900 code)
md5.BenchmarkHash1K   5000000	   2442 ns/op	 419.18 MB/s
md5.BenchmarkHash8K    500000	  18957 ns/op	 432.13 MB/s

Comparing Go 1.0.1 and the complete unroll (this CL):

benchmark               old MB/s     new MB/s  speedup
md5.BenchmarkHash1K       142.64       419.18    2.94x
md5.BenchmarkHash8K       144.14       432.13    3.00x

On the same machine, 'openssl speed md5' reports 441 MB/s
and 531 MB/s for our two cases, so this CL is at 90% and 80% of
those speeds, which is at least in the right ballpark.
OpenSSL is using carefully engineered assembly, so we are
unlikely to catch up completely.

Measurements on a Mid-2010 MacPro5,1.

R=golang-dev, bradfitz, agl
CC=golang-dev
https://golang.org/cl/6220046
2012-05-22 13:53:27 -04:00
Russ Cox
1c44575530 net/http: refactor body logic in test
This just eliminates some duplication.
Also add a pointer to RFC 1122, in case
this comes up again.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6229044
2012-05-22 13:46:53 -04:00
Dmitriy Vyukov
845aa1fc2c runtime: faster GC sweep phase
benchmark                              old ns/op    new ns/op    delta

garbage.BenchmarkParser               3731065750   3715543750   -0.41%
garbage.BenchmarkParser-2             3631299750   3495248500   -3.75%
garbage.BenchmarkParser-4             3386486000   3339353000   -1.39%
garbage.BenchmarkParser-8             3267632000   3286422500   +0.58%
garbage.BenchmarkParser-16            3299203000   3316081750   +0.51%

garbage.BenchmarkTree                  977532888    919453833   -5.94%
garbage.BenchmarkTree-2                919948555    853478000   -7.23%
garbage.BenchmarkTree-4                841329000    790207000   -6.08%
garbage.BenchmarkTree-8                787792777    740380666   -6.01%
garbage.BenchmarkTree-16               899257166    846594555   -5.86%

garbage.BenchmarkTree2                 574876300    571885800   -0.52%
garbage.BenchmarkTree2-2               348162700    345888900   -0.65%
garbage.BenchmarkTree2-4               184912500    179137000   -3.22%
garbage.BenchmarkTree2-8               104243900    103485600   -0.73%
garbage.BenchmarkTree2-16               97269500     85137100  -14.25%

garbage.BenchmarkParserPause           141101976    157746974  +11.80%
garbage.BenchmarkParserPause-2         103096051     83043048  -19.45%
garbage.BenchmarkParserPause-4          52153133     45951111  -11.89%
garbage.BenchmarkParserPause-8          36730190     38901024   +5.91%
garbage.BenchmarkParserPause-16         32678875     29578585   -9.49%

garbage.BenchmarkTreePause              29487065     29648439   +0.55%
garbage.BenchmarkTreePause-2            22443494     21306159   -5.07%
garbage.BenchmarkTreePause-4            15799691     14985647   -5.15%
garbage.BenchmarkTreePause-8            10768112     9531420   -12.97%
garbage.BenchmarkTreePause-16           16329891     15205158   -6.89%

garbage.BenchmarkTree2Pause           2586957240   2577533200   -0.36%
garbage.BenchmarkTree2Pause-2         1683383760   1673923800   -0.56%
garbage.BenchmarkTree2Pause-4         1102860320   1074040280   -2.68%
garbage.BenchmarkTree2Pause-8          902627920    886122400   -1.86%
garbage.BenchmarkTree2Pause-16         856470920    804152320   -6.50%

garbage.BenchmarkParserLastPause       277316000    280839000   +1.25%
garbage.BenchmarkParserLastPause-2     179446000    163687000   -8.78%
garbage.BenchmarkParserLastPause-4     106752000     94144000  -11.81%
garbage.BenchmarkParserLastPause-8      57758000     61640000   +6.72%
garbage.BenchmarkParserLastPause-16     51235000     42552000  -16.95%

garbage.BenchmarkTreeLastPause          45244000     50786000  +12.25%
garbage.BenchmarkTreeLastPause-2        37163000     34654000   -6.75%
garbage.BenchmarkTreeLastPause-4        24178000     21967000   -9.14%
garbage.BenchmarkTreeLastPause-8        20390000     15648000  -30.30%
garbage.BenchmarkTreeLastPause-16       22398000     20180000   -9.90%

garbage.BenchmarkTree2LastPause       5748706000   5718809000   -0.52%
garbage.BenchmarkTree2LastPause-2     3481570000   3458844000   -0.65%
garbage.BenchmarkTree2LastPause-4     1849073000   1791330000   -3.22%
garbage.BenchmarkTree2LastPause-8     1042375000   1034811000   -0.73%
garbage.BenchmarkTree2LastPause-16     972637000    851323000  -14.25%

There is also visible improvement in consumed CPU time:
tree2 -heapsize=8000000000 -cpus=12
before: 248.74user 6.36system 0:52.74elapsed 483%CPU
after:  229.86user 6.33system 0:51.08elapsed 462%CPU
-1.66s of real time, but -18.91s of consumed CPU time

R=golang-dev
CC=golang-dev
https://golang.org/cl/6215065
2012-05-22 13:35:52 -04:00
Robert Griesemer
581e7c2a78 go/ast: document CommentGroup.Text and add test case.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6206096
2012-05-22 10:30:35 -07:00
Brad Fitzpatrick
5a0333764b net/http: improve TestServerExpect
Fail more usefully, and Logf in one place instead of Errorf where
an error is acceptable.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6221059
2012-05-22 10:27:34 -07:00
Robert Griesemer
f26d61731d go/parser: fix comment grouping (day 1 bug)
Comment groups must end at the end of a line (or the
next non-comment token) if the group started on a line
with non-comment tokens.

This is important for correct computation of "lead"
and "line" comments (Doc and Comment fields in AST nodes).

Without this fix, the "line" comment for F1 in the
following example:

type T struct {
     F1 int // comment1
     // comment2
     F2 int
}

is "// comment1// comment2" rather than just "// comment1".

This bug was present from Day 1 but only visible when
looking at export-filtered ASTs where only comments
associated with AST nodes are printed, and only in rare
cases (e.g, in the case above, if F2 where not exported,
godoc would show "// comment2" anyway because it was
considered part of the "line" comment for F1).

The bug fix is very small (parser.go). The bulk of the
changes are additional test cases (parser_test.go).

The fix exposed a caching bug in go/printer via one of the
existing tests, hence the changes to printer.go.

As an aside, the fix removes the the need for empty lines
before an "// Output" comment for some special cases of
code examples (e.g.: src/pkg/strings/example_test.go, Count
example).

No impact on gofmt formatting of src, misc.

Fixes #3139.

R=rsc
CC=golang-dev
https://golang.org/cl/6209080
2012-05-22 10:04:34 -07:00
Robert Griesemer
f596eb5d8d godoc: slightly smarter synopsis extraction
Ignore synopses that start with
"Copyright", "All rights", and "Author".

R=rsc
CC=golang-dev
https://golang.org/cl/6218047
2012-05-22 10:04:13 -07:00
Robert Griesemer
7b9a6d8dda go/scanner: strip carriage returns from commments
Also:
- cleaned up and simplified TestScan
- added tests for comments containing carriage returns

Fixes #3647.

R=rsc
CC=golang-dev
https://golang.org/cl/6225047
2012-05-22 10:03:53 -07:00
Alexey Borzenkov
f7277dac57 net/url: better parsing of urls with @ symbol in authority
Fixes #3439

R=r, rsc, dsymonds, n13m3y3r
CC=golang-dev
https://golang.org/cl/6206090
2012-05-22 12:44:24 -04:00
Joel Sing
495a9dc2b3 syscall: implement nametomib() on netbsd
Implement nametomib() on NetBSD using the CTL_QUERY node discovery
mechanism.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6211071
2012-05-23 01:33:48 +10:00
Benjamin Black
5c6162cdd1 crypto/x509: Add ECDSA support
R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/6208087
2012-05-22 11:03:59 -04:00
Adam Langley
5759c6022c crypto/ecdsa: add full set of NIST test vectors.
This includes the NIST test suite for ECDSA and alters the test to
parse and evaluate it.

R=golang-dev, bradfitz, rsc, b
CC=golang-dev
https://golang.org/cl/6219058
2012-05-22 10:33:14 -04:00
Adam Langley
477d7b1663 crypto/ecdsa: fix case where p != 0 mod 8 and the hash length < p.
I made a typo which breaks P-521.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6219057
2012-05-22 10:17:39 -04:00
Andrew Balholm
8f66d7dc32 exp/html: adjust inSelectIM to match spec
Simplify the flow of control.

Handle EOF, null bytes, <html>, <input>, <keygen>, <textarea>, <script>.

Pass 5 more tests.

R=golang-dev, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/6220062
2012-05-22 15:30:13 +10:00
Russ Cox
85266dfd4d runtime: relax TestGcSys
This fixes occasional 64-bit failures.
Maybe it will fix the 32-bit failures too,
so re-enable on 32-bit for now.

R=golang-dev, bradfitz, r, dvyukov
CC=golang-dev
https://golang.org/cl/6218050
2012-05-22 00:07:13 -04:00
Matthew Horsnell
875f34fd49 debug/elf: Expose entry point from Header in File struct.
Fixes #3470.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/6195074
2012-05-21 23:29:30 -04:00
Andrew Balholm
7648f61c7d exp/html: adjust inCellIM to match spec
Clean up flow of control.

Ignore </table>, </tbody>, </tfoot>, </thead>, </tr> if there is not
an appropriate element in table scope.

Pass 3 more tests.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/6206093
2012-05-22 10:31:08 +10:00
Russ Cox
053e4edd80 crypto/rsa: add SHA-224 hash prefix
http://www.rsa.com/rsalabs/node.asp?id=2125:

NOTE: A new OID has been defined for the combination
of the v1.5 signature scheme and the SHA-224 hash function:
        sha224WithRSAEncryption OBJECT IDENTIFIER ::=
Like the other sha*WithRSAEncryption OIDs in PKCS #1 v2.1,
this OID has NULL parameters.
The DigestInfo encoding for SHA-224 (see Section 9.2, Note 1) is:
        (0x)30 2d 30 0d 06 09 60 86 48 01 65 03 04 02 04 05 00 04 1c || H

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6208076
2012-05-21 14:10:16 -04:00
Brad Fitzpatrick
d45f22e3c8 net/http: fix duplicate status code in Response.Write
Fixes #3636

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6203094
2012-05-21 11:07:27 -07:00
Volker Dobler
b4456df6d2 net/http: add cookies from jar to POST request.
The main content of this CL is a test case checking the reported
issue 3511 and a tiny fix for it.  A subsequent CL will refactor
the fix as proposed issue 3511.

Fixes #3511.

R=golang-dev, steven.hartland, bradfitz
CC=golang-dev
https://golang.org/cl/6013049
2012-05-21 10:57:15 -07:00
Brad Fitzpatrick
30c0d2315e net/http: fix regression and mute known test failure for now
Two tests added in 820ffde8c are expected to fail until the fix
for Issue 3540 goes back in (pending Windows net fixes), so
make those tests just Logf for now, with a TODO to re-enable.

Add a new client test.

Rearrange the transport code to be more readable, and fix the
bug from 820ffde8c where the persistConn was being closed before
the body was fully ready.

Fixes #3644
Updates #1967 (not yet fixed, but should be after Issue 3540)

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6211069
2012-05-21 10:39:31 -07:00
Joel Sing
40b310706b net: reduce dial tests on netbsd
Add NetBSD to the list of operating systems that have a reduced set
of dial tests.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6208083
2012-05-21 00:38:14 +10:00
Joel Sing
67a0c4f7f9 syscall: fix SockaddrDatalink on netbsd
RawSockaddrDatalink and SockaddrDatalink need to match - make Data
have length 12 for both.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6223051
2012-05-21 00:13:22 +10:00
Andrew Balholm
4973c1fc7e exp/html: adjust inRowIM to match spec
Delete cases that just fall down to "anything else" action.

Handle </tbody>, </tfoot>, and </thead>.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/6203061
2012-05-20 14:26:20 +10:00
Mikio Hara
ba57c88003 net: fix leak in test
Also change the Listner variable name from l to ln.

R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/5918046
2012-05-19 10:42:54 +09:00
Mikio Hara
9cfb845af6 syscall: add comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6215046
2012-05-19 08:35:51 +09:00
James Gray
ccd63c3c19 net/http: non-keepalive connections close successfully
Connections did not close if Request.Close or Response.Close was true. This meant that if the user wanted the connection to close, or if the server requested it via "Connection: close", the connection would not be closed.

Fixes #1967.

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6201044
2012-05-18 10:34:37 -07:00
Benjamin Black
57557c0d49 tls: add AES256 ciphers
R=golang-dev, rsc, agl
CC=golang-dev
https://golang.org/cl/6188061
2012-05-18 11:06:58 -04:00
Maxim Pimenov
54c9fe88f5 go/build: fix some comments
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6217044
2012-05-17 11:19:19 -07:00
Marcel van Lohuizen
ec099b2bc7 exp/locale/collate: implementation of main collation functionality for
key and simple comparisson. Search is not yet implemented in this CL.
Changed some of the types of table_test.go to allow reuse in the new test.
Also reduced number of primary values for illegal runes to 1 (both map to
the same).

R=r
CC=golang-dev
https://golang.org/cl/6202062
2012-05-17 19:48:56 +02:00
Russ Cox
1171dbdd2d net: avoid the Mac firewall (again)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6209072
2012-05-17 02:01:03 -04:00
Gustavo Niemeyer
fdc45367f9 encoding/xml: fix decoding of unknown entities in non-strict mode
Fixes #3447.

R=rsc, gustavo
CC=golang-dev
https://golang.org/cl/6039045
2012-05-17 00:04:00 -03:00
Gustavo Niemeyer
9242a90ab5 encoding/xml: handle anonymous pointer fields
This CL makes

    type T struct { *U }

behave in a similar way to:

    type T struct { U }

Fixes #3108.

R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/5694044
2012-05-16 23:21:31 -03:00
Andrew Gerrand
283a3ddab8 runtime: disable gc test on non-amd64 systems
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6210062
2012-05-17 11:34:28 +10:00
Akshat Kumar
f5752848fd pkg/runtime: Fix semasleep on Plan 9
With the timed semacquire patch
(kernel-tsemacquire) for Plan 9,
we can now properly do a timed
wait for the semaphore, in
semasleep.

R=golang-dev, rsc, rminnich, ality, r
CC=0intro, golang-dev, john, mirtchovski
https://golang.org/cl/6197046
2012-05-16 15:09:28 -07:00
Benny Siegert
c816d8c59f log: fix typo in comment
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6195096
2012-05-16 22:56:18 +10:00
Robert Griesemer
03e1d4bc22 go/printer: don't print newlines for empty statements
Fixes #3466.

gofmt -w src misc causes no changes.

R=rsc
CC=golang-dev
https://golang.org/cl/6206073
2012-05-15 12:21:21 -07:00
Joel Sing
efa67b2c55 runtime: implement getcontext and sigprocmask for netbsd
Implement getcontext and sigprocmask for NetBSD - these will soon be
used by the thread handling code.

Also fix netbsd/386 signal handling - there is no sigreturn, just
return so that we hit the trampoline.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6215049
2012-05-16 04:32:49 +10:00
Joel Sing
0b7bcb84e3 runtime: fix netbsd syscalls
Use correct system calls/syscall numbers for NetBSD.

R=golang-dev, for.go.yong, rsc
CC=golang-dev
https://golang.org/cl/6200070
2012-05-16 03:33:37 +10:00
Joel Sing
4a5a5b20a5 runtime: fix netbsd signal handling
Update/correct NetBSD signal handling - most of this is needed due to
the correctly generated runtime definitions.

R=golang-dev, m4dh4tt3r, rsc
CC=golang-dev
https://golang.org/cl/6195079
2012-05-16 01:53:26 +10:00
Joel Sing
8a9edcf790 runtime: fix netbsd runtime defs
Fix and regenerate runtime defs for NetBSD.

Whilst the mcontext struct can be handled across architectures,
the registers are provided as defines that index an array, rather
than as members of the struct. Since these are architecture
dependent, include them via a defs_netbsd_<arch>.go file.

R=golang-dev, m4dh4tt3r, rsc
CC=golang-dev
https://golang.org/cl/6190070
2012-05-16 01:52:20 +10:00
Jan Ziak
773685b4a3 runtime: fix counting of free objects
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6206056
2012-05-15 11:48:58 -04:00
Dmitriy Vyukov
01826280eb runtime: refactor helpgc functionality in preparation for parallel GC
Parallel GC needs to know in advance how many helper threads will be there.
Hopefully it's the last patch before I can tackle parallel sweep phase.
The benchmarks are unaffected.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6200064
2012-05-15 19:10:16 +04:00
Joel Sing
b554fb912f os/syscall: correct netbsd types/names
Fix types/names so that these functions work with the generated
syscall/z* files.

R=golang-dev, m4dh4tt3r
CC=golang-dev
https://golang.org/cl/6201078
2012-05-15 12:00:13 +10:00
Joel Sing
b42ebb6fbf runtime: fix TLS handling for netbsd
Set the TLS base using the _lwp_setprivate() syscall, instead of via
sysarch(). NetBSD tracks the pointer passed to _lwp_setprivate() and
restores this value when restoring mcontext. If sysarch() is used
directly, restoring an mcontext trashes the FS/GS value, resulting
in a segfault when we next try to access the TLS.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6206062
2012-05-15 11:26:05 +10:00
Brad Fitzpatrick
e393a8292e mime/multipart: fix handling of empty parts without CRLF before next part
Empty parts can be either of the form:

a) "--separator\r\n", header (w/ trailing 2xCRLF), \r\n "--separator"...
or
b) "--separator\r\n", header (w/ trailing 2xCRLF), "--separator"...

We never handled case b).  In fact the RFC seems kinda vague about
it, but browsers seem to do a), and App Engine's synthetic POST
bodies after blob uploads is of form b).

So handle them both, and add a bunch of tests.

(I can't promise these are the last fixes to multipart, especially
considering its history, but I'm growing increasingly confident at
least, and I've never submitted a multipart CL with known bugs
outstanding, including this time.)

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6212046
2012-05-14 18:16:47 -07:00
Jan Mercl
bd13f6ff8e regexp/syntax: replace internal error on unexpected ) w/ ErrUnexpectedParen
Unbalanced extra right parenthesis produced an internal error instead of
a more descriptive one.

Fixes #3406.

R=r, rsc
CC=golang-dev
https://golang.org/cl/6201063
2012-05-14 11:50:25 -07:00
Joel Sing
2a47e0444c syscall: regenerate z* files for netbsd
Fix mkerrors.sh so that it works on NetBSD.

Remove directory mode bits from types - this already appears in errors.

Regenerate the z* files now that cgo is working.

R=golang-dev, m4dh4tt3r, r
CC=golang-dev
https://golang.org/cl/6201077
2012-05-14 10:40:13 -07:00
Michael Gehring
99142f5537 crypto/tls: fix decoding of certLen in certificateMsg.unmarshal
certLen was decoded incorrectly if length > 2^16-1.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6197077
2012-05-14 12:26:29 -04:00
Dmitriy Vyukov
8c4c6c413f sync: use atomic.Store in Once.Do
No perf/semantic changes, merely improves code health.
There were several questions as to why Once.Do uses
atomic.CompareAndSwap to do a store.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6208057
2012-05-14 19:27:29 +04:00
Dmitriy Vyukov
eb0bc8164a runtime: revert MaxGcproc from 16 to 4
The change accidentally come in with this revision:
https://code.google.com/p/go/source/detail?spec=svn345cbca96c5550f2e89bc727703301933802923c&r=14c38c23c819a17021b1808cf4a34ef3a1a17db5

R=golang-dev
CC=golang-dev
https://golang.org/cl/6195073
2012-05-11 13:30:34 +04:00
Dmitriy Vyukov
95643647ae runtime: add parallel for algorithm
This is factored out part of:
https://golang.org/cl/5279048/
(parallel GC)

R=bsiegert, mpimenov, rsc, minux.ma, r
CC=golang-dev
https://golang.org/cl/5986054
2012-05-11 10:50:03 +04:00
Shenghou Ma
aa45e52e74 runtime: fix complex division benchmarks
we can't add the division result to n during iteration, because it might
turn n into NaN or Inf.

R=golang-dev, rsc, iant, iant
CC=golang-dev
https://golang.org/cl/6197045
2012-05-11 03:09:14 +08:00
Joel Sing
5374ded1f3 runtime: fix syscalls for netbsd
Use correct syscall numbers and arguments for NetBSD.
Provide a trampoline for signal returns (using signal API 3).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6209048
2012-05-11 03:48:43 +10:00
Joel Sing
38445ca089 runtime: fix netbsd sigaction struct
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6198063
2012-05-11 03:48:16 +10:00