]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agocmd/5g, cmd/6g, cmd/8g: remove prototypes for proglist
Carl Shapiro [Tue, 4 Jun 2013 23:22:59 +0000 (16:22 -0700)]
cmd/5g, cmd/6g, cmd/8g: remove prototypes for proglist

Each of the backends has two prototypes for this function but
no corresponding definition.

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

11 years agobuild: add intptr typedef for Plan 9
Anthony Martin [Tue, 4 Jun 2013 23:21:04 +0000 (16:21 -0700)]
build: add intptr typedef for Plan 9

Revision 01810e5c68e9 added the following to src/pkg/runtime/stack.h:

        StackPreempt = (uintptr)(intptr)0xffffade,

The typedef for intptr is defined in two places:

        1. src/pkg/runtime/runtime.h for use by the runtime

        2. include/u.h for use by the compilers and linkers

On Plan 9, we don't use include/u.h but instead augment the host's
u.h with extra typedefs. These are in include/plan9/GOARCH/u.h.

We forgot to add intptr. It didn't cause a problem until now since
that typedef was never used outside the runtime.

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

11 years agoC: add Will Norris (Google CLA)
Andrew Gerrand [Tue, 4 Jun 2013 23:11:49 +0000 (09:11 +1000)]
C: add Will Norris (Google CLA)

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

11 years agomisc/pprof: register cnew and runtime.cnewarray as malloc wrappers.
Rémy Oudompheng [Tue, 4 Jun 2013 22:40:49 +0000 (00:40 +0200)]
misc/pprof: register cnew and runtime.cnewarray as malloc wrappers.

These functions were introduced by revision 139919984600
and should not show up on profiles for consistency.

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

11 years agocmd/5c, cmd/6c, cmd/8c: isolate textflag and dataflag
Anthony Martin [Tue, 4 Jun 2013 22:18:02 +0000 (15:18 -0700)]
cmd/5c, cmd/6c, cmd/8c: isolate textflag and dataflag

Fixes #5419.

R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/9241044

11 years agocodereview: don't warn about secret commits
Anthony Martin [Tue, 4 Jun 2013 22:02:28 +0000 (15:02 -0700)]
codereview: don't warn about secret commits

Normally the codereview plugin disables adding new commits
when not using the submit command. Unfortunately this makes
it impossible to use the Mercurial Queues extension at the
same time.

A feature called "Phases" was introduced in Mercurial 2.1
that allows marking commits as being secret; this means
they will never be pushed to the upstream repository.

We can take advantage of this feature to allow the use of
Mercurial Queues if the mq.secret option has been set in
hgrc(5) and a recent version of Mercurial is used.

R=golang-dev, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/7398055

11 years agocmd/ld: fix gcdata and gcbss symbols
Anthony Martin [Tue, 4 Jun 2013 14:07:22 +0000 (07:07 -0700)]
cmd/ld: fix gcdata and gcbss symbols

These two symbols don't show up in the Go symbol table
since they're defined in dodata which is called sometime
after symtab. They do, however, show up in the ELF symbol
table.

This regression was introduced in changeset 01c40d533367.

Also, remove the corresponding strings from the ELF strtab
section now that they're unused.

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

11 years agoencoding/gob: consistently use unsafe.Pointer for pointer values
Ian Lance Taylor [Tue, 4 Jun 2013 13:20:57 +0000 (06:20 -0700)]
encoding/gob: consistently use unsafe.Pointer for pointer values

Fixes #5621.

R=golang-dev, cshapiro, r, fullung
CC=golang-dev
https://golang.org/cl/9988043

11 years agocmd/6c, cmd/8c: avoid generating long multiplication when not necessary.
Rémy Oudompheng [Tue, 4 Jun 2013 06:33:00 +0000 (08:33 +0200)]
cmd/6c, cmd/8c: avoid generating long multiplication when not necessary.

On amd64
benchmark                        old ns/op    new ns/op    delta
BenchmarkHashStringSpeed                91           74  -18.49%
BenchmarkHashInt32Speed                 54           45  -17.88%
BenchmarkHashInt64Speed                 76           58  -23.53%
BenchmarkHashStringArraySpeed          231          188  -18.61%

Fixes #5367.

R=golang-dev, iant, dave, daniel.morsing, ality, rsc
CC=golang-dev
https://golang.org/cl/9040043

11 years agocmd/gc: fix missing slice/array types in export data.
Rémy Oudompheng [Tue, 4 Jun 2013 06:18:36 +0000 (08:18 +0200)]
cmd/gc: fix missing slice/array types in export data.

Fixes #5614.

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

11 years agodoc: add Game of Life to playground toys
Andrew Gerrand [Tue, 4 Jun 2013 02:59:28 +0000 (12:59 +1000)]
doc: add Game of Life to playground toys

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

