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

16484 Commits

Author SHA1 Message Date
Ian Lance Taylor
941db1ed39 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
2013-06-04 06:20:57 -07:00
Rémy Oudompheng
2c0b00744f 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
2013-06-04 08:33:00 +02:00
Rémy Oudompheng
62891fb811 cmd/gc: fix missing slice/array types in export data.
Fixes #5614.

R=golang-dev
CC=golang-dev
https://golang.org/cl/9953044
2013-06-04 08:18:36 +02:00
Andrew Gerrand
850d1026ad doc: add Game of Life to playground toys
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/9961043
2013-06-04 12:59:28 +10:00
Alex Brainman
9bc0eaf60e 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
2013-06-04 12:50:40 +10:00
Russ Cox
fa4a9ff764 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
2013-06-03 16:44:35 -04:00
Rob Pike
59fb90ac85 cmd/go: document flag passing for tests
Fixes #5566.

R=rsc
CC=gobot, golang-dev
https://golang.org/cl/9882043
2013-06-03 16:39:42 -04:00
Rémy Oudompheng
394706b646 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
2013-06-03 20:38:00 +02:00
Shenghou Ma
022818c142 doc/articles: use C90 standard functions in the cgo article.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9953043
2013-06-04 01:40:53 +08:00
Robert Obryk
44b7d5b41a test/stress: fix a goroutine leak in threadRing stresstest
Fixes #5527

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/9955043
2013-06-03 07:07:31 -07:00
Dmitriy Vyukov
4a8ef1f65d 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
2013-06-03 14:40:38 +04:00
Dmitriy Vyukov
354ec51666 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
2013-06-03 13:20:17 +04:00
Dmitriy Vyukov
f5becf4233 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
2013-06-03 12:28:24 +04:00
Andrew Gerrand
ae43ea432d doc: add Go 1.1 to release.html
Fixes #5468.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9853051
2013-06-03 11:52:36 +10:00
Dave Cheney
ec1769ba7b doc: update linux tarball version for Go 1.1
R=adg
CC=golang-dev
https://golang.org/cl/9819044
2013-06-03 11:47:42 +10:00
Rémy Oudompheng
0d0d57ccfe 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
2013-06-02 23:54:34 +02:00
Shenghou Ma
85046d3e52 api: update next.txt
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9950043
2013-06-03 03:11:57 +08:00
Shenghou Ma
1a145cd52d doc/go1.2.txt: update for CL 8248043.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9949044
2013-06-03 03:09:47 +08:00
Rémy Oudompheng
2c1acc18f4 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
2013-06-02 19:10:11 +02:00
Shenghou Ma
5b097e7951 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
2013-06-02 22:46:53 +08:00
Rémy Oudompheng
5a810f7c0a 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
2013-06-02 15:40:32 +02:00
Rémy Oudompheng
57d89fb659 cmd/fix: check type assertion in netipv6zone rule.
Fixes #5461.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9947043
2013-06-02 15:39:47 +02:00
Rémy Oudompheng
f8067ad67a hgignore: cleanup obsolete entries.
R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/9935043
2013-06-02 11:36:09 +02:00
Dave Cheney
a28609d66f 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
2013-06-02 09:13:12 +10:00
Dmitriy Vyukov
83d4cd758c runtime: minor code style improvements (followup to change 9778049)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9693044
2013-06-02 01:45:26 +04:00
Anthony Martin
b40d98562f 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
2013-06-01 12:03:21 -07:00
Daniel Morsing
bf9a00bc8f cmd/gc: fix overflow in array bounds calculation.
Fixes #5609.

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/9757045
2013-06-01 16:33:54 +02:00
Oling Cat
5b7d422a05 doc/go1.1.html: remove extra space; close some tags.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9941043
2013-06-01 10:28:04 -04:00
Keith Randall
7f0ee023ba 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
2013-05-31 21:44:32 -07:00
Keith Randall
07b6add0ca 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
2013-05-31 20:58:31 -07:00
Keith Randall
71f061043d 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
2013-05-31 20:43:33 -07:00
Anthony Martin
af7f7b7515 lib9/utf: remove unneccesary includes
R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/8651043
2013-05-31 15:53:26 -07:00
Carl Shapiro
31be5deae4 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
2013-05-31 13:34:57 -07:00
Anthony Martin
252161cadc 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
2013-05-31 12:18:43 -07:00
Alberto García Hierro
84485361f9 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
2013-05-31 11:33:36 -07:00
Robert Griesemer
ab5c762a46 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
2013-05-31 11:21:37 -07:00
Dave Cheney
787976c739 testing: add test for issue 5599
Update #5599

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/9738052
2013-05-31 23:03:22 +10:00
Dmitriy Vyukov
9ba551bb87 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
2013-05-31 10:58:50 +04:00
Dmitriy Vyukov
86da989ee5 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
2013-05-31 10:42:30 +04:00
Keith Randall
d6f89d735e 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
2013-05-30 21:32:20 -07:00
Rob Pike
85fc2f70ac doc/go1.2.txt: AllocsPerRun now quantized
R=golang-dev, khr, rsc
CC=golang-dev
https://golang.org/cl/9728045
2013-05-30 12:41:20 -04:00
Rob Pike
cf5dd6ad64 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
2013-05-30 11:28:08 -04:00
Dmitriy Vyukov
e17281b397 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
2013-05-30 17:09:58 +04:00
Dmitriy Vyukov
573d25a423 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
2013-05-30 14:11:49 +04:00
Rémy Oudompheng
2c4b029b75 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
2013-05-30 08:32:00 +02:00
Lucio De Re
0b88587d22 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
2013-05-30 15:02:10 +10:00
Alex Brainman
77d4347bf2 misc/dist: remove lingering ~ file
Fixes #5405.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/9856043
2013-05-30 12:11:17 +10:00
Carl Shapiro
037a1a9f31 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
2013-05-29 17:16:57 -07:00
Shenghou Ma
5d081792b6 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
2013-05-30 03:03:52 +08:00
Shenghou Ma
a307c5c9b7 misc/cgo/test: check API compatibility for cgo pseudo-functions
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9826043
2013-05-30 02:59:57 +08:00