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

19606 Commits

Author SHA1 Message Date
Keith Randall
5ce6d3e03e undo CL 105260044 / afd6f214cc81
The go:nosplit change wasn't the problem, reinstating.

««« original CL description
undo CL 93380044 / 7f0999348917

Partial undo, just of go:nosplit annotation.  Somehow it
is breaking the windows builders.

TBR=bradfitz

««« original CL description
runtime: implement string ops in Go

Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/93380044
»»»

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/105260044
»»»

TBR=bradfitz
R=bradfitz, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/103490043
2014-06-17 08:10:21 -07:00
Keith Randall
f2147cd740 runtime: disable funky wide string test for now.
TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/105280045
2014-06-17 00:45:39 -07:00
Keith Randall
0f4b53c1c2 runtime: reconstitute runetochar for use by gostringw.
Fixes windows builds (hopefully).

LGTM=bradfitz
R=golang-codereviews, bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/103470045
2014-06-17 00:36:23 -07:00
Keith Randall
ee8e687874 undo CL 93380044 / 7f0999348917
Partial undo, just of go:nosplit annotation.  Somehow it
is breaking the windows builders.

TBR=bradfitz

««« original CL description
runtime: implement string ops in Go

Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/93380044
»»»

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/105260044
2014-06-16 23:51:18 -07:00
Shenghou Ma
e9da5fe279 cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove unused global variable retok.
LGTM=bradfitz
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/107160046
2014-06-17 02:05:27 -04:00
Keith Randall
61dca94e10 runtime: implement string ops in Go
Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/93380044
2014-06-16 23:03:03 -07:00
Keith Randall
b36ed9056f runtime: implement eqstring in assembly.
BenchmarkCompareStringEqual               10.4          7.33          -29.52%
BenchmarkCompareStringIdentical           3.99          3.67          -8.02%
BenchmarkCompareStringSameLength          9.80          6.84          -30.20%
BenchmarkCompareStringDifferentLength     1.09          0.95          -12.84%
BenchmarkCompareStringBigUnaligned        75220         76071         +1.13%
BenchmarkCompareStringBig                 69843         74746         +7.02%

LGTM=bradfitz, josharian
R=golang-codereviews, bradfitz, josharian, dave, khr
CC=golang-codereviews
https://golang.org/cl/105280044
2014-06-16 21:00:37 -07:00
Rui Ueyama
38eea5b2ad net: avoid array copy when shuffling SRV records
We don't need to shift array elements to shuffle them.
We just have to swap a selected element with 0th element.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/91750044
2014-06-16 18:00:28 -07:00
Robert Griesemer
60c0b3b5cf text/scanner: provide facility for custom identifiers
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/108030044
2014-06-16 16:32:47 -07:00
Matthew Dempsky
54bc760ad7 bufio: handle excessive white space in ScanWords
LGTM=r
R=golang-codereviews, bradfitz, r
CC=golang-codereviews
https://golang.org/cl/109020043
2014-06-16 12:59:10 -07:00
Rob Pike
311e28636a fmt: don't put 0x on every byte of a compact hex-encoded string
Printf("%x", "abc") was "0x610x620x63"; is now "0x616263", which
is surely better.
Printf("% #x", "abc") is still "0x61 0x62 0x63".

Fixes #8080.

LGTM=bradfitz, gri
R=golang-codereviews, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/106990043
2014-06-16 10:45:05 -07:00
Alex Brainman
be0079abe1 os: disable TestGetppid on plan9
Fixes build.

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/105140047
2014-06-14 16:47:40 +10:00
Alan Shreve
6f6f1bd054 syscall: implement syscall.Getppid() on Windows
Also added a test to verify os.Getppid() works across all platforms

