]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agonet: use F_DUPFD_CLOEXEC when duping fds
Brad Fitzpatrick [Mon, 5 Aug 2013 22:43:45 +0000 (15:43 -0700)]
net: use F_DUPFD_CLOEXEC when duping fds

This means that in the common case (modern kernel), we only
make 1 system call to dup instead of two, and we also avoid
grabbing the syscall.ForkLock.

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

11 years agoreflect: Get rid of the test for the error message when
Keith Randall [Mon, 5 Aug 2013 22:08:37 +0000 (15:08 -0700)]
reflect: Get rid of the test for the error message when
you do reflect.call with too big an argument list.
Not worth the hassle.

Fixes #6023
Fixes #6033

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

11 years agostrings: use runtime assembly for IndexByte
Brad Fitzpatrick [Mon, 5 Aug 2013 22:04:05 +0000 (15:04 -0700)]
strings: use runtime assembly for IndexByte

Fixes #3751

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/12483043

11 years agoruntime: tune append crossover on amd64 and 386
Dave Cheney [Mon, 5 Aug 2013 21:51:37 +0000 (07:51 +1000)]
runtime: tune append crossover on amd64 and 386

Fixes #4963.

Sets the append crossover to 0 on intel platforms.

Results for linux/amd64 Core i5 SNB

benchmark                     old ns/op    new ns/op    delta
BenchmarkAppend                     102          104   +1.96%
BenchmarkAppend1Byte                 10           11   +0.92%
BenchmarkAppend4Bytes                15           11  -28.10%
BenchmarkAppend7Bytes                17           12  -32.58%
BenchmarkAppend8Bytes                18           12  -36.17%
BenchmarkAppend15Bytes               24           11  -55.02%
BenchmarkAppend16Bytes               25           11  -56.03%
BenchmarkAppend32Bytes               11           12   +4.31%
BenchmarkAppendStr1Byte               8            9  +13.99%
BenchmarkAppendStr4Bytes             11            9  -17.52%
BenchmarkAppendStr8Bytes             14            9  -35.70%
BenchmarkAppendStr16Bytes            21            9  -55.19%
BenchmarkAppendStr32Bytes            10           10   -5.66%
BenchmarkAppendSpecialCase           49           52   +7.96%

Results for linux/386 Atom(TM) CPU 330 @ 1.60GHz

benchmark                     old ns/op    new ns/op    delta
BenchmarkAppend                     219          218   -0.46%
BenchmarkAppend1Byte                 75           72   -3.44%
BenchmarkAppend4Bytes                92           73  -19.87%
BenchmarkAppend7Bytes               108           74  -31.20%
BenchmarkAppend8Bytes               116           74  -35.95%
BenchmarkAppend15Bytes              162           77  -52.22%
BenchmarkAppend16Bytes              169           77  -54.20%
BenchmarkAppend32Bytes               88           86   -2.38%
BenchmarkAppendStr1Byte              57           59   +3.32%
BenchmarkAppendStr4Bytes             72           59  -17.40%
BenchmarkAppendStr8Bytes             92           60  -34.70%
BenchmarkAppendStr16Bytes           141           63  -54.89%
BenchmarkAppendStr32Bytes            75           73   -2.64%
BenchmarkAppendSpecialCase          270          270   +0.00%

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

11 years agocmd/gc: get rid of redundant slice bound check.
Keith Randall [Mon, 5 Aug 2013 20:24:33 +0000 (13:24 -0700)]
cmd/gc: get rid of redundant slice bound check.

For normal slices a[i:j] we're generating 3 bounds
checks: j<={len(string),cap(slice)}, j<=j (!), and i<=j.
Somehow snuck in as part of the [i:j:k] implementation
where the second check does something.
Remove the second check when we don't need it.

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

11 years agocmd/gc: fix inlining of unnamed structs with embedded fields.
Rémy Oudompheng [Mon, 5 Aug 2013 20:09:53 +0000 (22:09 +0200)]
cmd/gc: fix inlining of unnamed structs with embedded fields.

Update #5910.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/11373044

11 years agocompress/bzip2: support concatenated files
Russ Cox [Mon, 5 Aug 2013 20:08:08 +0000 (16:08 -0400)]
compress/bzip2: support concatenated files

While we're here, add a test for the same functionality in gzip,
which was already implemented, and add bzip2 CRC checks.

Fixes #5772.

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

11 years agoruntime: remove debugging knob to turn off preemption
Russ Cox [Mon, 5 Aug 2013 20:06:24 +0000 (16:06 -0400)]
runtime: remove debugging knob to turn off preemption

It's still easy to turn off, but the builders are happy.
Also document.

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

11 years agoundo CL 12250043 / e911f94c4902
Dmitriy Vyukov [Mon, 5 Aug 2013 19:33:50 +0000 (23:33 +0400)]
undo CL 12250043 / e911f94c4902