11 years agoruntime: update defs_windows_*.h files
Alex Brainman [Tue, 4 Jun 2013 02:50:40 +0000 (12:50 +1000)]
runtime: update defs_windows_*.h files

New version of cmd/cgo from
https://golang.org/cl/9574043/
is used to regenerate these.

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

11 years agocmd/ld, runtime: clean up CL 9666047
Russ Cox [Mon, 3 Jun 2013 20:44:35 +0000 (16:44 -0400)]
cmd/ld, runtime: clean up CL 9666047

Remove unnecessary ( ) around == in && clause.
Add { } around multiline if body, even though it's one statement.

Add runtime: prefix to printed errors.

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

11 years agocmd/go: document flag passing for tests
Rob Pike [Mon, 3 Jun 2013 20:39:42 +0000 (16:39 -0400)]
cmd/go: document flag passing for tests
Fixes #5566.

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

11 years agocompress/bzip2: faster decoding.
Rémy Oudompheng [Mon, 3 Jun 2013 18:38:00 +0000 (20:38 +0200)]
compress/bzip2: faster decoding.

benchmark                old ns/op    new ns/op    delta
BenchmarkDecodeDigits     19451173     14347829  -26.24%
BenchmarkDecodeTwain      57516800     42619978  -25.90%

benchmark                 old MB/s     new MB/s  speedup
BenchmarkDecodeDigits         2.22         3.01    1.36x
BenchmarkDecodeTwain          2.17         2.93    1.35x

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

11 years agodoc/articles: use C90 standard functions in the cgo article.
Shenghou Ma [Mon, 3 Jun 2013 17:40:53 +0000 (01:40 +0800)]
doc/articles: use C90 standard functions in the cgo article.

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

11 years agotest/stress: fix a goroutine leak in threadRing stresstest
Robert Obryk [Mon, 3 Jun 2013 14:07:31 +0000 (07:07 -0700)]
test/stress: fix a goroutine leak in threadRing stresstest

Fixes #5527

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

11 years agoruntime: disable preemption in several scheduler functions
Dmitriy Vyukov [Mon, 3 Jun 2013 10:40:38 +0000 (14:40 +0400)]
runtime: disable preemption in several scheduler functions
Required for preemptive scheduler, see the comments for details.

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

11 years agoruntime: introduce preemption function (not used for now)
Dmitriy Vyukov [Mon, 3 Jun 2013 09:20:17 +0000 (13:20 +0400)]
runtime: introduce preemption function (not used for now)
This is part of preemptive scheduler.

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

11 years agoruntime: add stackguard0 to G
Dmitriy Vyukov [Mon, 3 Jun 2013 08:28:24 +0000 (12:28 +0400)]
runtime: add stackguard0 to G
This is part of preemptive scheduler.
stackguard0 is checked in split stack checks and can be set to StackPreempt.
stackguard is not set to StackPreempt (holds the original value).

R=golang-dev, daniel.morsing, iant
CC=golang-dev
https://golang.org/cl/9875043

11 years agodoc: add Go 1.1 to release.html
Andrew Gerrand [Mon, 3 Jun 2013 01:52:36 +0000 (11:52 +1000)]
doc: add Go 1.1 to release.html

Fixes #5468.

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

11 years agodoc: update linux tarball version for Go 1.1
Dave Cheney [Mon, 3 Jun 2013 01:47:42 +0000 (11:47 +1000)]
doc: update linux tarball version for Go 1.1

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

11 years agocmd/gc: do not corrupt init() with initializers of _ in closures.
Rémy Oudompheng [Sun, 2 Jun 2013 21:54:34 +0000 (23:54 +0200)]
cmd/gc: do not corrupt init() with initializers of _ in closures.

Fixes #5607.

R=golang-dev, daniel.morsing, r, dsymonds
CC=golang-dev
https://golang.org/cl/9952043

11 years agoapi: update next.txt
Shenghou Ma [Sun, 2 Jun 2013 19:11:57 +0000 (03:11 +0800)]
api: update next.txt

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

11 years agodoc/go1.2.txt: update for CL 8248043.
Shenghou Ma [Sun, 2 Jun 2013 19:09:47 +0000 (03:09 +0800)]
doc/go1.2.txt: update for CL 8248043.

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

11 years agotest: correct sizeof.go.
Rémy Oudompheng [Sun, 2 Jun 2013 17:10:11 +0000 (19:10 +0200)]
test: correct sizeof.go.

It would not pass on amd64 due to alignment of pointers.

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

11 years agocmd/cgo: using __typeof__(a->r) instead of putting invalid TYPE in "a->r = (const...
Shenghou Ma [Sun, 2 Jun 2013 14:46:53 +0000 (22:46 +0800)]
cmd/cgo: using __typeof__(a->r) instead of putting invalid TYPE in "a->r = (const TYPE)"
Thanks kballard for the hint.
Fixes #4857.

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

