]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
12 years agoweekly.2011-07-29 weekly.2011-07-29
Andrew Gerrand [Fri, 29 Jul 2011 22:11:48 +0000 (15:11 -0700)]
weekly.2011-07-29

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

12 years agoruntime: fix scheduling race
Hector Chu [Fri, 29 Jul 2011 21:39:02 +0000 (17:39 -0400)]
runtime: fix scheduling race

Affects programs using cgo or runtime.LockOSThread.

Fixes #2100.

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

12 years agoxml: Header: fix close tag and newline
Kyle Lemons [Fri, 29 Jul 2011 18:09:07 +0000 (14:09 -0400)]
xml: Header: fix close tag and newline

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

12 years agolibmach: stubs for openbsd
Joel Sing [Fri, 29 Jul 2011 17:48:00 +0000 (13:48 -0400)]
libmach: stubs for openbsd

Add libmach stubs for openbsd.

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

12 years agogodoc: allow form feed in text files
Russ Cox [Fri, 29 Jul 2011 17:47:54 +0000 (13:47 -0400)]
godoc: allow form feed in text files

Now recognizes misc/emacs/go-mode-load.el as text.

Fixes #2115.

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

12 years ago6l: OpenBSD support
Joel Sing [Fri, 29 Jul 2011 17:47:41 +0000 (13:47 -0400)]
6l: OpenBSD support

Add linker support for OpenBSD ELF-64.

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

12 years agoruntime: fix data race in findfunc()
Dmitriy Vyukov [Fri, 29 Jul 2011 17:47:24 +0000 (13:47 -0400)]
runtime: fix data race in findfunc()
The data race can lead to reads of partially
initialized concurrently mutated symbol data.
The change also adds a simple sanity test
for Caller() and FuncForPC().

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

12 years agosyscall: move bsd pipe syscall
Joel Sing [Fri, 29 Jul 2011 17:47:20 +0000 (13:47 -0400)]
syscall: move bsd pipe syscall

Not all BSDs have the same pipe() syscall implementation - move the Darwin/FreeBSD specific implementation into their respective OS syscall files. This will be needed to add OpenBSD syscall support.

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

12 years agoarchive/zip: more efficient reader and bug fix
Andrew Gerrand [Fri, 29 Jul 2011 17:47:00 +0000 (10:47 -0700)]
archive/zip: more efficient reader and bug fix

Fixes #2090.

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

12 years agoCONTRIBUTORS: add Joel Sing (Google CLA)
Russ Cox [Fri, 29 Jul 2011 17:31:42 +0000 (13:31 -0400)]
CONTRIBUTORS: add Joel Sing (Google CLA)

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

12 years agoruntime: improve Linux mutex
Dmitriy Vyukov [Fri, 29 Jul 2011 16:44:06 +0000 (12:44 -0400)]
runtime: improve Linux mutex
The implementation is hybrid active/passive spin/blocking mutex.
The design minimizes amount of context switches and futex calls.
The idea is that all critical sections in runtime are intentially
small, so pure blocking mutex behaves badly causing
a lot of context switches, thread parking/unparking and kernel calls.
Note that some synthetic benchmarks become somewhat slower,
that's due to increased contention on other data structures,
it should not affect programs that do any real work.