Break all 386 builders.

««« original CL description
runtime: use gcpc/gcsp during traceback of goroutines in syscalls
gcpc/gcsp are used by GC in similar situation.
gcpc/gcsp are also more stable than gp->sched,
because gp->sched is mutated by entersyscall/exitsyscall
in morestack and mcall. So it has higher chances of being inconsistent.
Also, rename gcpc/gcsp to syscallpc/syscallsp.

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

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

11 years agoos, syscall: implement Getwd on darwin using getattrlist
Brad Fitzpatrick [Mon, 5 Aug 2013 19:26:05 +0000 (12:26 -0700)]
os, syscall: implement Getwd on darwin using getattrlist

Fixes #4807

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

11 years agoruntime: remove singleproc var
Dmitriy Vyukov [Mon, 5 Aug 2013 18:58:02 +0000 (22:58 +0400)]
runtime: remove singleproc var
It was needed for the old scheduler,
because there temporary could be more threads than gomaxprocs.
In the new scheduler gomaxprocs is always respected.

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

11 years agoruntime: use gcpc/gcsp during traceback of goroutines in syscalls
Dmitriy Vyukov [Mon, 5 Aug 2013 18:55:54 +0000 (22:55 +0400)]
runtime: use gcpc/gcsp during traceback of goroutines in syscalls
gcpc/gcsp are used by GC in similar situation.
gcpc/gcsp are also more stable than gp->sched,
because gp->sched is mutated by entersyscall/exitsyscall
in morestack and mcall. So it has higher chances of being inconsistent.
Also, rename gcpc/gcsp to syscallpc/syscallsp.

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

11 years agocrypto/cipher: add GCM mode.
Adam Langley [Mon, 5 Aug 2013 18:31:58 +0000 (14:31 -0400)]
crypto/cipher: add GCM mode.

GCM is Galois Counter Mode, an authenticated encryption mode that is,
nearly always, used with AES.

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

11 years agocrypto: include hash number in panic message.
Adam Langley [Mon, 5 Aug 2013 18:23:32 +0000 (14:23 -0400)]
crypto: include hash number in panic message.

In the event that code tries to use a hash function that isn't compiled
in and panics, give the developer a fighting chance of figuring out
which hash function it needed.

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

11 years agomisc/notepadplus: add Function List support
ChaiShushan [Mon, 5 Aug 2013 15:24:55 +0000 (08:24 -0700)]
misc/notepadplus: add Function List support

Fixes #6045.

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

11 years agodoc/progs/slices.go: fix typo in comment
Rob Pike [Mon, 5 Aug 2013 03:35:42 +0000 (13:35 +1000)]
doc/progs/slices.go: fix typo in comment

Fixes #6025.

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

11 years agonet: fix some test bug
ChaiShushan [Mon, 5 Aug 2013 01:59:59 +0000 (11:59 +1000)]
net: fix some test bug

Fixes #5785.

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

11 years agodoc/effective_go.html: remove spurious word
Rob Pike [Mon, 5 Aug 2013 01:24:27 +0000 (11:24 +1000)]
doc/effective_go.html: remove spurious word

Fixes #6003.

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

11 years agotime: match month and day names only when not followed immediately by a lower-case...
Rob Pike [Mon, 5 Aug 2013 00:53:46 +0000 (10:53 +1000)]
time: match month and day names only when not followed immediately by a lower-case letter
Avoids seeing "Janet" as "Januaryet".

Fixes #6020.

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

11 years agoruntime: remove unused scheduler knob
Dmitriy Vyukov [Sun, 4 Aug 2013 19:32:40 +0000 (23:32 +0400)]
runtime: remove unused scheduler knob
Blockingsyscall was used in net package on windows,
it's not used anymore.

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

11 years agoruntime: remove dead code
Dmitriy Vyukov [Sun, 4 Aug 2013 19:32:06 +0000 (23:32 +0400)]
runtime: remove dead code
Remove dead code related to allocation of type metadata with SysAlloc.

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

11 years agonet: fix concurrent Accept on windows
Dmitriy Vyukov [Sun, 4 Aug 2013 19:31:23 +0000 (23:31 +0400)]
net: fix concurrent Accept on windows
Runtime netpoll supports at most one read waiter
and at most one write waiter. It's responsibility
of net package to ensure that. Currently windows
implementation allows more than one waiter in Accept.
It leads to "fatal error: netpollblock: double wait".

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

11 years agonet/http: fix Response.Header documentation for multiple headers with same key
Josh Bleecher Snyder [Sun, 4 Aug 2013 18:23:17 +0000 (11:23 -0700)]
net/http: fix Response.Header documentation for multiple headers with same key

Whether the keys are concatenated or separate (or a mixture) depends on the server.

Fixes #5979.

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