LGTM=alex.brainman
R=golang-codereviews, alex.brainman, shreveal, iant
CC=golang-codereviews
https://golang.org/cl/102320044
2014-06-14 15:51:00 +10:00
Ian Lance Taylor
f303b4965c A+C: Alan Shreve (individual CLA)
Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/102410044
2014-06-13 21:09:23 -07:00
Ian Lance Taylor
1db4c8dc41 runtime: fix VDSO lookup to use dynamic hash table
Reportedly in the Linux 3.16 kernel the VDSO will not have
section headers or a normal symbol table.

Too late for 1.3 but perhaps for 1.3.1, if there is one.

Fixes #8197.

LGTM=rsc
R=golang-codereviews, mattn.jp, rsc
CC=golang-codereviews
https://golang.org/cl/101260044
2014-06-13 13:29:26 -07:00
Nigel Tao
9f08c5c383 compress/lzw: add commentary that TIFF's LZW differs from the standard
algorithm.

See https://golang.org/cl/105750045/ for an implementation of
TIFF's LZW.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/102940043
2014-06-13 17:44:29 +10:00
Nigel Tao
eb788045d8 image/png: fix compare-to-golden-file test.
bufio.Scanner.Scan returns whether the scan succeeded, not whether it
is done, so the test was mistakenly breaking early.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/93670045
2014-06-13 17:43:02 +10:00
Andrew Gerrand
7d3be61386 doc: link to new downloads page
LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/102340044
2014-06-13 16:34:52 +10:00
Russ Cox
50365666c7 undo CL 101970047 / 30307cc8bef2
makes windows-amd64-race benchmarks slower

««« original CL description
testing: make benchmarking faster

Allow the number of benchmark iterations to grow faster for fast benchmarks, and don't round up twice.

Using the default benchtime, this CL reduces wall clock time to run benchmarks:

net/http        49s   -> 37s   (-24%)
runtime         8m31s -> 5m55s (-30%)
bytes           2m37s -> 1m29s (-43%)
encoding/json   29s   -> 21s   (-27%)
strings         1m16s -> 53s   (-30%)

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/101970047
»»»

TBR=josharian
CC=golang-codereviews
https://golang.org/cl/105950044
2014-06-13 02:04:03 -04:00
Andrew Gerrand
328e86d262 tag go1.3rc2
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/101270043
2014-06-13 13:30:54 +10:00
Russ Cox
060a988011 runtime: revise CL 105140044 (defer nil) to work on Windows
It appears that something about Go on Windows
cannot handle the fault cause by a jump to address 0.
The way Go represents and calls functions, this
never happened at all, until CL 105140044.

This CL changes the code added in CL 105140044
to make jump to 0 impossible once again.

Fixes #8047. (again, on Windows)

TBR=bradfitz
R=golang-codereviews, dave
CC=adg, golang-codereviews, iant, r
https://golang.org/cl/105120044
2014-06-12 21:12:53 -04:00
Rob Pike
e209a0fa06 time: micro symbol for microseconds
R=rsc
CC=golang-codereviews
https://golang.org/cl/105930043
2014-06-12 17:19:33 -07:00
Russ Cox
32d8b9ffb8 lib/codereview: fix doc/go1.*.txt exception
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/108950046
2014-06-12 20:12:50 -04:00
Russ Cox
3a6de21ae1 doc: add go1.4.txt
CC=golang-codereviews
https://golang.org/cl/103340046
2014-06-12 20:06:16 -04:00
Rob Pike
ce39b34f36 time: change formatting of microseconds duration to SI modifier
'u' is not micro, µ (U+00B5) is.

LGTM=gri, bradfitz
R=golang-codereviews, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/105030046
2014-06-12 17:01:13 -07:00
Russ Cox
ff9af906f6 codereview: no LGTM needed for doc/go1.x.txt
Rob asked for this change to make maintaining go1.4.txt easier.
If you are not sure of a change, it is still okay to send for review.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/109880044
2014-06-12 16:35:12 -04:00
Russ Cox
597f87c997 runtime: do not trace past jmpdefer during pprof traceback on arm
jmpdefer modifies PC, SP, and LR, and not atomically,
so walking past jmpdefer will often end up in a state
where the three are not a consistent execution snapshot.
This was causing warning messages a few frames later
when the traceback realized it was confused, but given
the right memory it could easily crash instead.