On 2 x Intel E5620, 8 HT cores, 2.4GHz
benchmark                     old ns/op    new ns/op    delta
BenchmarkSelectContended         521.00       503.00   -3.45%
BenchmarkSelectContended-2       661.00       320.00  -51.59%
BenchmarkSelectContended-4      1139.00       629.00  -44.78%
BenchmarkSelectContended-8      2870.00       878.00  -69.41%
BenchmarkSelectContended-16     5276.00       818.00  -84.50%
BenchmarkChanContended           112.00       103.00   -8.04%
BenchmarkChanContended-2         631.00       174.00  -72.42%
BenchmarkChanContended-4         682.00       272.00  -60.12%
BenchmarkChanContended-8        1601.00       520.00  -67.52%
BenchmarkChanContended-16       3100.00       372.00  -88.00%
BenchmarkChanSync                253.00       239.00   -5.53%
BenchmarkChanSync-2             5030.00      4648.00   -7.59%
BenchmarkChanSync-4             4826.00      4694.00   -2.74%
BenchmarkChanSync-8             4778.00      4713.00   -1.36%
BenchmarkChanSync-16            5289.00      4710.00  -10.95%
BenchmarkChanProdCons0           273.00       254.00   -6.96%
BenchmarkChanProdCons0-2         599.00       400.00  -33.22%
BenchmarkChanProdCons0-4        1168.00       659.00  -43.58%
BenchmarkChanProdCons0-8        2831.00      1057.00  -62.66%
BenchmarkChanProdCons0-16       4197.00      1037.00  -75.29%
BenchmarkChanProdCons10          150.00       140.00   -6.67%
BenchmarkChanProdCons10-2        607.00       268.00  -55.85%
BenchmarkChanProdCons10-4       1137.00       404.00  -64.47%
BenchmarkChanProdCons10-8       2115.00       828.00  -60.85%
BenchmarkChanProdCons10-16      4283.00       855.00  -80.04%
BenchmarkChanProdCons100         117.00       110.00   -5.98%
BenchmarkChanProdCons100-2       558.00       218.00  -60.93%
BenchmarkChanProdCons100-4       722.00       287.00  -60.25%
BenchmarkChanProdCons100-8      1840.00       431.00  -76.58%
BenchmarkChanProdCons100-16     3394.00       448.00  -86.80%
BenchmarkChanProdConsWork0      2014.00      1996.00   -0.89%
BenchmarkChanProdConsWork0-2    1207.00      1127.00   -6.63%
BenchmarkChanProdConsWork0-4    1913.00       611.00  -68.06%
BenchmarkChanProdConsWork0-8    3016.00       949.00  -68.53%
BenchmarkChanProdConsWork0-16   4320.00      1154.00  -73.29%
BenchmarkChanProdConsWork10     1906.00      1897.00   -0.47%
BenchmarkChanProdConsWork10-2   1123.00      1033.00   -8.01%
BenchmarkChanProdConsWork10-4   1076.00       571.00  -46.93%
BenchmarkChanProdConsWork10-8   2748.00      1096.00  -60.12%
BenchmarkChanProdConsWork10-16  4600.00      1105.00  -75.98%
BenchmarkChanProdConsWork100    1884.00      1852.00   -1.70%
BenchmarkChanProdConsWork100-2  1235.00      1146.00   -7.21%
BenchmarkChanProdConsWork100-4  1217.00       619.00  -49.14%
BenchmarkChanProdConsWork100-8  1534.00       509.00  -66.82%
BenchmarkChanProdConsWork100-16 4126.00       918.00  -77.75%
BenchmarkSyscall                  34.40        33.30   -3.20%
BenchmarkSyscall-2               160.00       121.00  -24.38%
BenchmarkSyscall-4               131.00       136.00   +3.82%
BenchmarkSyscall-8               139.00       131.00   -5.76%
BenchmarkSyscall-16              161.00       168.00   +4.35%
BenchmarkSyscallWork             950.00       950.00   +0.00%
BenchmarkSyscallWork-2           481.00       480.00   -0.21%
BenchmarkSyscallWork-4           268.00       270.00   +0.75%
BenchmarkSyscallWork-8           156.00       169.00   +8.33%
BenchmarkSyscallWork-16          188.00       184.00   -2.13%
BenchmarkSemaSyntNonblock         36.40        35.60   -2.20%
BenchmarkSemaSyntNonblock-2       81.40        45.10  -44.59%
BenchmarkSemaSyntNonblock-4      126.00       108.00  -14.29%
BenchmarkSemaSyntNonblock-8      112.00       112.00   +0.00%
BenchmarkSemaSyntNonblock-16     110.00       112.00   +1.82%
BenchmarkSemaSyntBlock            35.30        35.30   +0.00%
BenchmarkSemaSyntBlock-2         118.00       124.00   +5.08%
BenchmarkSemaSyntBlock-4         105.00       108.00   +2.86%
BenchmarkSemaSyntBlock-8         101.00       111.00   +9.90%
BenchmarkSemaSyntBlock-16        112.00       118.00   +5.36%
BenchmarkSemaWorkNonblock        810.00       811.00   +0.12%
BenchmarkSemaWorkNonblock-2      476.00       414.00  -13.03%
BenchmarkSemaWorkNonblock-4      238.00       228.00   -4.20%
BenchmarkSemaWorkNonblock-8      140.00       126.00  -10.00%
BenchmarkSemaWorkNonblock-16     117.00       116.00   -0.85%
BenchmarkSemaWorkBlock           810.00       811.00   +0.12%
BenchmarkSemaWorkBlock-2         454.00       466.00   +2.64%
BenchmarkSemaWorkBlock-4         243.00       241.00   -0.82%
BenchmarkSemaWorkBlock-8         145.00       137.00   -5.52%
BenchmarkSemaWorkBlock-16        132.00       123.00   -6.82%
BenchmarkContendedSemaphore      123.00       102.00  -17.07%
BenchmarkContendedSemaphore-2     34.80        34.90   +0.29%
BenchmarkContendedSemaphore-4     34.70        34.80   +0.29%
BenchmarkContendedSemaphore-8     34.70        34.70   +0.00%
BenchmarkContendedSemaphore-16    34.80        34.70   -0.29%
BenchmarkMutex                    26.80        26.00   -2.99%
BenchmarkMutex-2                 108.00        45.20  -58.15%
BenchmarkMutex-4                 103.00       127.00  +23.30%
BenchmarkMutex-8                 109.00       147.00  +34.86%
BenchmarkMutex-16                102.00       152.00  +49.02%
BenchmarkMutexSlack               27.00        26.90   -0.37%
BenchmarkMutexSlack-2            149.00       165.00  +10.74%
BenchmarkMutexSlack-4            121.00       209.00  +72.73%
BenchmarkMutexSlack-8            101.00       158.00  +56.44%
BenchmarkMutexSlack-16            97.00       129.00  +32.99%
BenchmarkMutexWork               792.00       794.00   +0.25%
BenchmarkMutexWork-2             407.00       409.00   +0.49%
BenchmarkMutexWork-4             220.00       209.00   -5.00%
BenchmarkMutexWork-8             267.00       160.00  -40.07%
BenchmarkMutexWork-16            315.00       300.00   -4.76%
BenchmarkMutexWorkSlack          792.00       793.00   +0.13%
BenchmarkMutexWorkSlack-2        406.00       404.00   -0.49%
BenchmarkMutexWorkSlack-4        225.00       212.00   -5.78%
BenchmarkMutexWorkSlack-8        268.00       136.00  -49.25%
BenchmarkMutexWorkSlack-16       300.00       300.00   +0.00%
BenchmarkRWMutexWrite100          27.10        27.00   -0.37%
BenchmarkRWMutexWrite100-2        33.10        40.80  +23.26%
BenchmarkRWMutexWrite100-4       113.00        88.10  -22.04%
BenchmarkRWMutexWrite100-8       119.00        95.30  -19.92%
BenchmarkRWMutexWrite100-16      148.00       109.00  -26.35%
BenchmarkRWMutexWrite10           29.60        29.40   -0.68%
BenchmarkRWMutexWrite10-2        111.00        61.40  -44.68%
BenchmarkRWMutexWrite10-4        270.00       208.00  -22.96%
BenchmarkRWMutexWrite10-8        204.00       185.00   -9.31%
BenchmarkRWMutexWrite10-16       261.00       190.00  -27.20%
BenchmarkRWMutexWorkWrite100    1040.00      1036.00   -0.38%
BenchmarkRWMutexWorkWrite100-2   593.00       580.00   -2.19%
BenchmarkRWMutexWorkWrite100-4   470.00       365.00  -22.34%
BenchmarkRWMutexWorkWrite100-8   468.00       289.00  -38.25%
BenchmarkRWMutexWorkWrite100-16  604.00       374.00  -38.08%
BenchmarkRWMutexWorkWrite10      951.00       951.00   +0.00%
BenchmarkRWMutexWorkWrite10-2   1001.00       928.00   -7.29%
BenchmarkRWMutexWorkWrite10-4   1555.00      1006.00  -35.31%
BenchmarkRWMutexWorkWrite10-8   2085.00      1171.00  -43.84%
BenchmarkRWMutexWorkWrite10-16  2082.00      1614.00  -22.48%

