1
0
mirror of https://github.com/golang/go synced 2024-10-03 05:11:21 -06:00
Commit Graph

14341 Commits

Author SHA1 Message Date
Lucio De Re
1e4515a323 build: u.h for plan9 arm
R=golang-dev, minux.ma, ality
CC=golang-dev
https://golang.org/cl/6743052
2012-10-21 17:04:07 -04:00
Evan Shaw
772decbc80 reflect: make Index and Slice accept strings
Fixes #3284.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/6643043
2012-10-21 17:02:10 -04:00
Daniel Morsing
d7a3407e3d cmd/gc: fix confusing error when using variable as type.
Fixes #3783.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6737053
2012-10-21 20:50:31 +02:00
Daniel Morsing
a7a3fe7238 cmd/gc: Friendlier errors on oversized arrays.
Someone new to the language may not know the connection between ints and arrays, which was the only thing that the previous error told you anything about.

Fixes #4256.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6739048
2012-10-21 19:22:51 +02:00
Shenghou Ma
c1b7ddc6aa runtime: update docs for MemStats.PauseNs
PauseNs is a circular buffer of recent pause times, and the
most recent one is at [((NumGC-1)+256)%256].

   Also fix comments cross-linking the Go and C definition of
various structs.

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6657047
2012-10-22 01:08:13 +08:00
Shenghou Ma
3d00648dc1 gophertool: fix links
R=bradfitz
CC=golang-dev
https://golang.org/cl/6713043
2012-10-22 01:05:21 +08:00
Adam Langley
0ae408eb72 A+C: add Willem van der Schyff (Individual CLA).
R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/6733047
2012-10-21 14:20:17 +11:00
Shenghou Ma
6a3ad481cd cmd/go: make package list order predicable
also add a cleanup phase to cmd/go/test.bash.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6741050
2012-10-20 17:25:13 +08:00
Shenghou Ma
bcdb7926dd codereview: protect against read-only upstream repository
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6742053
2012-10-20 17:23:48 +08:00
Shenghou Ma
3e3fa7b5f1 runtime: ~3.7x speed up of div/mod on ARM
benchmark                      old ns/op    new ns/op    delta
BenchmarkUint32Div7                  281           75  -73.06%
BenchmarkUint32Div37                 281           75  -73.02%
BenchmarkUint32Div123                281           75  -73.02%
BenchmarkUint32Div763                280           75  -72.89%
BenchmarkUint32Div1247               280           75  -72.93%
BenchmarkUint32Div9305               281           75  -73.02%
BenchmarkUint32Div13307              281           75  -73.06%
BenchmarkUint32Div52513              281           75  -72.99%
BenchmarkUint32Div60978747           281           63  -77.33%
BenchmarkUint32Div106956295          280           63  -77.21%
BenchmarkUint32Mod7                  280           77  -72.21%
BenchmarkUint32Mod37                 280           77  -72.18%
BenchmarkUint32Mod123                280           77  -72.25%
BenchmarkUint32Mod763                280           77  -72.18%
BenchmarkUint32Mod1247               280           77  -72.21%
BenchmarkUint32Mod9305               280           77  -72.21%
BenchmarkUint32Mod13307              280           77  -72.25%
BenchmarkUint32Mod52513              280           77  -72.18%
BenchmarkUint32Mod60978747           280           63  -77.25%
BenchmarkUint32Mod106956295          280           63  -77.21%

R=dave, rsc
CC=dave, golang-dev, rsc
https://golang.org/cl/6717043
2012-10-20 16:40:19 +08:00
Nigel Tao
0ba5ec53b0 bufio: remove a little unnecessary indirection in tests.
R=mchaten, r
CC=golang-dev
https://golang.org/cl/6739045
2012-10-20 13:02:29 +11:00
Robert Griesemer
ddddd39fc8 go spec: constant divisors must not be zero
Both gc and gccgo always checked this for constant
expressions but the spec only mentions run-time
exceptions.

This CL also requires that constant divisors
must not be zero in non-constant integer expressions:
This is consistent with the spirit of the most
recent changes and it is consistent with constant
expressions. We don't want to specify the effect for
non-integer expressions (f/0.0 where f is a float or
complex number) because there the result f/g is not
further specified if a non-constant g is 0.