11 years agoruntime: disable dynamic priority boosting on windows
Dmitriy Vyukov [Sun, 4 Aug 2013 10:08:13 +0000 (14:08 +0400)]
runtime: disable dynamic priority boosting on windows
Windows dynamic priority boosting assumes that a process has different types
of dedicated threads -- GUI, IO, computational, etc. Go processes use
equivalent threads that all do a mix of GUI, IO, computations, etc.
In such context dynamic priority boosting does nothing but harm, so turn it off.
In particular, if 2 goroutines do heavy IO on a server uniprocessor machine,
windows rejects to schedule timer thread for 2+ seconds when priority boosting is enabled.
Fixes #5971.

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

11 years agohtml/template: delete panic recovery code from test
Rob Pike [Sat, 3 Aug 2013 23:06:14 +0000 (09:06 +1000)]
html/template: delete panic recovery code from test

The test isn't checking deliberate panics so catching them just makes the code longer.

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

11 years agohtml/template: handle nils during indirection
Josh Bleecher Snyder [Sat, 3 Aug 2013 22:41:19 +0000 (08:41 +1000)]
html/template: handle nils during indirection

Fixes #5982.

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

11 years agoA+C: Josh Bleecher Snyder (individual CLA)
Rob Pike [Sat, 3 Aug 2013 22:41:02 +0000 (08:41 +1000)]
A+C: Josh Bleecher Snyder (individual CLA)

Generated by addca.

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

11 years agolibbio: add casts to remove -Wconversion warnings
Ian Lance Taylor [Sat, 3 Aug 2013 18:36:47 +0000 (11:36 -0700)]
libbio: add casts to remove -Wconversion warnings

Update #5764

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

11 years agocmd/dist: generate cmd/cgo/zdefaultcc.go on windows (fixes windows build)
Alex Brainman [Sat, 3 Aug 2013 08:32:14 +0000 (18:32 +1000)]
cmd/dist: generate cmd/cgo/zdefaultcc.go on windows (fixes windows build)

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

11 years agovarious: deleted unused items
Rob Pike [Sat, 3 Aug 2013 06:01:04 +0000 (16:01 +1000)]
various: deleted unused items

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

11 years agonet: reduce unnecessary syscall.Sockaddr conversions
Mikio Hara [Sat, 3 Aug 2013 04:32:22 +0000 (13:32 +0900)]
net: reduce unnecessary syscall.Sockaddr conversions

This CL makes IPAddr, UDPAddr and TCPAddr implement sockaddr
interface, UnixAddr is already sockaddr interface compliant, and
reduces unnecessary conversions between net.Addr, net.sockaddr and
syscall.Sockaddr.

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

Update #5199

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

11 years agonet: make IP address selection work correctly on IPv6-only kernel
Mikio Hara [Sat, 3 Aug 2013 03:17:01 +0000 (12:17 +0900)]
net: make IP address selection work correctly on IPv6-only kernel

Update #3610
Update #5267
Update #5707

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

11 years agobuild: ignore new zfiles, delete temp goplay binary in run.bash
Brad Fitzpatrick [Sat, 3 Aug 2013 02:14:13 +0000 (19:14 -0700)]
build: ignore new zfiles, delete temp goplay binary in run.bash

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

11 years agocmd/dist: fix windows build.
Rémy Oudompheng [Fri, 2 Aug 2013 21:29:04 +0000 (14:29 -0700)]
cmd/dist: fix windows build.

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

11 years agocmd/go: fix build
Brad Fitzpatrick [Fri, 2 Aug 2013 21:28:52 +0000 (14:28 -0700)]
cmd/go: fix build

This was missed in c3b45d0dc5c0

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

11 years agocmd/go: Fix go get when the fetched XML uses ASCII encoding
Alberto García Hierro [Fri, 2 Aug 2013 21:15:33 +0000 (14:15 -0700)]
cmd/go: Fix go get when the fetched XML uses ASCII encoding

Also, add a meaningful error message when an encoding which
can't be parsed is found.

Fixes #5801.

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

11 years agoapi: update next.txt
Brad Fitzpatrick [Fri, 2 Aug 2013 20:15:49 +0000 (13:15 -0700)]
api: update next.txt

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

11 years agoruntime: reimplement reflect.call to not use stack splitting.
Keith Randall [Fri, 2 Aug 2013 20:03:14 +0000 (13:03 -0700)]
runtime: reimplement reflect.call to not use stack splitting.

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

11 years agocmd/dist: fix build again
Russ Cox [Fri, 2 Aug 2013 19:20:42 +0000 (15:20 -0400)]
cmd/dist: fix build again

I am really bad at this. Didn't hg add this file.

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

11 years agocmd/dist: fix build
Russ Cox [Fri, 2 Aug 2013 19:13:06 +0000 (15:13 -0400)]
cmd/dist: fix build

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