R=rsc, iant, msolo, fw, iant
CC=golang-dev
https://golang.org/cl/4711045

12 years agogc: fix pprof deadlock
Russ Cox [Fri, 29 Jul 2011 01:03:40 +0000 (21:03 -0400)]
gc: fix pprof deadlock

Fixes #2051.

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

12 years agogc: more graceful errors during struct definition
Russ Cox [Fri, 29 Jul 2011 00:41:18 +0000 (20:41 -0400)]
gc: more graceful errors during struct definition

Fixes #2110.

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

12 years agoexp/template: fix build
Rob Pike [Thu, 28 Jul 2011 23:46:32 +0000 (16:46 -0700)]
exp/template: fix build
TBR=gri

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

12 years agobuild: fix noclobber
Russ Cox [Thu, 28 Jul 2011 23:38:14 +0000 (19:38 -0400)]
build: fix noclobber

I got it backwards last time, and somehow
that was leaking into the parent shell?

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

12 years agoexp/template: simplify the helper functions
Rob Pike [Thu, 28 Jul 2011 23:19:16 +0000 (16:19 -0700)]
exp/template: simplify the helper functions
- create a pair of "Must" functions, one for templates, one for sets
- regularize the return values of the parsers so they can be wrapped by Must
- delete all the old Must functions and methods.

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

12 years ago5g, 6g, 8g: shift, opt fixes
Russ Cox [Thu, 28 Jul 2011 22:22:12 +0000 (18:22 -0400)]
5g, 6g, 8g: shift, opt fixes

Fixes #1808.

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

12 years ago5g: defer vs optimizer bug
Russ Cox [Thu, 28 Jul 2011 20:28:23 +0000 (16:28 -0400)]
5g: defer vs optimizer bug

Fixes #1924.

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

12 years agohttp: make serveFile redirects relative to work with StripPrefix
Andrew Balholm [Thu, 28 Jul 2011 18:43:16 +0000 (11:43 -0700)]
http: make serveFile redirects relative to work with StripPrefix

serveFile was using absolute redirects, which didn't work under StripPrefix.
Now it uses relative redirects.

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

12 years ago6g, 8g: divide corner case
Russ Cox [Thu, 28 Jul 2011 18:18:22 +0000 (14:18 -0400)]
6g, 8g: divide corner case

Fixes #1772.

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

12 years agobuild: handle spaces in $USER
Russ Cox [Thu, 28 Jul 2011 17:04:52 +0000 (13:04 -0400)]
build: handle spaces in $USER

Fixes #2107.

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

12 years agobuild: update all-qemu.bash
Russ Cox [Thu, 28 Jul 2011 17:04:30 +0000 (13:04 -0400)]
build: update all-qemu.bash