R=r, rsc, iant, ken, andybalholm, iant
CC=golang-dev
https://golang.org/cl/6710045
2012-10-19 10:12:09 -07:00
Robert Griesemer
3bde00033b go spec: define make() restrictions as for index expressions
This is a language change: Until now, the spec required run-
time panics for some of these errors. Note that gc and gccgo
implemented this inconsistently, and that both compilers already
reported compile-time errors in some cases. This change makes
make() behave along the same vein as index expressions.

This addresses the spec aspect of issue 4085.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6725053
2012-10-19 10:11:06 -07:00
Oling Cat
c117da37a2 unsafe: fix a typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6736048
2012-10-19 16:35:15 +11:00
Nigel Tao
e55fdff210 bufio: make Writer.ReadFrom not flush prematurely. For example,
many small writes to a network may be less efficient that a few
large writes.

This fixes net/http's TestClientWrites, broken by 6565056 that
introduced Writer.ReadFrom. That test implicitly assumed that
calling io.Copy on a *bufio.Writer wouldn't write to the
underlying network until the buffer was full.

R=dsymonds
CC=bradfitz, golang-dev, mchaten, mikioh.mikioh
https://golang.org/cl/6743044
2012-10-19 16:32:00 +11:00
Michael Chaten
2a4818dd11 bufio: Implement io.ReaderFrom for (*Writer).
This is part 2 of 2 for issue 4028.

benchmark                        old ns/op    new ns/op    delta
BenchmarkWriterCopyOptimal           53293        28326  -46.85%
BenchmarkWriterCopyUnoptimal         53757        30537  -43.19%
BenchmarkWriterCopyNoReadFrom        53192        36642  -31.11%

Fixes #4028.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6565056
2012-10-19 11:22:51 +11:00
Nigel Tao
90ad6a2d11 runtime: update comment for the "extern register" variables g and m.
R=rsc, minux.ma, ality
CC=dave, golang-dev
https://golang.org/cl/6620050
2012-10-19 11:02:32 +11:00
Nigel Tao
5abf4bdc27 image/draw: fast-path for 4:4:0 chroma subsampled sources.
R=r
CC=golang-dev
https://golang.org/cl/6699049
2012-10-19 10:55:41 +11:00
Ian Lance Taylor
1e6d9f49da encoding/xml: correctly escape newline, carriage return, and tab
The generated encodings are those from
http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping

The change to the decoder ensures that we turn 
 in the
input into \r, not \n.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6747043
2012-10-18 13:40:45 -07:00
Rémy Oudompheng
2abaaefa72 image/jpeg: make TestDCT faster.
The value of cosines are cached in a global array
instead of being recomputed each time.
The test was terribly slow on arm.

R=golang-dev, dave, nigeltao
CC=golang-dev
https://golang.org/cl/6733046
2012-10-18 21:28:04 +02:00
Stephen McQuay
a5b0c67d5f net: add LookupNS(domain string)
Fixes #4224.

R=golang-dev, dave, minux.ma, mikioh.mikioh, alex.brainman, rsc, herbert.fischer
CC=golang-dev
https://golang.org/cl/6675043
2012-10-18 15:39:04 +09:00
Mikio Hara
4c2a1f9559 A+C: Stephen McQuay (Individual CLA)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6733043
2012-10-18 15:37:53 +09:00
Nigel Tao
9dc3152668 exp/html: update package docs and add an example; a node's children is
a linked list, not a slice.

R=r, minux.ma
CC=golang-dev
https://golang.org/cl/6618055
2012-10-18 10:25:50 +11:00
Oling Cat
c5ebeff3aa doc/codewalk/markov: fix the highlight range of the step "The NewChain constructor function".
R=r, minux.ma, adg
CC=golang-dev
https://golang.org/cl/6710044
2012-10-18 08:12:44 +11:00
Rémy Oudompheng
a4682348c2 cmd/gc: don't squash complex literals when inlining.
Since this patch changes the way complex literals are written
in export data, there are a few other glitches.

Fixes #4159.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6674047
2012-10-17 20:33:44 +02:00
Shane Hansen
fcd5fd2ad4 crypto/cipher: panic on invalid IV length
Give better user feedback when invalid IV is used
to construct a cipher.