11 years agobuild: on OS X 10.8 and later, use clang instead of gcc
Russ Cox [Fri, 2 Aug 2013 18:58:27 +0000 (14:58 -0400)]
build: on OS X 10.8 and later, use clang instead of gcc

Fixes #5822.
Will no doubt cause other problems, but Apple has forced our hand.

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

11 years agotesting: make parsing of -cpu more lenient
Russ Cox [Fri, 2 Aug 2013 17:51:45 +0000 (13:51 -0400)]
testing: make parsing of -cpu more lenient

Also add \n to error message.

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

11 years agoruntime: in newstack, double-check calling goroutine
Russ Cox [Fri, 2 Aug 2013 17:51:28 +0000 (13:51 -0400)]
runtime: in newstack, double-check calling goroutine

Checking this condition helped me find the arm problem last night.

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

11 years agomisc/dist: don't ship cmd/api
Brad Fitzpatrick [Fri, 2 Aug 2013 17:19:52 +0000 (10:19 -0700)]
misc/dist: don't ship cmd/api

cmd/api is a tool to prevent the Go developers from breaking
the Go 1 API promise. It has no utility to end users and
doesn't run on arbitrary packages (it's always been full of
hacks for its bespoke type checker to work on the standard
library)

Robert's in-progress rewrite depends on the go.tools repo for
go/types, so we won't be able to ship this tool later
anyway. Just remove it from binary distributions.

A future change to run.bash can conditionally build & run
cmd/api, perhaps automatically fetching go/types if
necessary. I assume people don't want to vendor go/types into
a private gopath just for cmd/api.

I will need help with run.bat.

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

11 years agocmd/go: change error message to refer to correct bootstrap command
Alex Brainman [Fri, 2 Aug 2013 05:55:21 +0000 (15:55 +1000)]
cmd/go: change error message to refer to correct bootstrap command

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

11 years agoimage/draw: fix typos found by "go vet".
Nigel Tao [Fri, 2 Aug 2013 03:29:45 +0000 (13:29 +1000)]
image/draw: fix typos found by "go vet".

R=r, adg, bradfitz
CC=golang-dev
https://golang.org/cl/12312043

11 years agofmt: clean up some errors found by vet
Rob Pike [Fri, 2 Aug 2013 01:38:19 +0000 (11:38 +1000)]
fmt: clean up some errors found by vet
Includes deleting some unused items.

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

11 years agoruntime: disable preemption during software fp routines
Russ Cox [Fri, 2 Aug 2013 00:07:01 +0000 (20:07 -0400)]
runtime: disable preemption during software fp routines

It's okay to preempt at ordinary function calls because
compilers arrange that there are no live registers to save
on entry to the function call.

The software floating point routines are function calls
masquerading as individual machine instructions. They are
expected to keep all the registers intact. In particular,
they are expected not to clobber all the floating point
registers.

The floating point registers are kept per-M, because they
are not live at non-preemptive goroutine scheduling events,
and so keeping them per-M reduces the number of 132-byte
register blocks we are keeping in memory.

Because they are per-M, allowing the goroutine to be
rescheduled during software floating point simulation
would mean some other goroutine could overwrite the registers
or perhaps the goroutine would continue running on a different
M entirely.

Disallow preemption during the software floating point
routines to make sure that a function full of floating point
instructions has the same floating point registers throughout
its execution.

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

11 years agobytes: move IndexByte assembly to pkg runtime
Brad Fitzpatrick [Thu, 1 Aug 2013 23:11:19 +0000 (16:11 -0700)]
bytes: move IndexByte assembly to pkg runtime

Per suggestion from Russ in February. Then strings.IndexByte
can be implemented in terms of the shared code in pkg runtime.

Update #3751

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

11 years agonet/url: prepend slash to path in String()
Scott Ferguson [Thu, 1 Aug 2013 22:52:56 +0000 (15:52 -0700)]
net/url: prepend slash to path in String()

Previously if a path was set manually without a leading /, String()
would not insert the slash when writing its output. This would lead
to situations where a URL that should be http://www.google.com/search
is output as http://www.google.comsearch

Fixes #5927.

R=golang-dev, bradfitz, rsc, 0xjnml
CC=golang-dev
https://golang.org/cl/11698045

11 years agoruntime: fix traceback across morestack
Russ Cox [Thu, 1 Aug 2013 22:51:55 +0000 (18:51 -0400)]
runtime: fix traceback across morestack

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

11 years agoA+C: Scott Ferguson (individual CLA)
Brad Fitzpatrick [Thu, 1 Aug 2013 22:49:35 +0000 (15:49 -0700)]
A+C: Scott Ferguson (individual CLA)

Generated by addca.

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

11 years agocompress/flate: Fixed two panics on bad data
Pieter Droogendijk [Thu, 1 Aug 2013 22:20:01 +0000 (15:20 -0700)]
compress/flate: Fixed two panics on bad data