11 years agocmd/fix: remove obsolete testdata.
Rémy Oudompheng [Sun, 2 Jun 2013 13:40:32 +0000 (15:40 +0200)]
cmd/fix: remove obsolete testdata.

The corresponding rules have been removed for Go 1.

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

11 years agocmd/fix: check type assertion in netipv6zone rule.
Rémy Oudompheng [Sun, 2 Jun 2013 13:39:47 +0000 (15:39 +0200)]
cmd/fix: check type assertion in netipv6zone rule.

Fixes #5461.

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

11 years agohgignore: cleanup obsolete entries.
Rémy Oudompheng [Sun, 2 Jun 2013 09:36:09 +0000 (11:36 +0200)]
hgignore: cleanup obsolete entries.

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

11 years agotesting: fix rounding error in roundDown10
Dave Cheney [Sat, 1 Jun 2013 23:13:12 +0000 (09:13 +1000)]
testing: fix rounding error in roundDown10

Fixes #5599.

Thanks to minux.ma for the suggested fix.

As we now have a harness to test testing internal functions I added some coverage for testing.roundUp, as it is the main consumer of roundDown10.

R=minux.ma, kr, r
CC=golang-dev
https://golang.org/cl/9926043

11 years agoruntime: minor code style improvements (followup to change 9778049)
Dmitriy Vyukov [Sat, 1 Jun 2013 21:45:26 +0000 (01:45 +0400)]
runtime: minor code style improvements (followup to change 9778049)

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

11 years agobuild: remove special definition of Runemax on Plan 9
Anthony Martin [Sat, 1 Jun 2013 19:03:21 +0000 (12:03 -0700)]
build: remove special definition of Runemax on Plan 9

The Bell Labs distribution now supports 21-bit runes.

R=golang-dev, akumar
CC=golang-dev
https://golang.org/cl/9249045

11 years agocmd/gc: fix overflow in array bounds calculation.
Daniel Morsing [Sat, 1 Jun 2013 14:33:54 +0000 (16:33 +0200)]
cmd/gc: fix overflow in array bounds calculation.

Fixes #5609.

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

11 years agodoc/go1.1.html: remove extra space; close some tags.
Oling Cat [Sat, 1 Jun 2013 14:28:04 +0000 (10:28 -0400)]
doc/go1.1.html: remove extra space; close some tags.

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

11 years agoruntime: revert of CL 8852047: do hashmap grow work during reads.
Keith Randall [Sat, 1 Jun 2013 04:44:32 +0000 (21:44 -0700)]
runtime: revert of CL 8852047: do hashmap grow work during reads.
seems to break freebsd-386.

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

11 years agoruntime: do hashmap grow work during reads.
Keith Randall [Sat, 1 Jun 2013 03:58:31 +0000 (20:58 -0700)]
runtime: do hashmap grow work during reads.

Before this change, grow work was done only
during map writes to ensure multithreaded safety.
This can lead to maps remaining in a partially
grown state for a long time, potentially forever.
This change allows grow work to happen during reads,
which will lead to grow work finishing sooner, making
the resulting map smaller and faster.

Grow work is not done in parallel.  Reads can
happen in parallel while grow work is happening.

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

11 years agoruntime/gc: Run garbage collector on g0 stack
Keith Randall [Sat, 1 Jun 2013 03:43:33 +0000 (20:43 -0700)]
runtime/gc: Run garbage collector on g0 stack
instead of regular g stack. We do this so that the g stack
we're currently running on is no longer changing.  Cuts
the root set down a bit (g0 stacks are not scanned, and
we don't need to scan gc's internal state).  Also an
enabler for copyable stacks.

R=golang-dev, cshapiro, khr, 0xe2.0x9a.0x9b, dvyukov, rsc, iant
CC=golang-dev
https://golang.org/cl/9754044

11 years agolib9/utf: remove unneccesary includes
Anthony Martin [Fri, 31 May 2013 22:53:26 +0000 (15:53 -0700)]
lib9/utf: remove unneccesary includes

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

11 years agocmd/5g, cmd/6g, cmd/8g: provide embedded trampolines with argument size information
Carl Shapiro [Fri, 31 May 2013 20:34:57 +0000 (13:34 -0700)]
cmd/5g, cmd/6g, cmd/8g: provide embedded trampolines with argument size information

An embedded trampoline is a function that exists to marshal
a receiver of type *S to a receiver of type *T when T is an
embedded field in S.

Embedded trampolines are generated by a special path through
the compiler and are not subject to the general analysis and
annotation done to functions.  Their effects must be provided
explicitly.

R=golang-dev, r, daniel.morsing, minux.ma
CC=golang-dev
https://golang.org/cl/9874043