Update #8153

LGTM=minux, iant
R=golang-codereviews, minux, iant
CC=golang-codereviews, r
https://golang.org/cl/107970043
2014-06-12 16:34:54 -04:00
Russ Cox
36207a91d3 runtime: fix defer of nil func
Fixes #8047.

LGTM=r, iant
R=golang-codereviews, r, iant
CC=dvyukov, golang-codereviews, khr
https://golang.org/cl/105140044
2014-06-12 16:34:36 -04:00
Rob Pike
83c8140662 time: avoid broken fix for buggy TestOverflowRuntimeTimer
The test requires that timerproc runs, but busy loops and starves
the scheduler so that, with high probability, timerproc doesn't run.
Avoid the issue by expecting the test to succeed; if not, a major
outside timeout will kill it and let us know.

As you can see from the diffs, there have been several attempts to
fix this with chicanery, but none has worked. Don't bother trying
any more.

Fixes #8136.

LGTM=rsc
R=rsc, josharian
CC=golang-codereviews
https://golang.org/cl/105140043
2014-06-12 11:44:55 -07:00
Brad Fitzpatrick
e46be90fec encoding/json: remove unused field from Encoder struct
It should've been removed in https://golang.org/cl/9365044

Thanks to Jacek Masiulaniec for noticing.

LGTM=ruiu
R=ruiu
CC=golang-codereviews
https://golang.org/cl/109880043
2014-06-12 09:44:59 -07:00
Josh Bleecher Snyder
a5bb1af432 testing: make benchmarking faster
Allow the number of benchmark iterations to grow faster for fast benchmarks, and don't round up twice.

Using the default benchtime, this CL reduces wall clock time to run benchmarks:

net/http        49s   -> 37s   (-24%)
runtime         8m31s -> 5m55s (-30%)
bytes           2m37s -> 1m29s (-43%)
encoding/json   29s   -> 21s   (-27%)
strings         1m16s -> 53s   (-30%)

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/101970047
2014-06-12 07:51:32 -07:00
Alan Donovan
0476693eaf doc: add release note for 'godoc -analysis'
Contains a link to /lib/godoc/analysis/help.html
       which is not yet live.

LGTM=r
R=r, adg
CC=golang-codereviews
https://golang.org/cl/88560044
2014-06-12 10:08:54 -04:00
Rui Ueyama
b93f83f8e1 encoding/ascii85: remove unused field
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/105890044
2014-06-11 22:52:01 -07:00
Rui Ueyama
f7c99f3377 net: efficient text processing
Optimize IP.String, IPMask.String and ParseIP.

benchmark                old ns/op    new ns/op    delta
BenchmarkParseIP              2216         1849  -16.56%
BenchmarkIPString             7828         2486  -68.24%
BenchmarkIPMaskString         3872          659  -82.98%

LGTM=mikioh.mikioh, dave, bradfitz
R=golang-codereviews, mikioh.mikioh, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/95750043
2014-06-11 20:40:00 -07:00
Rui Ueyama
f837078c50 net: do not call time.Now() twice
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/104080043
2014-06-11 20:33:44 -07:00
Andrew Gerrand
d131ffefad doc: link to release history from /doc/
Fixes #8168.

TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/107950043
2014-06-12 13:31:13 +10:00
Andrew Gerrand
09576bc695 misc/makerelease: update default tag to release-branch.go1.3
TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/104090044
2014-06-12 13:29:22 +10:00
Rui Ueyama
7bcbb65d78 bytes, strings: optimize Repeat
Call copy with as large buffer as possible to reduce the
number of function calls.

benchmark                 old ns/op    new ns/op    delta
BenchmarkBytesRepeat            540          162  -70.00%
BenchmarkStringsRepeat          563          177  -68.56%