nothing but GOARCH=arm makes sense.
http/cgi uses network too.

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

12 years agogc: shift type bug
Russ Cox [Thu, 28 Jul 2011 17:03:30 +0000 (13:03 -0400)]
gc: shift type bug

Fixes #1664.

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

12 years agoexp/template: make Set.ParseFile etc resolve functions in the Set
Roger Peppe [Thu, 28 Jul 2011 16:59:20 +0000 (09:59 -0700)]
exp/template: make Set.ParseFile etc resolve functions in the Set
Fixes #2114

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

12 years agocgo: add GoBytes, fix gmp example
Russ Cox [Thu, 28 Jul 2011 16:39:50 +0000 (12:39 -0400)]
cgo: add GoBytes, fix gmp example

Fixes #1640.
Fixes #2007.

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

12 years agogc: another width test
Russ Cox [Thu, 28 Jul 2011 16:32:43 +0000 (12:32 -0400)]
gc: another width test

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

12 years agogc: line number + type checking nits
Russ Cox [Thu, 28 Jul 2011 16:31:16 +0000 (12:31 -0400)]
gc: line number + type checking nits

Fixes #1910.
Fixes #1979.
Fixes #1990.
Fixes #1993.
Fixes #2089.

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

12 years agoexp/template: make Set.MustParse* methods return the set.
Roger Peppe [Thu, 28 Jul 2011 15:41:06 +0000 (08:41 -0700)]
exp/template: make Set.MustParse* methods return the set.
This brings them into line with the Template.MustParse* methods
and makes it possible to use them in global variable initializations.

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

12 years agold: remove cseekend and redo pe writing
Alex Brainman [Thu, 28 Jul 2011 04:30:52 +0000 (14:30 +1000)]
ld: remove cseekend and redo pe writing

Simplify code and add more checks.

Fixes #2105.

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

12 years agorpc and exp/template: simplify tests for exported items
Rob Pike [Thu, 28 Jul 2011 04:26:16 +0000 (21:26 -0700)]
rpc and exp/template: simplify tests for exported items
Fix code to count mallocs - needed to call UpdateMemStats.

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

12 years agoimage/tiff: Do not panic when RowsPerStrip is missing.
Benny Siegert [Thu, 28 Jul 2011 01:15:59 +0000 (11:15 +1000)]
image/tiff: Do not panic when RowsPerStrip is missing.

The RowsPerStrip tag is mandatory according to the spec. However,
Mac OS sometimes (?) omits it. I managed to create such an image
by applying "tiffutil -none" on a compressed image.

If RowsPerStrip is 0, there was a division by zero in the decoder.
Assume that the image is a single strip in this case.

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

12 years agogc: top-level closure bug
Russ Cox [Wed, 27 Jul 2011 23:31:11 +0000 (19:31 -0400)]
gc: top-level closure bug

Fixes #2055.

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

12 years agogc: composite literal double eval bug
Russ Cox [Wed, 27 Jul 2011 22:55:30 +0000 (18:55 -0400)]
gc: composite literal double eval bug

Fixes #2086.

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

12 years agounicode: fix case-mapping for roman numerals!!
Rob Pike [Wed, 27 Jul 2011 22:54:23 +0000 (15:54 -0700)]
unicode: fix case-mapping for roman numerals!!
Hurray!
Also fix the mystical U+0345 COMBINING GREEK YPOGEGRAMMENI,
so everyone is satisfied.
Also add a -local flag to use local files for faster turnaround
when debugging.

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

12 years agocontainer/vector: removed some uses of container/vector in other pkgs
John Asmuth [Wed, 27 Jul 2011 22:23:42 +0000 (15:23 -0700)]
container/vector: removed some uses of container/vector in other pkgs

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

12 years agoA+C: John Asmuth
Andrew Gerrand [Wed, 27 Jul 2011 22:23:14 +0000 (15:23 -0700)]
A+C: John Asmuth

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

12 years agogodoc: app engine configuration and updated documentation
Robert Griesemer [Wed, 27 Jul 2011 22:14:12 +0000 (15:14 -0700)]
godoc: app engine configuration and updated documentation

Also: Fixed an error message in zip.go.

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

12 years agogc: use more Go-like names for methods
Russ Cox [Wed, 27 Jul 2011 21:56:13 +0000 (17:56 -0400)]
gc: use more Go-like names for methods

Fixes #991.

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

12 years agogc: diagnose (x) := 0
Russ Cox [Wed, 27 Jul 2011 21:39:30 +0000 (17:39 -0400)]
gc: diagnose (x) := 0

Fixes #1756.

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

12 years agobuild: fix for noclobber users
Russ Cox [Wed, 27 Jul 2011 21:38:39 +0000 (17:38 -0400)]
build: fix for noclobber users

Fixes #2020.

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

12 years agogc: zero-width struct, zero-length array fixes
Russ Cox [Wed, 27 Jul 2011 20:47:45 +0000 (16:47 -0400)]
gc: zero-width struct, zero-length array fixes

Fixes #1774.
Fixes #2095.
Fixes #2097.

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