11 years agomisc/dashboard/builder: add environment variables for Plan 9
Anthony Martin [Fri, 31 May 2013 19:18:43 +0000 (12:18 -0700)]
misc/dashboard/builder: add environment variables for Plan 9

We require $objtype in make.rc and rc needs $path for finding commands.

Also include $cputype which we may use in the future.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/9905043

11 years agocmd/go: Add support for including C++ files in packages
Alberto García Hierro [Fri, 31 May 2013 18:33:36 +0000 (11:33 -0700)]
cmd/go: Add support for including C++ files in packages

* Add a CXXFiles field to Package, which includes .cc, .cpp and .cxx  files.
* CXXFiles are compiled using g++, which can be overridden using the CXX environment variable.
* Include .hh, .hpp and .hxx files in HFiles.
* Add support for CPPFLAGS (used for both C and C++) and CXXFLAGS (used only for C++) in cgo directive.
* Changed pkg-config cgo directive to modify CPPFLAGS rather than CFLAGS, so both C and C++ files get any flag returned by pkg-config --cflags.

Fixes #1476.

R=iant, r
CC=bradfitz, gobot, golang-dev, iant, minux.ma, remyoudompheng, seb.binet
https://golang.org/cl/8248043

11 years agospec: better wording re: receiving from closed channels
Robert Griesemer [Fri, 31 May 2013 18:21:37 +0000 (11:21 -0700)]
spec: better wording re: receiving from closed channels

As suggested by ej@evanjones.ca.

Fixes #5604.

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

11 years agotesting: add test for issue 5599
Dave Cheney [Fri, 31 May 2013 13:03:22 +0000 (23:03 +1000)]
testing: add test for issue 5599

Update #5599

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/9738052

11 years agoruntime: fix heap coalescing bug introduced in cl/9802043
Dmitriy Vyukov [Fri, 31 May 2013 06:58:50 +0000 (10:58 +0400)]
runtime: fix heap coalescing bug introduced in cl/9802043
mheap.map become a pointer, so nelem(h->map) returns 1 rather than the map size.
As the result coalescing with subsequent spans does not happen.

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

11 years agoruntime: introduce helper persistentalloc() function
Dmitriy Vyukov [Fri, 31 May 2013 06:42:30 +0000 (10:42 +0400)]
runtime: introduce helper persistentalloc() function
It is a caching wrapper around SysAlloc() that can allocate small chunks.
Use it for symtab allocations. Reduces number of symtab walks from 4 to 3
(reduces buildfuncs time from 10ms to 7.5ms on a large binary,
reduces initial heap size by 680K on the same binary).
Also can be used for type info allocation, itab allocation.
There are also several places in GC where we do the same thing,
they can be changed to use persistentalloc().
Also can be used in FixAlloc, because each instance of FixAlloc allocates
in 128K regions, which is too eager.
Reincarnation of committed and rolled back https://golang.org/cl/9805043
The latent bugs that it revealed are fixed:
https://golang.org/cl/9837049
https://golang.org/cl/9778048

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

11 years agoruntime: set MSpan.limit properly for large spans.
Keith Randall [Fri, 31 May 2013 04:32:20 +0000 (21:32 -0700)]
runtime: set MSpan.limit properly for large spans.
Then use the limit to make sure MHeap_LookupMaybe & inlined
copies don't return a span if the pointer is beyond the limit.
Use this fact to optimize all call sites.

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

11 years agodoc/go1.2.txt: AllocsPerRun now quantized
Rob Pike [Thu, 30 May 2013 16:41:20 +0000 (12:41 -0400)]
doc/go1.2.txt: AllocsPerRun now quantized

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

11 years agotesting: quantize AllocsPerRun
Rob Pike [Thu, 30 May 2013 15:28:08 +0000 (11:28 -0400)]
testing: quantize AllocsPerRun
As the code now says:

We are forced to return a float64 because the API is silly, but do
the division as integers so we can ask if AllocsPerRun()==1
instead of AllocsPerRun()<2.

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

11 years agoruntime: rename mheap.maps to mheap.spans
Dmitriy Vyukov [Thu, 30 May 2013 13:09:58 +0000 (17:09 +0400)]
runtime: rename mheap.maps to mheap.spans
as was dicussed in cl/9791044

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

11 years agoruntime: mark runtime.goexit as nosplit
Dmitriy Vyukov [Thu, 30 May 2013 10:11:49 +0000 (14:11 +0400)]
runtime: mark runtime.goexit as nosplit
Required for preemptive scheduler, see the comment.

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