I used just enough of the data provided by Matt in Issue 5915 to trigger
issue 5915. As luck would have it, using slightly less of it triggered
issue 5962.

Fixes #5915.
Fixes #5962.

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

11 years agonet/http: don't write out invalid cookie lines
Brad Fitzpatrick [Thu, 1 Aug 2013 19:16:37 +0000 (12:16 -0700)]
net/http: don't write out invalid cookie lines

Fixes #3033

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

11 years agonet/http: document that Error is to be used with plain text
Andrew Balholm [Thu, 1 Aug 2013 19:05:05 +0000 (12:05 -0700)]
net/http: document that Error is to be used with plain text

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

11 years agostrings: add IndexByte, for consistency with bytes package
Brad Fitzpatrick [Thu, 1 Aug 2013 18:17:26 +0000 (11:17 -0700)]
strings: add IndexByte, for consistency with bytes package

I always forget which package has it.

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

11 years agocmd/ld: report pclntab, funcdata sizes in 6l -v output
Russ Cox [Thu, 1 Aug 2013 16:58:27 +0000 (12:58 -0400)]
cmd/ld: report pclntab, funcdata sizes in 6l -v output
Also move chatty recent additions to -v -v.

For what it's worth:

$ go build -o /dev/null -ldflags -v cmd/go
...
 0.87 pclntab=1110836 bytes, funcdata total 69700 bytes
...
$

This broke the ELF builds last time because I tried to dedup
the funcdata in case the same funcdata was pointed at by
multiple functions. That doesn't currently happen, so I've
removed that test.

If we start doing bitmap coalescing we'll need to figure out
how to measure the size more carefully, but I think at that
point the bitmaps will be an extra indirection away from the
funcdata anyway, so the dedup I used before wouldn't help.

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

11 years agostrconv: fix doc comment for IntSize
Russ Cox [Thu, 1 Aug 2013 15:34:25 +0000 (11:34 -0400)]
strconv: fix doc comment for IntSize

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

11 years agoruntime: print "created by" for running goroutines in traceback
Dmitriy Vyukov [Thu, 1 Aug 2013 15:28:38 +0000 (19:28 +0400)]
runtime: print "created by" for running goroutines in traceback
This allows to at least determine goroutine "identity".
Now it looks like:
goroutine 12 [running]:
        goroutine running on other thread; stack unavailable
created by testing.RunTests
        src/pkg/testing/testing.go:440 +0x88e

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

11 years agoruntime: remove unused var
Dmitriy Vyukov [Thu, 1 Aug 2013 14:26:21 +0000 (18:26 +0400)]
runtime: remove unused var

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

11 years agoruntime: make new tests shorter in short mode
Dmitriy Vyukov [Thu, 1 Aug 2013 14:25:36 +0000 (18:25 +0400)]
runtime: make new tests shorter in short mode
We see timeouts in these tests on some platforms,
but not on the others.  The hypothesis is that
the problematic platforms are slow uniprocessors.
Stack traces do not suggest that the process
is completely hang, and it is able to schedule
the alarm goroutine. And if it actually hangs,
we still will be able to detect that.

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

11 years agotesting: say what was the timeout if it fires
Dmitriy Vyukov [Thu, 1 Aug 2013 13:24:24 +0000 (17:24 +0400)]
testing: say what was the timeout if it fires
It looks reasonable here and may be useful.

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

11 years agoruntime: fix netbsd/arm build
Dmitriy Vyukov [Thu, 1 Aug 2013 11:19:45 +0000 (15:19 +0400)]
runtime: fix netbsd/arm build
Currently fails with:
fatal error: runtime: stack split during syscall
goroutine 2 [stack split]:
_vasop(0x3ac4a0, 0x505f8f00, 0x7a5a8, 0x7, 0x1ed3797f, ...)
        src/pkg/runtime/vlrt_arm.c:513 fp=0x505f8ecc
runtime.semasleep(0xf8475800, 0xd)
        src/pkg/runtime/os_netbsd.c:97 +0x178 fp=0x505f8efc

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

11 years agodoc: remove jquery.js and style.css
Andrew Gerrand [Thu, 1 Aug 2013 07:36:45 +0000 (17:36 +1000)]
doc: remove jquery.js and style.css

Somehow missed these. Moved to go.tools/cmd/godoc/template.

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

11 years agomisc/dist: include godoc from go.tools
Andrew Gerrand [Thu, 1 Aug 2013 06:48:31 +0000 (16:48 +1000)]
misc/dist: include godoc from go.tools

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

11 years agosyscall: add Dup3 on Linux
Brad Fitzpatrick [Thu, 1 Aug 2013 06:38:53 +0000 (23:38 -0700)]
syscall: add Dup3 on Linux

With dup3, we can avoid an extra system call on some machines
while holding syscall.ForkLock. Currently we have to
syscall.Dup + syscall.CloseOnExec.