12 years agogc: iota outside const
Russ Cox [Wed, 27 Jul 2011 18:45:27 +0000 (14:45 -0400)]
gc: iota outside const

Fixes #1662.

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

12 years agogc: echo literal in error message
Russ Cox [Wed, 27 Jul 2011 18:36:21 +0000 (14:36 -0400)]
gc: echo literal in error message

Fixes #1192.

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

12 years agoruntime: higher goroutine arg limit, clearer error
Russ Cox [Wed, 27 Jul 2011 16:41:46 +0000 (12:41 -0400)]
runtime: higher goroutine arg limit, clearer error

Fixes #591.

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

12 years agoreflect: rename new TestVariadic to TestVariadicType.
David Symonds [Wed, 27 Jul 2011 03:44:57 +0000 (13:44 +1000)]
reflect: rename new TestVariadic to TestVariadicType.

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

12 years agoreflect: doc fixes for obsolete types.
David Symonds [Wed, 27 Jul 2011 03:29:44 +0000 (13:29 +1000)]
reflect: doc fixes for obsolete types.

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

12 years agogoinstall: generate makefiles using exp/template
Rob Pike [Tue, 26 Jul 2011 21:45:36 +0000 (14:45 -0700)]
goinstall: generate makefiles using exp/template

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

12 years agorpc: convert /debug/rpc handler to exp/template
Rob Pike [Tue, 26 Jul 2011 21:44:51 +0000 (14:44 -0700)]
rpc: convert /debug/rpc handler to exp/template

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

12 years agohttp: set content type for fileserver directory listings
Robert Griesemer [Tue, 26 Jul 2011 18:30:11 +0000 (11:30 -0700)]
http: set content type for fileserver directory listings

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

12 years agogc, runtime: fix range+panic line number bugs
Russ Cox [Tue, 26 Jul 2011 04:52:46 +0000 (00:52 -0400)]
gc, runtime: fix range+panic line number bugs

Fixes #1856.

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

12 years agogc: fix select line number
Russ Cox [Tue, 26 Jul 2011 04:52:17 +0000 (00:52 -0400)]
gc: fix select line number

Fixes #1393.

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

12 years agogc: disallow [...][...]int{{1,2,3}}
Russ Cox [Tue, 26 Jul 2011 04:52:02 +0000 (00:52 -0400)]
gc: disallow [...][...]int{{1,2,3}}

Fixes #1600.

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

12 years agoruntime: fix freebsd build
Mikio Hara [Tue, 26 Jul 2011 04:49:32 +0000 (00:49 -0400)]
runtime: fix freebsd build

Fixes #2078.

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

12 years agobuild: remove rm dreg
Russ Cox [Tue, 26 Jul 2011 04:30:39 +0000 (00:30 -0400)]
build: remove rm dreg

Undo CL 4254056 now that enough time has elapsed
that people with old trees have all built and removed
those files (which are no longer generated in that location).

Fixes #1581.

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

12 years agohttp: implement MP4 sniffing.
David Symonds [Tue, 26 Jul 2011 03:28:20 +0000 (13:28 +1000)]
http: implement MP4 sniffing.

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

12 years agonet: fix memory corruption in windows *netFD.ReadFrom
Alex Brainman [Tue, 26 Jul 2011 01:55:52 +0000 (11:55 +1000)]
net: fix memory corruption in windows *netFD.ReadFrom

We must keep memory used by syscall.WSARecvFrom away from
garbage collector until after overlapped call is completed.

Fixes #2094.

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

12 years agogoinstall: abort and warn when using any url scheme, not just 'http://'
Andrew Gerrand [Mon, 25 Jul 2011 18:16:34 +0000 (04:16 +1000)]
goinstall: abort and warn when using any url scheme, not just 'http://'

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

12 years agold: fix build on Plan 9
Lucio De Re [Mon, 25 Jul 2011 17:45:50 +0000 (13:45 -0400)]
ld: fix build on Plan 9

ld/data.c:
. Format specifier with corresponding cast to cater for all
  architectures (llux and vlong).

ld/ldelf.c:
ld/ldmacho.c:
. Missing "pn" argument in diag() calls.

ld/ldpe.c:
. Dropped "sym->sectnum" in diag() call.
. Typo in a comment.

ld/lib.h:
. Added varargck pragma for "O".

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

12 years agobuild: define getcallerpc in u.h (fix for Plan 9 build)
Lucio De Re [Mon, 25 Jul 2011 17:45:44 +0000 (13:45 -0400)]
build: define getcallerpc in u.h (fix for Plan 9 build)

. By defining getcallerpc(x) as __builtin_return_address(0)
  here, it becomes possible to use the Plan 9 compatible form
  when compiling using GCC.  The alternative is to add conditional
  compilation based on the compiler identity in "cmd/8g/gsubr.c"
  to distinguish between the two cases.

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

12 years agogc: fix mkbuiltin for Plan 9 build
Lucio De Re [Mon, 25 Jul 2011 17:45:37 +0000 (13:45 -0400)]
gc: fix mkbuiltin for Plan 9 build

. Replaced Posix #includes with u.h and libc.h.
. Replaced fprintf(stderr,...); exit(1); with sysfatal() calls.

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