Fixes #3411

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6652053
2012-10-17 14:29:00 -04:00
Adam Langley
561561fc2d A+C: add Shane Hansen (Individual CLA)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6714053
2012-10-17 14:21:58 -04:00
Robert Griesemer
ea7c57a031 go spec: restrictions for index and slice expressions
At the moment, gc and gccgo report compile-
time errors for certain constant indexes that
are out of bounds. The spec however requests
a run-time panic for out-of-bounds indexes
(http://tip.golang.org/ref/spec#Indexes).

Document the status quo.

Fixes #4231.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6699048
2012-10-17 11:08:42 -07:00
Daniel Morsing
a2659aa6a1 cmd/go: Dedup package arguments before building.
Fixes #4104.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6639051
2012-10-17 17:23:47 +02:00
Adam Langley
73f11171b4 math/big: add 4-bit, fixed window exponentiation.
A 4-bit window is convenient because 4 divides both 32 and 64,
therefore we never have a window spanning words of the exponent.
Additionaly, the benefit of a 5-bit window is only 2.6% at 1024-bits
and 3.3% at 2048-bits.

This code is still not constant time, however.

benchmark                        old ns/op    new ns/op    delta
BenchmarkRSA2048Decrypt           17108590     11180370  -34.65%
Benchmark3PrimeRSA2048Decrypt     13003720      7680390  -40.94%

R=gri
CC=golang-dev
https://golang.org/cl/6716048
2012-10-17 11:19:26 -04:00
Shenghou Ma
ace9ff4578 sync/atomic: FreeBSD/ARM support
only supports ARMv6K and newer ARM cores.

R=rsc, dave
CC=golang-dev
https://golang.org/cl/6601064
2012-10-17 14:27:58 +08:00
Rob Pike
ec1ef16cea path/filepath: better documentation for WalkFunc
Define the properties of the arguments better. In particular,
explain that the path is (sort of) relative to the argument to
Walk.

Fixes #4119.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6721048
2012-10-17 16:00:09 +11:00
Dave Cheney
8c2b131cd1 net: return error from pollster rather than panicing
Fixes #3590.

R=bradfitz, mikioh.mikioh, iant, bsiegert
CC=golang-dev
https://golang.org/cl/6684054
2012-10-17 09:41:00 +11:00
Robert Griesemer
7565726875 math/big: fix big.Exp and document better
- always return 1 for y <= 0
- document that the sign of m is ignored
- protect against div-0 panics by treating
  m == 0 the same way as m == nil
- added extra tests

Fixes #4239.

R=agl, remyoudompheng, agl
CC=golang-dev
https://golang.org/cl/6724046
2012-10-16 13:46:27 -07:00
Adam Langley
cfa1ba34cc crypto/tls: make closeNotify a warning alert.
The RFC doesn't actually have an opinion on whether this is a fatal or
warning level alert, but common practice suggests that it should be a
warning.

This involves rebasing most of the tests.

Fixes #3413.

R=golang-dev, shanemhansen, rsc
CC=golang-dev
https://golang.org/cl/6654050
2012-10-16 15:40:37 -04:00
Robert Griesemer
71588bc2bc exp/types/staging: index and slice type checks
Also: handle assignments to the blank identifier.

R=rsc
CC=golang-dev
https://golang.org/cl/6658050
2012-10-16 10:20:03 -07:00
Dmitriy Vyukov
f24323c93e runtime: fix spurious deadlock crashes
Fixes #4243.

R=golang-dev, iant
CC=golang-dev, sebastien.paolacci
https://golang.org/cl/6682050
2012-10-16 14:41:32 +04:00
Shenghou Ma
12cbc8ae31 doc: NetBSD is fully supported now
R=adg, bsiegert
CC=golang-dev
https://golang.org/cl/6660047
2012-10-16 16:02:56 +08:00
Shenghou Ma
0c44488ad9 misc/dist: support packaging for NetBSD
R=adg
CC=golang-dev
https://golang.org/cl/6650053
2012-10-16 15:53:17 +08:00
Shenghou Ma
6e0df254b0 doc/godoc.js: put focus on div#page when necessary
so that keyboard navigation events are sent to div#page.

        Fixes #4233.

R=adg
CC=golang-dev
https://golang.org/cl/6652048
2012-10-16 14:28:18 +08:00
Rémy Oudompheng
7e144bcab0 cmd/5g, cmd/6g, cmd/8g: fix out of registers.
This patch is enough to fix compilation of
exp/types tests but only passes a stripped down
version of the appripriate torture test.

Update #4207.

R=dave, nigeltao, rsc, golang-dev
CC=golang-dev
https://golang.org/cl/6621061
2012-10-16 07:22:33 +02:00
Brad Fitzpatrick
bcf88de5ff pprof: filter out runtime.settype and fix --svg mode to produce valid XML
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6642043
2012-10-15 20:49:15 -07:00
Brad Fitzpatrick
08d66439b4 builder: label the race builder as "race"
R=golang-dev, adg, dave, rsc, minux.ma, dvyukov
CC=golang-dev
https://golang.org/cl/6648043
2012-10-15 20:30:41 -07:00
Rob Pike
15970c8d6d spec: more clarification about deferred functions
Proposed new text to make matters clearer. The existing text was
unclear about the state of result parameters when panicking.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6653047
2012-10-16 11:27:20 +11:00
Dmitriy Vyukov
6273c7324f runtime: add missing if(raceenabled)
R=0xe2.0x9a.0x9b, minux.ma, iant, dave
CC=golang-dev
https://golang.org/cl/6654052
2012-10-15 13:54:31 +04:00
Nigel Tao
1f31598e86 image/jpeg: re-organize the processSOS code.
This is a straight copy/paste, and the deletion of a TODO. There are
no other changes.

R=r
CC=golang-dev
https://golang.org/cl/6687049
2012-10-15 13:28:30 +11:00
Nigel Tao
8b624f607f image/jpeg: decode progressive JPEGs.
To be clear, this supports decoding the bytes on the wire into an
in-memory image. There is no API change: jpeg.Decode will still not
return until the entire image is decoded.

The code is obviously more complicated, and costs around 10% in
performance on baseline JPEGs. The processSOS code could be cleaned up a
bit, and maybe some of that loss can be reclaimed, but I'll leave that
for follow-up CLs, to keep the diff for this one as small as possible.

Before:
BenchmarkDecode	    1000	   2855637 ns/op	  21.64 MB/s
After:
BenchmarkDecodeBaseline	     500	   3178960 ns/op	  19.44 MB/s
BenchmarkDecodeProgressive	     500	   4082640 ns/op	  15.14 MB/s

Fixes #3976.

The test data was generated by:
# Create intermediate files; cjpeg on Ubuntu 10.04 can't read PNG.
convert video-001.png video-001.bmp
convert video-005.gray.png video-005.gray.pgm
# Create new test files.
cjpeg -quality 100 -sample 1x1,1x1,1x1 -progressive video-001.bmp > video-001.progressive.jpeg
cjpeg -quality 50 -sample 2x2,1x1,1x1 video-001.bmp > video-001.q50.420.jpeg
cjpeg -quality 50 -sample 2x1,1x1,1x1 video-001.bmp > video-001.q50.422.jpeg
cjpeg -quality 50 -sample 1x1,1x1,1x1 video-001.bmp > video-001.q50.444.jpeg
cjpeg -quality 50 -sample 2x2,1x1,1x1 -progressive video-001.bmp > video-001.q50.420.progressive.jpeg
cjpeg -quality 50 -sample 2x1,1x1,1x1 -progressive video-001.bmp > video-001.q50.422.progressive.jpeg
cjpeg -quality 50 -sample 1x1,1x1,1x1 -progressive video-001.bmp > video-001.q50.444.progressive.jpeg
cjpeg -quality 50 video-005.gray.pgm > video-005.gray.q50.jpeg
cjpeg -quality 50 -progressive video-005.gray.pgm > video-005.gray.q50.progressive.jpeg
# Delete intermediate files.
rm video-001.bmp video-005.gray.pgm

R=r
CC=golang-dev
https://golang.org/cl/6684046
2012-10-15 11:21:20 +11:00
David Symonds
f2045aadd9 time: accept numbers larger than 2^32 in ParseDuration.
Fixes #3374.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6683047
2012-10-15 07:50:13 +11:00
Shenghou Ma
240834374a io/ioutil: use pathname instead of name in docs to avoid confusion
caller of ioutil.TempFile() can use f.Name() to get "pathname"
of the temporary file, instead of just the "name" of the file.

Also remove an out-of-date comment about random number state.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6649054
2012-10-13 19:05:22 +08:00
Anthony Martin
422da762b7 compress/bzip2: use io.ByteReader instead of internal interface
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6663044
2012-10-12 14:09:24 -07:00