On machines with Linux and a new enough kernel, this can just
be dup3.

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

11 years agonet/http: don't MIME sniff if handler set an empty string Content-Type
Brad Fitzpatrick [Thu, 1 Aug 2013 06:38:32 +0000 (23:38 -0700)]
net/http: don't MIME sniff if handler set an empty string Content-Type

Fixes #5953

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

11 years agoruntime: fix arm build.
Rémy Oudompheng [Thu, 1 Aug 2013 05:48:21 +0000 (07:48 +0200)]
runtime: fix arm build.

More functions needs to be marked as no stack split.

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

11 years agospec: clarify index and selector expressions
Robert Griesemer [Thu, 1 Aug 2013 05:25:47 +0000 (22:25 -0700)]
spec: clarify index and selector expressions

(Replacement for CL 11884043.)

1) Explain a[i] and a[i:j] where a is of type *A as
   shortcut for (*a)[i] and (*a)[i:j], respectively.

2) Together with 1), because len() of nil slices is
   well defined, there's no need to special case nil
   operands anymore.

3) The result of indexing or slicing a constant string
   is always a non-constant byte or string value.

4) The result of slicing an untyped string is a value
   of type string.

5) If the operand of a valid slice a[i:j] is nil (i, j
   must be 0 for it to be valid - this already follows
   from the in-range rules), the result is a nil slice.

Fixes #4913.
Fixes #5951.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/12198043

11 years agodoc: remove godocs.js and playground.js from core repo
Andrew Gerrand [Thu, 1 Aug 2013 05:09:18 +0000 (15:09 +1000)]
doc: remove godocs.js and playground.js from core repo

These are moved to code.google.com/p/go.tools/cmd/godoc.

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

11 years agoruntime: mark arm _lsvh nosplit (may fix arm build)
Russ Cox [Thu, 1 Aug 2013 04:23:30 +0000 (00:23 -0400)]
runtime: mark arm _lsvh nosplit (may fix arm build)

Mark the 386 one too for consistency,
although most of that code is no longer used.

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/12227043

11 years agoruntime: fix arm preemption
Russ Cox [Thu, 1 Aug 2013 04:16:31 +0000 (00:16 -0400)]
runtime: fix arm preemption

Preemption during the software floating point code
could cause m (R9) to change, so that when the
original registers were restored at the end of the
floating point handler, the changed and correct m
would be replaced by the old and incorrect m.

TBR=dvyukov
CC=golang-dev
https://golang.org/cl/11883045

11 years agobuild: remove builder from test suite (fix build)
Andrew Gerrand [Thu, 1 Aug 2013 03:49:00 +0000 (13:49 +1000)]
build: remove builder from test suite (fix build)

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

11 years agomisc/dashboard/app, misc/dashboard/builder: delete from main repo; part of move to...
Chris Manghane [Thu, 1 Aug 2013 03:27:27 +0000 (13:27 +1000)]
misc/dashboard/app, misc/dashboard/builder: delete from main repo; part of move to go.tools
See also https://golang.org/cl/12180043/

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

11 years agoC: add Chris Manghane (Google CLA)
Andrew Gerrand [Thu, 1 Aug 2013 03:22:42 +0000 (13:22 +1000)]
C: add Chris Manghane (Google CLA)

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

11 years agocmd/godoc: delete from core repository
Andrew Gerrand [Thu, 1 Aug 2013 01:21:17 +0000 (11:21 +1000)]
cmd/godoc: delete from core repository

The godoc command now lives at code.google.com/p/go.tools/cmd/godoc.

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

11 years agocmd/go: install go.tools/cmd/godoc to $GOROOT/bin/godoc
Andrew Gerrand [Thu, 1 Aug 2013 01:17:42 +0000 (11:17 +1000)]
cmd/go: install go.tools/cmd/godoc to $GOROOT/bin/godoc

Also suggest "go get" if godoc not found when running "go doc".

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

11 years agodoc: don't invoke go build with -o /dev/null during test
Robert Daniel Kortschak [Thu, 1 Aug 2013 01:03:13 +0000 (11:03 +1000)]
doc: don't invoke go build with -o /dev/null during test

Fixes #5998.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/12149043

11 years agoC: add Folke Behrens (Google CLA)
Andrew Gerrand [Thu, 1 Aug 2013 00:28:37 +0000 (10:28 +1000)]
C: add Folke Behrens (Google CLA)

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

11 years agoundo CL 12193043 / cc5858966b08
Brad Fitzpatrick [Wed, 31 Jul 2013 22:31:43 +0000 (15:31 -0700)]
undo CL 12193043 / cc5858966b08

Breaks all ELF builds.