12 years agobuild: fixes for mingw-w64
Wei Guangjing [Mon, 25 Jul 2011 17:39:01 +0000 (13:39 -0400)]
build: fixes for mingw-w64

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

12 years agold: don't skip first 2 symbols in ldpe.
Wei Guangjing [Mon, 25 Jul 2011 16:25:44 +0000 (12:25 -0400)]
ld: don't skip first 2 symbols in ldpe.
some object files don't has file name symbol.

R=golang-dev, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/4814051

12 years agoruntime: Plan 9, skip calling runtime·ldt0setup.
Yuval Pavel Zholkover [Mon, 25 Jul 2011 16:25:41 +0000 (12:25 -0400)]
runtime: Plan 9, skip calling runtime·ldt0setup.

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

12 years agoruntime: fix compilation of send select cases
Dmitriy Vyukov [Mon, 25 Jul 2011 16:25:37 +0000 (12:25 -0400)]
runtime: fix compilation of send select cases

Fixes #2102.

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

12 years agosyscall: remove unused windows code and comments
Alex Brainman [Mon, 25 Jul 2011 16:25:23 +0000 (12:25 -0400)]
syscall: remove unused windows code and comments

R=golang-dev, vcc.163, rsc
CC=golang-dev
https://golang.org/cl/4826042

12 years agoruntime: remove rnd calls that pass a second argument of 1
Ian Lance Taylor [Mon, 25 Jul 2011 05:03:17 +0000 (22:03 -0700)]
runtime: remove rnd calls that pass a second argument of 1

When rnd is called with a second argument of 1, it simply
returns the first argument anyway.

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

12 years agoexp/regexp: implement regexp API using exp/regexp/syntax
Russ Cox [Sun, 24 Jul 2011 21:00:28 +0000 (17:00 -0400)]
exp/regexp: implement regexp API using exp/regexp/syntax

Still need to write tests for new syntax
and fix bugs that the tests find, but this
is a good check point.

All tests pass.

Compared against existing regexp:

benchmark                                old ns/op    new ns/op    delta
regexp.BenchmarkLiteral                       1869          620  -66.83%
regexp.BenchmarkNotLiteral                    9489         7823  -17.56%
regexp.BenchmarkMatchClass                   10372         8386  -19.15%
regexp.BenchmarkMatchClass_InRange           10800         7750  -28.24%
regexp.BenchmarkReplaceAll                   13492         8519  -36.86%
regexp.BenchmarkAnchoredLiteralShortNonMatch   747          339  -54.62%
regexp.BenchmarkAnchoredLiteralLongNonMatch    599          335  -44.07%
regexp.BenchmarkAnchoredShortMatch            2137          917  -57.09%
regexp.BenchmarkAnchoredLongMatch             2029          917  -54.81%

R=r, r
CC=golang-dev, sam.thorogood
https://golang.org/cl/4820046

12 years agogoinstall: write to goinstall.log in respective GOPATH
Andrew Gerrand [Sun, 24 Jul 2011 03:43:08 +0000 (13:43 +1000)]
goinstall: write to goinstall.log in respective GOPATH
goinstall: report every newly installed package to the dashboard

This makes "goinstall -a" work on systems with GOROOTs that are
not user-writable, as is the case with Debian's Go packages.

This also makes goinstall.log the canonical list of installed
packages, in that only packages new to goinstall.log are reported to
the dashboard.

A side-effect is that writing to goinstall.log is now mandatory.
(A bug in the original implementation meant this was the case, anyway.)

The principal benefit of this change is that multiple packages from the
same repository can now be reported to the dashboard.  It is also less
likely for a user to report multiple installations of the same package
to the dashboard (they would need to remove the package from
goinstall.log first).

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

12 years agounicode: fix doc comment for Range32
Andrew Balholm [Sun, 24 Jul 2011 00:51:19 +0000 (10:51 +1000)]
unicode: fix doc comment for Range32

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

12 years agosort: fixed bug in (Float64Slice) Less; NaN less than anything else
Florian Uekermann [Sat, 23 Jul 2011 19:47:06 +0000 (15:47 -0400)]
sort: fixed bug in (Float64Slice) Less; NaN less than anything else

Previously comparisons with NaN led to contradictory results if it was
compared to anything not NaN, since Less always returned false, thus
breaking monotonicity of ordering.
This fix makes NaN less than anything else and adds NaN and (+-)Inf to
testcases.

Fixes #2092.

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

12 years agoruntime: replace byte-at-a-time zeroing loop with memclr
Quan Yong Zhai [Sat, 23 Jul 2011 19:46:58 +0000 (15:46 -0400)]
runtime: replace byte-at-a-time zeroing loop with memclr

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

12 years agoruntime: faster entersyscall/exitsyscall
Russ Cox [Sat, 23 Jul 2011 16:22:55 +0000 (12:22 -0400)]
runtime: faster entersyscall/exitsyscall

Replace cas with xadd in scheduler.
Suggested by Dmitriy in last code review.
Verified with Promela model.

When there's actual contention for the atomic word,
this avoids the looping that compare-and-swap requires.