11 years agocmd/gc: use escape analysis result for make([]T, constant
Rémy Oudompheng [Thu, 30 May 2013 06:32:00 +0000 (08:32 +0200)]
cmd/gc: use escape analysis result for make([]T, constant

Escape analysis already gives that the underlying array
does not escape but the result was ignored.

Fixes #5484.

R=golang-dev, dave, daniel.morsing
CC=golang-dev
https://golang.org/cl/9662046

11 years agocmd/[568]l/obj.c: NULL is not recognised in Plan 9 build, use nil instead.
Lucio De Re [Thu, 30 May 2013 05:02:10 +0000 (15:02 +1000)]
cmd/[568]l/obj.c: NULL is not recognised in Plan 9 build, use nil instead.

Fixes #5591.

R=golang-dev, dave, minux.ma, cshapiro
CC=carl shapiro <cshapiro, golang-dev
https://golang.org/cl/9839046

11 years agomisc/dist: remove lingering ~ file
Alex Brainman [Thu, 30 May 2013 02:11:17 +0000 (12:11 +1000)]
misc/dist: remove lingering ~ file

Fixes #5405.

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

11 years agocmd/ld, runtime: emit pointer maps for nosplits identified by the linker
Carl Shapiro [Thu, 30 May 2013 00:16:57 +0000 (17:16 -0700)]
cmd/ld, runtime: emit pointer maps for nosplits identified by the linker

A nosplits was assumed to have no argument information and no
pointer map.  However, nosplits created by the linker often
have both.  This change uses the pointer map size as an
alternate source of argument size when processing a nosplit.

In addition, the symbol table construction pointer map size
and argument size consistency check is strengthened.  If a
nptrs is greater than 0 it must be equal to the number of
argument words.

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

11 years agocmd/5a, cmd/dist, runtime: support m/g in the assembler, drop support for R9/R10
Shenghou Ma [Wed, 29 May 2013 19:03:52 +0000 (03:03 +0800)]
cmd/5a, cmd/dist, runtime: support m/g in the assembler, drop support for R9/R10
to avoid unintentionally clobber R9/R10.
Thanks Lucio for the suggestion.

PS: yes, this could be considered a big change (but not an API change), but
as it turns out even temporarily changes R9/R10 in user code is unsafe and
leads to very hard to diagnose problems later, better to disable using R9/R10
when the user first uses it.
See CL 6300043 and CL 6305100 for two problems caused by misusing R9/R10.

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

11 years agomisc/cgo/test: check API compatibility for cgo pseudo-functions
Shenghou Ma [Wed, 29 May 2013 18:59:57 +0000 (02:59 +0800)]
misc/cgo/test: check API compatibility for cgo pseudo-functions

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

11 years agocmd/gc: remove unused bit vector comparison code
Carl Shapiro [Wed, 29 May 2013 18:46:14 +0000 (11:46 -0700)]
cmd/gc: remove unused bit vector comparison code

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

11 years agoruntime: remove all badcallback() functions
Jan Ziak [Wed, 29 May 2013 15:51:17 +0000 (17:51 +0200)]
runtime: remove all badcallback() functions

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

11 years agofmt: change evalutation of indexed arg to match docs
Rob Pike [Wed, 29 May 2013 15:29:29 +0000 (11:29 -0400)]
fmt: change evalutation of indexed arg to match docs
The old code put the index before the period in the precision;
it should be after so it's always before the star, as documented.
A little trickier to do in one pass but compensated for by more
tests and catching a couple of other error cases.

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

11 years ago crypto/tls: Check all certificates in the path.
John Shahid [Wed, 29 May 2013 15:21:32 +0000 (11:21 -0400)]
  crypto/tls: Check all certificates in the path.

Currently we only check the leaf node's issuer against the list of
distinguished names in the server's CertificateRequest message. This
will fail if the client certiciate has more than one certificate in
the path and the leaf node issuer isn't in the list of distinguished
names, but the issuer's issuer was in the distinguished names.

R=agl, agl
CC=gobot, golang-dev
https://golang.org/cl/9795043

11 years agoA+C: John Shahid (individual CLA)
Adam Langley [Wed, 29 May 2013 15:18:05 +0000 (11:18 -0400)]
A+C: John Shahid (individual CLA)

Generated by addca.

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

11 years agoruntime: make notetsleep() return false if timeout happens
Dmitriy Vyukov [Wed, 29 May 2013 07:49:45 +0000 (11:49 +0400)]
runtime: make notetsleep() return false if timeout happens
This is needed for preemptive scheduler, because during
stoptheworld we want to wait with timeout and re-preempt
M's on timeout.

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

11 years agodoc: Fix typo in approximation of square root
Katrina Owen [Wed, 29 May 2013 03:49:51 +0000 (13:49 +1000)]
doc: Fix typo in approximation of square root

See https://en.wikipedia.org/wiki/Newton%27s_method#Square_root_of_a_number

R=golang-dev, minux.ma, adg
CC=golang-dev
https://golang.org/cl/9145044

11 years agoA+C: add Katrina Owen (individual CLA)
Andrew Gerrand [Wed, 29 May 2013 03:49:31 +0000 (13:49 +1000)]
A+C: add Katrina Owen (individual CLA)

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

11 years agocmd/5l, cmd/6l, cmd/8l, cmd/gc, runtime: generate and use bitmaps of argument pointer...
Carl Shapiro [Wed, 29 May 2013 00:59:10 +0000 (17:59 -0700)]
cmd/5l, cmd/6l, cmd/8l, cmd/gc, runtime: generate and use bitmaps of argument pointer locations

With this change the compiler emits a bitmap for each function
covering its stack frame arguments area.  If an argument word
is known to contain a pointer, a bit is set.  The garbage
collector reads this information when scanning the stack by
frames and uses it to ignores locations known to not contain a
pointer.

R=golang-dev, bradfitz, daniel.morsing, dvyukov, khr, khr, iant, cshapiro
CC=golang-dev
https://golang.org/cl/9223046

11 years agoruntime: make mheap statically allocated again
Dmitriy Vyukov [Tue, 28 May 2013 18:14:47 +0000 (22:14 +0400)]
runtime: make mheap statically allocated again
This depends on: 9791044: runtime: allocate page table lazily
Once page table is moved out of heap, the heap becomes small.
This removes unnecessary dereferences during heap access.
No logical changes.

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

11 years agoruntime: allocate page table lazily
Dmitriy Vyukov [Tue, 28 May 2013 18:04:34 +0000 (22:04 +0400)]
runtime: allocate page table lazily
This removes the 256MB memory allocation at startup,
which conflicts with ulimit.
Also will allow to eliminate an unnecessary memory dereference in GC,
because the page table is usually mapped at known address.
Update #5049.
Update #5236.

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

11 years agoruntime: allocate internal symbol table eagerly
Dmitriy Vyukov [Tue, 28 May 2013 17:10:10 +0000 (21:10 +0400)]
runtime: allocate internal symbol table eagerly
we need it for GC anyway.

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

11 years agoos/exec: fix test hang
Dmitriy Vyukov [Tue, 28 May 2013 17:09:27 +0000 (21:09 +0400)]
os/exec: fix test hang
Currently the test closes random files descriptors,
which leads to hang (in particular if netpoll fd is closed).
Try to open only fd 3, since the parent process expects it to be fd 3 anyway.
Fixes #5571.

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

11 years agoruntime: fix heap corruption during GC
Dmitriy Vyukov [Tue, 28 May 2013 15:17:47 +0000 (19:17 +0400)]
runtime: fix heap corruption during GC
The 'n' variable is used during rescan initiation in GC_END case,
but it's overwritten with chan capacity in GC_CHAN case.
As the result rescan is done with the wrong object size.
Fixes #5554.

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

11 years agoruntime: use m and g, instead of R9 and R10, in ARM assembly files
Shenghou Ma [Tue, 28 May 2013 12:13:02 +0000 (20:13 +0800)]
runtime: use m and g, instead of R9 and R10, in ARM assembly files
also don't clobber R9 if it is about to crash.

In response to https://golang.org/cl/9251043/#msg2.

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

11 years agoundo CL 9805043 / 776aba85ece8
Dmitriy Vyukov [Tue, 28 May 2013 07:14:39 +0000 (11:14 +0400)]
undo CL 9805043 / 776aba85ece8

multiple failures on amd64

««« original CL description
runtime: introduce helper persistentalloc() function
It is a caching wrapper around SysAlloc() that can allocate small chunks.
Use it for symtab allocations. Reduces number of symtab walks from 4 to 3
(reduces buildfuncs time from 10ms to 7.5ms on a large binary,
reduces initial heap size by 680K on the same binary).
Also can be used for type info allocation, itab allocation.
There are also several places in GC where we do the same thing,
they can be changed to use persistentalloc().
Also can be used in FixAlloc, because each instance of FixAlloc allocates
in 128K regions, which is too eager.

R=golang-dev, daniel.morsing, khr
CC=golang-dev
https://golang.org/cl/9805043
»»»

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

11 years agoruntime: inline MCache_Alloc() into mallocgc()
Dmitriy Vyukov [Tue, 28 May 2013 07:05:55 +0000 (11:05 +0400)]
runtime: inline MCache_Alloc() into mallocgc()
benchmark                    old ns/op    new ns/op    delta
BenchmarkMalloc8                    68           62   -8.63%
BenchmarkMalloc16                   75           69   -7.94%
BenchmarkMallocTypeInfo8           102           98   -3.73%
BenchmarkMallocTypeInfo16          108          103   -4.63%

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

11 years agoruntime: introduce helper persistentalloc() function
Dmitriy Vyukov [Tue, 28 May 2013 06:47:35 +0000 (10:47 +0400)]
runtime: introduce helper persistentalloc() function
It is a caching wrapper around SysAlloc() that can allocate small chunks.
Use it for symtab allocations. Reduces number of symtab walks from 4 to 3
(reduces buildfuncs time from 10ms to 7.5ms on a large binary,
reduces initial heap size by 680K on the same binary).
Also can be used for type info allocation, itab allocation.
There are also several places in GC where we do the same thing,
they can be changed to use persistentalloc().
Also can be used in FixAlloc, because each instance of FixAlloc allocates
in 128K regions, which is too eager.

R=golang-dev, daniel.morsing, khr
CC=golang-dev
https://golang.org/cl/9805043

11 years agoruntime: fix runtime·netpoll() to call runtime·netpollready() only once per event.
Bill Neubauer [Mon, 27 May 2013 21:03:10 +0000 (05:03 +0800)]
runtime: fix runtime·netpoll() to call runtime·netpollready() only once per event.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9808043

11 years agoruntime: make arm signal handler call runtime.badsignal
Shenghou Ma [Mon, 27 May 2013 12:46:53 +0000 (20:46 +0800)]
runtime: make arm signal handler call runtime.badsignal
In preparation for CL 9249043 (already submitted).

Fixes #5553.

R=golang-dev, iant, capnm9, dave
CC=golang-dev
https://golang.org/cl/9251043

11 years agoruntime: introduce cnewarray() to simplify allocation of typed arrays
Dmitriy Vyukov [Mon, 27 May 2013 07:29:11 +0000 (11:29 +0400)]
runtime: introduce cnewarray() to simplify allocation of typed arrays

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

11 years agoruntime: flag static variables as no-pointers
Jan Ziak [Mon, 27 May 2013 06:11:59 +0000 (08:11 +0200)]
runtime: flag static variables as no-pointers

Variables in data sections of 32-bit executables interfere with
garbage collector's ability to free objects and/or unnecessarily
slow down the garbage collector.

This changeset moves some static variables to .noptr sections.
'files' in symtab.c is now allocated dynamically.

R=golang-dev, dvyukov, minux.ma
CC=golang-dev
https://golang.org/cl/9786044

11 years agoeffective_go.html: Fix two links
Brian G. Merrell [Mon, 27 May 2013 01:00:12 +0000 (11:00 +1000)]
effective_go.html: Fix two links
This fixes two intra-page "type assertion" links that were broken in
different ways.

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

11 years agoA+C: Brian G. Merrell (individual CLA)
David Symonds [Mon, 27 May 2013 00:59:34 +0000 (10:59 +1000)]
A+C: Brian G. Merrell (individual CLA)

Generated by addca.

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

11 years agoruntime: update comment on stack allocator
Dmitriy Vyukov [Sat, 25 May 2013 18:47:36 +0000 (22:47 +0400)]
runtime: update comment on stack allocator

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

11 years agocmd/cgo: do not output empty struct for -cdefs
Alex Brainman [Sat, 25 May 2013 10:53:55 +0000 (20:53 +1000)]
cmd/cgo: do not output empty struct for -cdefs

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

11 years agofmt.Printf: introduce notation for random access to arguments.
Rob Pike [Fri, 24 May 2013 22:49:26 +0000 (15:49 -0700)]
fmt.Printf: introduce notation for random access to arguments.
This text is added to doc.go:

        Explicit argument indexes:

        In Printf, Sprintf, and Fprintf, the default behavior is for each
        formatting verb to format successive arguments passed in the call.
        However, the notation [n] immediately before the verb indicates that the
        nth one-indexed argument is to be formatted instead. The same notation
        before a '*' for a width or precision selects the argument index holding
        the value. After processing a bracketed expression [n], arguments n+1,
        n+2, etc. will be processed unless otherwise directed.

        For example,
                fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
        will yield "22, 11", while
                fmt.Sprintf("%[3]*[2].*[1]f", 12.0, 2, 6),
        equivalent to
                fmt.Sprintf("%6.2f", 12.0),
        will yield " 12.00". Because an explicit index affects subsequent verbs,
        this notation can be used to print the same values multiple times
        by resetting the index for the first argument to be repeated:
                fmt.Sprintf("%d %d %#[1]x %#x", 16, 17)
        will yield "16 17 0x10 0x11".

The notation chosen differs from that in C, but I believe it's easier to read
and to remember (we're indexing the arguments), and compatibility with
C's printf was never a strong goal anyway.

While we're here, change the word "field" to "arg" or "argument" in the
code; it was being misused and was confusing.

R=rsc, bradfitz, rogpeppe, minux.ma, peter.armitage
CC=golang-dev
https://golang.org/cl/9680043

11 years agobuild: fix make.rc on Plan 9
David du Colombier [Fri, 24 May 2013 20:55:19 +0000 (13:55 -0700)]
build: fix make.rc on Plan 9

Set $status as null to prevent rc from exiting
on the last --no-banner argument checking when
used with rc -e. It allows all.rc to not exit
before executing run.rc

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

11 years agodoc: start go 1.2 notes
Russ Cox [Fri, 24 May 2013 20:34:50 +0000 (16:34 -0400)]
doc: start go 1.2 notes

This is a file of hints, not a file of polished text.
Let's not try to do polished text until we start the
release process.

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

11 years agocrypto/x509: harmonise error prefixes.
Adam Langley [Fri, 24 May 2013 20:23:13 +0000 (16:23 -0400)]
crypto/x509: harmonise error prefixes.

crypto/x509 has ended up with a variety of error formats. This change makes them all start with "x509: ".

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

11 years agocmd/cov: delete
Rob Pike [Fri, 24 May 2013 18:06:06 +0000 (11:06 -0700)]
cmd/cov: delete
It doesn't work, it's not portable, it's not part of the released
binaries, and a better tool is due.

Fixes #1319.
Fixes #4621.

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

11 years agopath/filepath: Skip TestEvalSymlinks. Plan 9 doesn't have symlinks.
Christopher Nielsen [Fri, 24 May 2013 18:01:04 +0000 (11:01 -0700)]
path/filepath: Skip TestEvalSymlinks. Plan 9 doesn't have symlinks.

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

11 years agoasn1: Stricter checks for DER encoded booleans
Gerasimos Dimitriadis [Fri, 24 May 2013 16:37:42 +0000 (12:37 -0400)]
asn1: Stricter checks for DER encoded booleans

According to X.690, only 0 and 255 are allowed as values
for encoded booleans. Also added some test for parsing
booleans

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

11 years agoA+C: Gerasimos Dimitriadis (individual CLA)
Adam Langley [Fri, 24 May 2013 16:36:59 +0000 (12:36 -0400)]
A+C: Gerasimos Dimitriadis (individual CLA)

Generated by addca.

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

11 years agolog/syslog: fix deadlock in test
Dmitriy Vyukov [Fri, 24 May 2013 14:35:48 +0000 (18:35 +0400)]
log/syslog: fix deadlock in test
The problem was that server handlers block on done<-,
the goroutine that reads from done blocks on count<-,
and the main goroutine that is supposed to read from count
waits for server handlers to exit.
Fixes #5547.

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

11 years agomisc/cgo/testso: use bash to run test.bash
Dave Cheney [Fri, 24 May 2013 11:56:01 +0000 (07:56 -0400)]
misc/cgo/testso: use bash to run test.bash

R=golang-dev, minux.ma, capnm9
CC=golang-dev
https://golang.org/cl/9717043

11 years agocmd/cgo: change GoStringN and GoBytes from intgo to int32
Ian Lance Taylor [Fri, 24 May 2013 06:19:47 +0000 (23:19 -0700)]
cmd/cgo: change GoStringN and GoBytes from intgo to int32

Fixes build.

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

11 years agocmd/cgo: use intgo, not int, for string and slice structures
Ian Lance Taylor [Fri, 24 May 2013 05:51:07 +0000 (22:51 -0700)]
cmd/cgo: use intgo, not int, for string and slice structures

Fixes #5548.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/9643044

11 years agotest/bench/shootout/timing.log: update to Go 1.1
Rob Pike [Fri, 24 May 2013 00:57:28 +0000 (17:57 -0700)]
test/bench/shootout/timing.log: update to Go 1.1

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

11 years agoruntime: faster range on empty map
Frederick Kelly Mayle III [Thu, 23 May 2013 21:17:52 +0000 (14:17 -0700)]
runtime: faster range on empty map

benchmark                old ns/op    new ns/op    delta
BenchmarkMapIter               191          190   -0.52%
BenchmarkMapIterEmpty           22            4  -78.96%

R=golang-dev, minux.ma, dvyukov, iant, khr
CC=golang-dev
https://golang.org/cl/9637043

11 years agoA+C: Frederick Kelly Mayle III (individual CLA)
Brad Fitzpatrick [Thu, 23 May 2013 21:17:32 +0000 (14:17 -0700)]
A+C: Frederick Kelly Mayle III (individual CLA)

Generated by addca.

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

11 years agocodereview: close the head tag
Brad Fitzpatrick [Thu, 23 May 2013 21:13:39 +0000 (14:13 -0700)]
codereview: close the head tag

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

11 years agomisc/emacs: Do not modify kill ring when programmatically deleting text
Dominik Honnef [Thu, 23 May 2013 17:19:03 +0000 (10:19 -0700)]
misc/emacs: Do not modify kill ring when programmatically deleting text

Operations like gofmt and go-remove-unused-imports delete entire
lines of text. Previously this put them on the kill-ring,
negatively affecting user experience.

R=adonovan
CC=gobot, golang-dev
https://golang.org/cl/9605043