««« original CL description
       cmd/ld: report pclntab, funcdata sizes in 6l -v output
       Also move chatty recent additions to -v -v.

       For what it's worth:

       $ go build -o /dev/null -ldflags -v cmd/godoc
       ...
        0.73 pclntab=1259976 bytes, funcdata total 79788 bytes
       ...
       $

R=ken2
CC=cshapiro, golang-dev
https://golang.org/cl/12193043
»»»

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

11 years agoruntime: save 8 stack bytes in timediv on arm.
Rémy Oudompheng [Wed, 31 Jul 2013 21:37:23 +0000 (23:37 +0200)]
runtime: save 8 stack bytes in timediv on arm.

Operations on int64 are very stack consuming with 5c.
Fixes netbsd/arm build.

Before: TEXT    runtime.timediv+0(SB),7,$52-16
After:  TEXT    runtime.timediv+0(SB),7,$44-16

The stack usage is unchanged on 386:
        TEXT    runtime.timediv+0(SB),7,$8-16

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

11 years agodoc/go1.2.txt: add time zone offsets with seconds
Brad Fitzpatrick [Wed, 31 Jul 2013 21:33:34 +0000 (14:33 -0700)]
doc/go1.2.txt: add time zone offsets with seconds

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

11 years agospec: clarify a couple of issues about channels
Rob Pike [Wed, 31 Jul 2013 21:12:32 +0000 (07:12 +1000)]
spec: clarify a couple of issues about channels

1. They are FIFOs.
2. They are safe for concurrent access.

Fixes #5911.

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

11 years agocontainer/list: added MoveBefore and MoveAfter
Pieter Droogendijk [Wed, 31 Jul 2013 21:11:25 +0000 (14:11 -0700)]
container/list: added MoveBefore and MoveAfter

Fixes #4940.

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

11 years agoundo CL 11884043 / bfd5ed8236d5
Robert Griesemer [Wed, 31 Jul 2013 21:10:46 +0000 (14:10 -0700)]
undo CL 11884043 / bfd5ed8236d5

CL submitted prematurely by mistake.

««« original CL description
spec: clarify index and selector expressions

1) Explain a[i] and a[i:j] where a is of type *A as
   shortcut for (*a)[i] and (*a)[i:j], respectively.

2) Together with 1), because len() of nil slices is
   well defined, there's no need to special case nil
   operands anymore.

3) The result of indexing or slicing a constant string
   is always a non-constant byte or string value.

4) The result of slicing an untyped string is a value
   of type string.

5) If the operand of a valid slice a[i:j] is nil (i, j
   must be 0 for it to be valid - this already follows
   from the in-range rules), the result is a nil slice.

Fixes #4913.
Fixes #5951.

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/11884043
»»»

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

11 years agospec: clarify index and selector expressions
Robert Griesemer [Wed, 31 Jul 2013 20:40:01 +0000 (13:40 -0700)]
spec: clarify index and selector expressions

1) Explain a[i] and a[i:j] where a is of type *A as
   shortcut for (*a)[i] and (*a)[i:j], respectively.

2) Together with 1), because len() of nil slices is
   well defined, there's no need to special case nil
   operands anymore.

3) The result of indexing or slicing a constant string
   is always a non-constant byte or string value.

4) The result of slicing an untyped string is a value
   of type string.

5) If the operand of a valid slice a[i:j] is nil (i, j
   must be 0 for it to be valid - this already follows
   from the in-range rules), the result is a nil slice.

Fixes #4913.
Fixes #5951.

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/11884043

11 years agocrypto/des: faster permutation.
Rémy Oudompheng [Wed, 31 Jul 2013 20:06:48 +0000 (22:06 +0200)]
crypto/des: faster permutation.

This patch introduces specialized functions for initial
and final permutations, and precomputes the output of the
third permutation on the S-box elements.

benchmark           old ns/op    new ns/op    delta
BenchmarkEncrypt         3581         1226  -65.76%
BenchmarkDecrypt         3590         1224  -65.91%

benchmark            old MB/s     new MB/s  speedup
BenchmarkEncrypt         2.23         6.52    2.92x
BenchmarkDecrypt         2.23         6.53    2.93x

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

11 years ago cmd/ld: report pclntab, funcdata sizes in 6l -v output
Russ Cox [Wed, 31 Jul 2013 19:36:49 +0000 (15:36 -0400)]
   cmd/ld: report pclntab, funcdata sizes in 6l -v output
       Also move chatty recent additions to -v -v.

       For what it's worth:

       $ go build -o /dev/null -ldflags -v cmd/godoc
       ...
0.73 pclntab=1259976 bytes, funcdata total 79788 bytes
       ...
       $

R=ken2
CC=cshapiro, golang-dev
https://golang.org/cl/12193043

11 years agoruntime: better debug output for inconsistent Note
Dmitriy Vyukov [Wed, 31 Jul 2013 18:03:59 +0000 (22:03 +0400)]
runtime: better debug output for inconsistent Note
Update #5139.
Double wakeup on Note was reported several times,
but no reliable reproducer.
There also was a strange report about weird value of epoll fd.
Maybe it's corruption of global data...

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