benchmark                            old ns/op    new ns/op    delta
runtime_test.BenchmarkSyscall               32           26  -17.08%
runtime_test.BenchmarkSyscall-2            155           59  -61.81%
runtime_test.BenchmarkSyscall-3            112           52  -52.95%
runtime_test.BenchmarkSyscall-4             94           48  -48.57%
runtime_test.BenchmarkSyscallWork          871          872   +0.11%
runtime_test.BenchmarkSyscallWork-2        481          477   -0.83%
runtime_test.BenchmarkSyscallWork-3        338          335   -0.89%
runtime_test.BenchmarkSyscallWork-4        263          256   -2.66%

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

12 years agold: fixes .bss for ldpe
Wei Guangjing [Sat, 23 Jul 2011 16:21:13 +0000 (12:21 -0400)]
ld: fixes .bss for ldpe

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

12 years agoexp/template: construct sets from plain template files
Rob Pike [Sat, 23 Jul 2011 08:10:30 +0000 (18:10 +1000)]
exp/template: construct sets from plain template files
This is the last piece (I hope) of the set creation code.
These helpers create sets from files containing individual
template definitions, free of {{define}} clauses. This
design is helpful if the templates live one per file,
undecorated.

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

12 years agofix build: clean up file end in an attempt to fix build
Robert Griesemer [Sat, 23 Jul 2011 05:45:14 +0000 (22:45 -0700)]
fix build: clean up file end in an attempt to fix build

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

12 years agogodoc/httpzip.go: use correct path in Readdir
Robert Griesemer [Sat, 23 Jul 2011 05:24:04 +0000 (22:24 -0700)]
godoc/httpzip.go: use correct path in Readdir

Fixes a problem where Readdir would always return
empty directories (Readdir is only called by godoc
if the usual directory handler is commented out
in godoc.go, and if a zip file system is provided;
thus, this bug never manifested itself in godoc).

Also:
- better choice of variable/field names
- simplified error handling a bit
- better comments

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

12 years agozip: add a test for the previous >65k files fix
Brad Fitzpatrick [Sat, 23 Jul 2011 01:30:07 +0000 (18:30 -0700)]
zip: add a test for the previous >65k files fix

This surprisingly takes 30 seconds on my fast machine
so disabling by default. Need to optimize the Writer
at some point.

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

12 years agolib9: use $PWD in getwd
Russ Cox [Sat, 23 Jul 2011 01:21:17 +0000 (21:21 -0400)]
lib9: use $PWD in getwd

This makes the full file paths recorded by 6g
prefer $PWD over the actual directory name
(relevant when $PWD gets to the current directory
via symlinks).  It's what everyone else does, and
what people expect.

R=iant, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4824041

12 years agold: fixes ldpe link with SXREF global values.
Wei Guangjing [Sat, 23 Jul 2011 01:21:08 +0000 (21:21 -0400)]
ld: fixes ldpe link with SXREF global values.

R=golang-dev, mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/4794052

12 years agold: detect all import cycles
Russ Cox [Sat, 23 Jul 2011 01:18:03 +0000 (21:18 -0400)]
ld: detect all import cycles

Fixes #2052.

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

12 years agosort: remove testing cycle
Russ Cox [Sat, 23 Jul 2011 01:17:46 +0000 (21:17 -0400)]
sort: remove testing cycle

import cycle:
        "testing"
        imports "flag"
        imports "sort"
        imports "testing"

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

12 years agogodoc/zip.go: fix another zip file system bug
Robert Griesemer [Fri, 22 Jul 2011 22:21:50 +0000 (15:21 -0700)]
godoc/zip.go: fix another zip file system bug

Don't report that a directory was found just because we found
the list index where the directory would be if it were there...

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

12 years agogo/parser: report illegal label declarations at ':' rather than guessing the start
Robert Griesemer [Fri, 22 Jul 2011 16:55:37 +0000 (09:55 -0700)]
go/parser: report illegal label declarations at ':' rather than guessing the start

Also:
- Add parser.SpuriousError flag. If set, the parser reports all (including
  spurious) errors rather then at most one error per line.
- Add -e flag to gofmt and gotype: If set, gofmt and gotype report all
  (including spurious) errors rather than at most one error per line.
- Updated the respective documentation.

Fixes #2088.

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

12 years agogoyacc: cleanups
Rob Pike [Fri, 22 Jul 2011 07:58:38 +0000 (17:58 +1000)]
goyacc: cleanups
- remove calls to print
- make units compile again
- make units.y closer to gofmt style

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

12 years agoexp/template: trivial cleanup in test
Rob Pike [Fri, 22 Jul 2011 07:52:46 +0000 (17:52 +1000)]
exp/template: trivial cleanup in test
Clean up glitch created by flurry of editing.

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

12 years agopkg/http: fix a couple of error messages
Rob Pike [Fri, 22 Jul 2011 07:11:44 +0000 (17:11 +1000)]
pkg/http: fix a couple of error messages

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

12 years agoarchive/zip: handle zip files with more than 65535 files
Andrew Gerrand [Fri, 22 Jul 2011 04:57:17 +0000 (14:57 +1000)]
archive/zip: handle zip files with more than 65535 files

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