LGTM=josharian
R=golang-codereviews, josharian, dave, dvyukov
CC=golang-codereviews
https://golang.org/cl/90550043
2014-06-11 19:03:59 -07:00
Rui Ueyama
22a5d2cc96 mime/multipart: fix format
Remove unnecessary blank line.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/105040045
2014-06-11 17:39:34 -07:00
Keith Randall
aa04caa759 runtime: add test for issue 8047.
Make sure stack copier doesn't barf on a nil defer.
Bug was fixed in https://golang.org/cl/101800043
This change just adds a test.

Fixes #8047

LGTM=dvyukov, rsc
R=dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/108840043
2014-06-11 20:34:46 -04:00
Robert Griesemer
3d68dc3325 math: remove Nextafter64 alias in favor of existing Nextafter
LGTM=adonovan
R=rsc, adonovan
CC=golang-codereviews
https://golang.org/cl/104050045
2014-06-11 14:24:16 -07:00
Rui Ueyama
afb7b67ae9 encoding/base64, encoding/base32: make DecodeString faster
Previously, an input string was stripped of newline
characters at the beginning of DecodeString and then passed
to Decode. Decode again tried to strip newline characters.
That's waste of time.

benchmark                 old MB/s     new MB/s  speedup
BenchmarkDecodeString        38.37        65.20    1.70x

LGTM=dave, bradfitz
R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/91770051
2014-06-11 11:22:08 -07:00
Russ Cox
f20e4d5ecb cmd/gc: fix &result escaping into result
There is a hierarchy of location defined by loop depth:

        -1 = the heap
        0 = function results
        1 = local variables (and parameters)
        2 = local variable declared inside a loop
        3 = local variable declared inside a loop inside a loop
        etc

In general if an address from loopdepth n is assigned to
something in loop depth m < n, that indicates an extended
lifetime of some form that requires a heap allocation.

Function results can be local variables too, though, and so
they don't actually fit into the hierarchy very well.
Treat the address of a function result as level 1 so that
if it is written back into a result, the address is treated
as escaping.

Fixes #8185.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/108870044
2014-06-11 14:21:06 -04:00
Robert Griesemer
be91bc29a4 math/big: implement Rat.Float32
Pending CL 101750048.
For submission after the 1.3 release.

Fixes #8065.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/93550043
2014-06-11 09:10:49 -07:00
Robert Griesemer
a9035ede1b math: implement Nextafter32
Provide Nextafter64 as alias to Nextafter.
For submission after the 1.3 release.

Fixes #8117.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/101750048
2014-06-11 09:09:37 -07:00
Russ Cox
775ab8eeaa cmd/gc: fix escape analysis for &x inside switch x := v.(type)
The analysis for &x was using the loop depth on x set
during x's declaration. A type switch creates a list of
implicit declarations that were not getting initialized
with loop depths.

Fixes #8176.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/108860043
2014-06-11 11:48:47 -04:00
Shenghou Ma
3ad9df0422 nacltest.bash, misc/nacl/README: update NaCl docs.
LGTM=rsc
R=dave, rsc
CC=golang-codereviews
https://golang.org/cl/105030043
2014-06-10 20:20:49 -04:00
Brad Fitzpatrick
1e6a19be64 net/http: fix double Content-Length in response
Fixes #8180

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/105040043
2014-06-10 16:52:37 -07:00
Ian Lance Taylor
507afa68c5 cmd/ld: fix PC deltas in DWARF line number table
The putpclcdelta function set the DWARF line number PC to
s->value + pcline->pc, which is correct, but the code then set
the local variable pc to epc, which can be a different value.
This caused the next delta in the DWARF table to be wrong.

Fixes #8098.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/104950045
2014-06-10 14:11:39 -07:00
Rob Pike
b91d2339bb docs: link to the assembler document from the Documents tab
Fixes #8156.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/108840045
2014-06-10 11:19:53 -07:00