11 years agoruntime: do not park sysmon thread if any goroutines are running
Dmitriy Vyukov [Wed, 31 Jul 2013 16:09:03 +0000 (20:09 +0400)]
runtime: do not park sysmon thread if any goroutines are running
Sysmon thread parks if no goroutines are running (runtime.sched.npidle ==
runtime.gomaxprocs).
Currently it's unparked when a goroutine enters syscall, it was enough
to retake P's from blocking syscalls.
But it's not enough for reliable goroutine preemption. We need to ensure that
sysmon runs if any goroutines are running.

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

11 years agoundo CL 12167043 / 475e11851fc1
Dmitriy Vyukov [Wed, 31 Jul 2013 16:03:05 +0000 (20:03 +0400)]
undo CL 12167043 / 475e11851fc1

Submitted with some unrelated changes that were not intended to go in.

««« original CL description
runtime: do not park sysmon thread if any goroutines are running
Sysmon thread parks if no goroutines are running (runtime.sched.npidle == runtime.gomaxprocs).
Currently it's unparked when a goroutine enters syscall, it was enough
to retake P's from blocking syscalls.
But it's not enough for reliable goroutine preemption. We need to ensure that
sysmon runs if any goroutines are running.

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

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

11 years agocmd/gc: record argument size for all indirect function calls
Dmitriy Vyukov [Wed, 31 Jul 2013 16:00:33 +0000 (20:00 +0400)]
cmd/gc: record argument size for all indirect function calls
This is required to properly unwind reflect.methodValueCall/makeFuncStub.
Fixes #5954.
Stats for 'go install std':
61849 total INSTCALL
24655 currently have ArgSize metadata
27278 have ArgSize metadata with this change
godoc size before: 11351888, after: 11364288

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

11 years agoruntime: do not park sysmon thread if any goroutines are running
Dmitriy Vyukov [Wed, 31 Jul 2013 15:59:27 +0000 (19:59 +0400)]
runtime: do not park sysmon thread if any goroutines are running
Sysmon thread parks if no goroutines are running (runtime.sched.npidle == runtime.gomaxprocs).
Currently it's unparked when a goroutine enters syscall, it was enough
to retake P's from blocking syscalls.
But it's not enough for reliable goroutine preemption. We need to ensure that
sysmon runs if any goroutines are running.

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

11 years agoruntime: rewrite map size test
Russ Cox [Wed, 31 Jul 2013 12:35:43 +0000 (08:35 -0400)]
runtime: rewrite map size test

I don't know why the memstats code is flaky.

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

11 years agopath/filepath: Panic in Match when parsing invalid character range.
Pieter Droogendijk [Wed, 31 Jul 2013 06:58:28 +0000 (16:58 +1000)]
path/filepath: Panic in Match when parsing invalid character range.

Fixes #5668.

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

11 years agofmt: make all errors begin with the string "%!", always.
Robert Daniel Kortschak [Wed, 31 Jul 2013 06:11:12 +0000 (16:11 +1000)]
fmt: make all errors begin with the string "%!", always.

Fixes #5730.

R=dsymonds, r, kamil.kisiel
CC=golang-dev
https://golang.org/cl/11998044

11 years agotime: Allow Parse and Format to handle time zone offsets with seconds
Ulf Holm Nielsen [Wed, 31 Jul 2013 06:11:02 +0000 (16:11 +1000)]
time: Allow Parse and Format to handle time zone offsets with seconds

Adds layout cases with seconds for stdISO8601 and stdNumTZ with and without colons. Update time.Format to append seconds for those cases.

Fixes #4934.

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

11 years agoA+C: Ulf Holm Nielsen (individual CLA)
Rob Pike [Wed, 31 Jul 2013 06:10:50 +0000 (16:10 +1000)]
A+C: Ulf Holm Nielsen (individual CLA)

Generated by addca.

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

11 years agotext/template/parse: print TextNodes using %s not %q
Rob Pike [Wed, 31 Jul 2013 05:09:13 +0000 (15:09 +1000)]
text/template/parse: print TextNodes using %s not %q
This means that printing a Node will produce output that can be used as valid input.
It won't be exactly the same - some spacing may be different - but it will mean the same.

Fixes #4593.

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

11 years agofmt: treat \r\n as \n in Scan
Rob Pike [Wed, 31 Jul 2013 05:00:08 +0000 (15:00 +1000)]
fmt: treat \r\n as \n in Scan
When scanning input and "white space" is permitted, a carriage return
followed immediately by a newline (\r\n) is treated exactly the same
as a plain newline (\n). I hope this makes it work better on Windows.

We do it everywhere, not just on Windows, since why not?

Fixes #5391.

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