12 years agoruntime: add UpdateMemStats, use in tests
Russ Cox [Fri, 22 Jul 2011 04:55:01 +0000 (00:55 -0400)]
runtime: add UpdateMemStats, use in tests

Drops mallocrep1.go back to a reasonable
amount of time.  (154 -> 0.8 seconds on my Mac)

Fixes #2085.

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

12 years agoexp/template: add globbing helpers to load groups of files into sets.
Rob Pike [Fri, 22 Jul 2011 03:55:45 +0000 (13:55 +1000)]
exp/template: add globbing helpers to load groups of files into sets.
Also make the Set.Parse methods variadic so you can parse static lists of files without loops.

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

12 years agohttp: clarify use of w.conn.body in Write when sniffing.
David Symonds [Fri, 22 Jul 2011 03:52:21 +0000 (13:52 +1000)]
http: clarify use of w.conn.body in Write when sniffing.

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

12 years agoexp/template: plain actions with declarations should produce no output.
Rob Pike [Fri, 22 Jul 2011 00:51:40 +0000 (10:51 +1000)]
exp/template: plain actions with declarations should produce no output.
This is already the behavior for pipelines producing values for if, with, and range.

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

12 years agoexp/template: fix action variable declarations inside range
Roger Peppe [Thu, 21 Jul 2011 23:53:25 +0000 (09:53 +1000)]
exp/template: fix action variable declarations inside range

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

12 years agobig: minor comment adjustments
Robert Griesemer [Thu, 21 Jul 2011 22:01:58 +0000 (15:01 -0700)]
big: minor comment adjustments

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

12 years agobig: refine printf formatting and optimize string conversion
Michael T. Jones [Thu, 21 Jul 2011 21:29:08 +0000 (14:29 -0700)]
big: refine printf formatting and optimize string conversion

Now handles standard precision specifications, standard interactions of
redundant specifications (such as precision and zero-fill), handles the
special case of precision specified but equal to zero, and generates the
output without recursive calls to format/printf to be clearer and faster.

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

12 years agohttp: fix chunking bug during content sniffing
Russ Cox [Thu, 21 Jul 2011 18:29:14 +0000 (14:29 -0400)]
http: fix chunking bug during content sniffing

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

12 years agogc: select functions are no longer special
Russ Cox [Thu, 21 Jul 2011 18:10:39 +0000 (14:10 -0400)]
gc: select functions are no longer special

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

12 years agoruntime: faster select
Dmitriy Vyukov [Thu, 21 Jul 2011 17:57:13 +0000 (13:57 -0400)]
runtime: faster select

Make selectsend() accept pointer to the element,
it makes it possible to make Scase fixed-size
and allocate/free Select, all Scase's and all SudoG at once.
As a consequence SudoG freelist die out.

benchmark                       old,ns/op  new,ns/op
BenchmarkSelectUncontended      1080        558
BenchmarkSelectUncontended-2       675        264
BenchmarkSelectUncontended-4       459        205
BenchmarkSelectContended      1086        560
BenchmarkSelectContended-2      1775       1672
BenchmarkSelectContended-4      2668       2149
(on Intel Q6600, 4 cores, 2.4GHz)

benchmark                       old ns/op    new ns/op    delta
BenchmarkSelectUncontended         517.00       326.00  -36.94%
BenchmarkSelectUncontended-2       281.00       166.00  -40.93%
BenchmarkSelectUncontended-4       250.00        83.10  -66.76%
BenchmarkSelectUncontended-8       107.00        47.40  -55.70%
BenchmarkSelectUncontended-16       67.80        41.30  -39.09%
BenchmarkSelectContended           513.00       325.00  -36.65%
BenchmarkSelectContended-2         699.00       628.00  -10.16%
BenchmarkSelectContended-4        1085.00      1092.00   +0.65%
BenchmarkSelectContended-8        3253.00      2477.00  -23.85%
BenchmarkSelectContended-16       5313.00      5116.00   -3.71%
(on Intel E5620, 8 HT cores, 2.4 GHz)

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

12 years agoundo CL 4808044 / 1bd754e69ce7
Russ Cox [Thu, 21 Jul 2011 17:25:55 +0000 (13:25 -0400)]
undo CL 4808044 / 1bd754e69ce7

ServeMux depends on having a URL
in order to mux.  It might be that the right
fix is to have CONNECT handlers just not
look at URL.

««« original CL description
http: do not parse req.URL for CONNECT

CONNECT's argument is not a URL.

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

»»»

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/4798046

12 years agohttp: do not parse req.URL for CONNECT
Yasuhiro Matsumoto [Thu, 21 Jul 2011 15:33:59 +0000 (11:33 -0400)]
http: do not parse req.URL for CONNECT

CONNECT's argument is not a URL.

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

12 years agotesting: output benchmark name before executing it
Dmitriy Vyukov [Thu, 21 Jul 2011 15:31:07 +0000 (11:31 -0400)]
testing: output benchmark name before executing it
It makes it clear what benchmark is currently running.
Especially useful in case of hangup or crash.

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