1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:18:32 -06:00
Commit Graph

21966 Commits

Author SHA1 Message Date
Austin Clements
277d5870a0 runtime: move wbuf-related functions to new gcwork.go
No code modifications.

This is in preparation for improving the wbuf abstraction.

Change-Id: I719543a345c34d079b7e39b251eccd5dd8a07826
Reviewed-on: https://go-review.googlesource.com/4710
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-02-12 20:16:35 +00:00
Austin Clements
27ed1fcb04 runtime: on Plan 9, zero memory returned to the brk by sysFree
Plan 9's sysFree has an optimization where if the object being freed
is the last object allocated, it will roll back the brk to allow the
memory to be reused by sysAlloc.  However, it does not zero this
"returned" memory, so as a result, sysAlloc can return non-zeroed
memory after a sysFree.  This leads to corruption because the runtime
assumes sysAlloc returns zeroed memory.

Fix this by zeroing the memory returned by sysFree.

Fixes #9846.

Change-Id: Id328c58236eb7c464b31ac1da376a0b757a5dc6a
Reviewed-on: https://go-review.googlesource.com/4700
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
2015-02-12 16:27:29 +00:00
Andrew Gerrand
3b67e9c299 doc: update pre-requisites for bootstrapping
Change-Id: Id86994c8692e29f9d073b6322733ce9219887dc3
Reviewed-on: https://go-review.googlesource.com/4520
Run-TryBot: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-02-12 14:01:55 +00:00
Dmitry Vyukov
b3be360f16 cmd/gc: allocate non-escaping maps on stack
Extend escape analysis to make(map[k]v).
If it does not escape, allocate temp buffer for hmap and one bucket on stack.

There are 75 cases of non-escaping maps in std lib.

benchmark                                    old allocs     new allocs     delta
BenchmarkConcurrentStmtQuery                 16161          15161          -6.19%
BenchmarkConcurrentTxQuery                   17658          16658          -5.66%
BenchmarkConcurrentTxStmtQuery               16157          15156          -6.20%
BenchmarkConcurrentRandom                    13637          13114          -3.84%
BenchmarkManyConcurrentQueries               22             20             -9.09%
BenchmarkDecodeComplex128Slice               250            188            -24.80%
BenchmarkDecodeFloat64Slice                  250            188            -24.80%
BenchmarkDecodeInt32Slice                    250            188            -24.80%
BenchmarkDecodeStringSlice                   2250           2188           -2.76%
BenchmarkNewEmptyMap                         1              0              -100.00%
BenchmarkNewSmallMap                         2              0              -100.00%

benchmark                old ns/op     new ns/op     delta
BenchmarkNewEmptyMap     124           55.7          -55.08%
BenchmarkNewSmallMap     317           148           -53.31%

benchmark                old allocs     new allocs     delta
BenchmarkNewEmptyMap     1              0              -100.00%
BenchmarkNewSmallMap     2              0              -100.00%

benchmark                old bytes     new bytes     delta
BenchmarkNewEmptyMap     48            0             -100.00%
BenchmarkNewSmallMap     192           0             -100.00%

Fixes #5449

Change-Id: I24fa66f949d2f138885d9e66a0d160240dc9e8fa
Reviewed-on: https://go-review.googlesource.com/3508
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
2015-02-12 09:53:52 +00:00
Dmitry Vyukov
aed88be021 cmd/gc: restore stack frame debugging
Dump frames of functions.
Add function name and var width to output.

Change-Id: Ida06b8def96178fa550ca90836eb4a2509b9e13f
Reviewed-on: https://go-review.googlesource.com/3870
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-12 08:58:26 +00:00
Dmitry Vyukov
ed8cc5cf9b runtime: fix race instrumentation of append
typedslicecopy is another write barrier that is not
understood by racewalk. It seems quite complex to handle it
in the compiler, so instead just instrument it in runtime.

Update #9796

Change-Id: I0eb6abf3a2cd2491a338fab5f7da22f01bf7e89b
Reviewed-on: https://go-review.googlesource.com/4370
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-12 08:51:49 +00:00
Dmitry Vyukov
c1bbf0a2ea cmd/gc: remove several copies of outervalue
Walk calls it outervalue, racewalk calls it basenod,
isstack does it manually and slightly differently.

Change-Id: Id5b5d32b8faf143fe9d34bd08457bfab6fb33daa
Reviewed-on: https://go-review.googlesource.com/3745
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-12 08:31:05 +00:00
Dmitry Vyukov
9568126f35 cmd/gc: allocate buffers for non-escaping string conversions on stack
Support the following conversions in escape analysis:
[]rune("foo")
[]byte("foo")
string([]rune{})

If the result does not escape, allocate temp buffer on stack
and pass it to runtime functions.

Change-Id: I1d075907eab8b0109ad7ad1878104b02b3d5c690
Reviewed-on: https://go-review.googlesource.com/3590
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-12 08:29:53 +00:00
Brad Fitzpatrick
cdc2b0568f runtime: remove obsolete SELinux execmem comment
We don't have executable memory anymore.

Change-Id: I9835f03a7bcd97d809841ecbed8718b3048bfb32
Reviewed-on: https://go-review.googlesource.com/4681
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-02-12 08:04:48 +00:00
Alex Brainman
4a2233cea1 runtime: move all stdFunctions into os1_windows.go (no code changes)
Change-Id: I40291561a18bed3ca6be9dca12a664bdf28cb2f1
Reviewed-on: https://go-review.googlesource.com/4660
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-12 04:04:59 +00:00
Alex Brainman
f984cea71d runtime: remove unused signals_windows.h
Change-Id: I35fe76661c80ca808a711acf608a23c77aeb0608
Reviewed-on: https://go-review.googlesource.com/4651
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-12 03:09:26 +00:00
mattn
e77fbd598f syscall: Readlink doesn't handle junction on windows
Fixes #9190

Change-Id: I22177687ed834feed165454019d28c11fcbf0fa2
Reviewed-on: https://go-review.googlesource.com/2307
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-02-12 02:03:25 +00:00
Russ Cox
f58a5cb9e2 cmd/gc: avoid %#016x, which really means Go's %#014x
(In non-Go print formats, the 016 includes the leading 0x prefix.
No one noticed, but we were printing hex numbers with a minimum
of 30 digits, not 32.)

Change-Id: I10ff7a51a567ad7c8440418ac034be9e4b2d6bc1
Reviewed-on: https://go-review.googlesource.com/4592
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 21:45:32 +00:00
Russ Cox
7c3eeda66f cmd/gc: use go.builtin as package prefix, not go%2ebuiltin
This matches all the other pseudo-packages.
The line was simply forgotten.

Change-Id: I278f6cbcfc883ea7efad07f99fc8c853b9b5d274
Reviewed-on: https://go-review.googlesource.com/4591
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 21:45:22 +00:00
Russ Cox
90965718a8 cmd/gc: make qsort comparisons totally ordered
Otherwise different qsort implementations might result
in different sort orders and therefore different compiled
object files.

Change-Id: Ie783ba55a55af06941307e150b0c406e0a8128b0
Reviewed-on: https://go-review.googlesource.com/4590
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 21:44:46 +00:00
Russ Cox
1250d2e374 cmd/gc: remove C subclassing trick from popt.c
It does not convert to Go well.

Being able to do this just once, instead of 4 times, was the primary
motivation for all the recent refactoring (not that it wasn't overdue).

Still bit-for-bit identical.

Change-Id: Ia01f17948441bf64fa78ec4226f0bb40af0bbaab
Reviewed-on: https://go-review.googlesource.com/3962
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 20:46:16 +00:00
Russ Cox
ad88fd1d4a cmd/gc: move reg.c into portable code
Now there is only one registerizer shared among all the systems.
There are some unfortunate special cases based on arch.thechar
in reg.c, to preserve bit-for-bit compatibility during the refactoring.
Most are probably bugs one way or another and should be revisited.

Change-Id: I153b435c0eaa05bbbeaf8876822eeb6dedaae3cf
Reviewed-on: https://go-review.googlesource.com/3883
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 20:37:38 +00:00
Russ Cox
b8a3e88ea7 cmd/gc: remove cgen_asop, no longer used
gc/order.c rewrites OASOP nodes into ordinary assignments.
The back ends never see them anymore.

Change-Id: I268ac8bdc92dccd7123110a21f99ada3ceeb2baa
Reviewed-on: https://go-review.googlesource.com/3882
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 20:36:37 +00:00
Russ Cox
eb1774fa19 cmd/gc: factor newly-portable code into gc directory
This isn't everything, but it's a start.
Still producing bit-identical compiler output.

The semantics of the old back ends is preserved,
even when they are probably buggy.
There are some TODOs in gc/gsubr.c to
remove special cases to preserve bugs in 5g and 8g.

Change-Id: I28ae295fbfc94ef9df43e13ab96bd6fc2f194bc4
Reviewed-on: https://go-review.googlesource.com/3802
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 20:36:27 +00:00
Robert Griesemer
81a3f291f0 strconv: simplified logic resulting in faster float formatting
benchmark                               old ns/op     new ns/op     delta
BenchmarkFormatFloatDecimal             300           283           -5.67%
BenchmarkFormatFloat                    383           381           -0.52%
BenchmarkFormatFloatExp                 359           357           -0.56%
BenchmarkFormatFloatNegExp              357           358           +0.28%
BenchmarkFormatFloatBig                 468           430           -8.12%
BenchmarkAppendFloatDecimal             104           92.5          -11.06%
BenchmarkAppendFloat                    199           190           -4.52%
BenchmarkAppendFloatExp                 172           167           -2.91%
BenchmarkAppendFloatNegExp              172           169           -1.74%
BenchmarkAppendFloatBig                 280           235           -16.07%
BenchmarkAppendFloat32Integer           104           92.4          -11.15%
BenchmarkAppendFloat32ExactFraction     168           171           +1.79%
BenchmarkAppendFloat32Point             206           199           -3.40%
BenchmarkAppendFloat32Exp               167           167           +0.00%
BenchmarkAppendFloat32NegExp            167           166           -0.60%
BenchmarkAppendFloat64Fixed1            134           129           -3.73%
BenchmarkAppendFloat64Fixed2            144           136           -5.56%
BenchmarkAppendFloat64Fixed3            138           134           -2.90%
BenchmarkAppendFloat64Fixed4            145           138           -4.83%

Change-Id: Ia143840cb34cbd1cebd6b691dd0a45b7264b406c
Reviewed-on: https://go-review.googlesource.com/3920
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11 17:45:19 +00:00
Robert Griesemer
764a9cf20d math/big: completed Float.Uint64
Change-Id: Ib3738492a2ec8fc99323e687168b17b7239db6ad
Reviewed-on: https://go-review.googlesource.com/4511
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11 17:03:08 +00:00
Robert Griesemer
15fe15a198 math/big: add test cases for Float.Abs and Float.Neg
Change-Id: Ic5f3864bc6d94d60b754e3ccf72b1d40c5c09117
Reviewed-on: https://go-review.googlesource.com/4510
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11 17:02:54 +00:00
Robert Griesemer
64e7038291 math/big: implemented Float.Int (truncation of Floats to Ints)
Change-Id: Id98f7333fe6ae1b64e0469c6d01f02360c1f8f55
Reviewed-on: https://go-review.googlesource.com/4481
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11 17:02:35 +00:00
Robert Griesemer
950aa9f1bc math/big: When result prec == 0, use at least prec == 64 for SetInt, SetRat.
This avoids surprises.

Change-Id: Iaae67da2d12e29c4e797ad6313e0895f7ce80cb1
Reviewed-on: https://go-review.googlesource.com/4480
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-11 17:02:09 +00:00
Rick Hudson
a15818fed3 runtime: cache workbufs on Ms and add consistency checks
Add local workbufs to the m struct in order to reduce contention.
Add consistency checks for workbuf ownership.
Chain workbufs through call change to avoid swapping them
to and from the m struct.
Adjust the size of the workbuf so that the mutators can
more frequently pass modifications to the GC thus shifting
some work from the STW mark termination phase to the concurrent
mark phase.

Change-Id: I557b53af34ad9972265e0ed9f5996e52d548563d
Reviewed-on: https://go-review.googlesource.com/3972
Reviewed-by: Austin Clements <austin@google.com>
2015-02-11 16:27:17 +00:00
Dmitry Vyukov
59495e8dfd runtime: never show system goroutines in traceback
Fixes #9791

g.issystem flag setup races with other code wherever we set it.
Even if we set both in parent goroutine and in the system goroutine,
it is still possible that some other goroutine crashes
before the flag is set. We could pass issystem flag to newproc1,
but we start all goroutines with go nowadays.

Instead look at g.startpc to distinguish system goroutines (similar to topofstack).

Change-Id: Ia3467968dee27fa07d9fecedd4c2b00928f26645
Reviewed-on: https://go-review.googlesource.com/4113
Reviewed-by: Keith Randall <khr@golang.org>
2015-02-11 10:39:48 +00:00
Dmitry Vyukov
84e2567537 reflect: mark map access functions as go:noescape
benchmark                                  old allocs     new allocs     delta
BenchmarkSkipValue                         14914          14202          -4.77%

Change-Id: I40e1fe8843cc6a099a2abfcd814ecc2a2d6a5b1f
Reviewed-on: https://go-review.googlesource.com/3744
Reviewed-by: Keith Randall <khr@golang.org>
2015-02-11 10:37:45 +00:00
Dmitry Vyukov
e604c6e293 runtime: fix span unusedsince setup
Update #8832

This is probably not the root cause of the issue.
Resolve TODO about setting unusedsince on a wrong span.

Change-Id: I69c87e3d93cb025e3e6fa80a8cffba6ad6ad1395
Reviewed-on: https://go-review.googlesource.com/4390
Reviewed-by: Keith Randall <khr@golang.org>
2015-02-11 10:27:56 +00:00
Austin Clements
f3b73e040c cmd/dist: fetch version when needed, instead of at init
Currently, if there is a VERSION.cache, running make.bash will set
runtime.theVersion to the revision as of the *last* make.bash run
instead of the current make.bash run.

For example,

$ git rev-parse --short HEAD
5c4a86d
$ ./make.bash
...
$ cat ../VERSION.cache
devel +5c4a86d Tue Feb 10 01:46:30 2015 +0000
$ git checkout a1dbb92
$ ./make.bash
...
$ go version
go version devel +5c4a86d Tue Feb 10 01:46:30 2015 +0000 linux/amd64
$ ./make.bash
...
$ go version
go version devel +a1dbb92 Tue Feb 10 02:31:27 2015 +0000 linux/amd64

This happens because go tool dist reads the potentially stale
VERSION.cache into goversion during early initialization; then cleans,
which deletes VERSION.cache; then builds the runtime using the stale
revision read in to goversion.  It isn't until make later in the build
process, when make.bash invokes go tool dist again, that VERSION.cache
gets updated with the current revision.

To address this, simply don't bother fetching the version until go
tool dist needs it and don't bother caching the value in memory.  This
is more robust since it interacts with cleaning in the expected ways.
Futhermore, there's no downside to eliminating the in-memory cache;
the file system cache is perfectly reasonable for the whole three
times make.bash consults it.

Change-Id: I8c480100e56bb2db0816e8a088177004d9e87973
Reviewed-on: https://go-review.googlesource.com/4540
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-11 05:20:58 +00:00
rubyist
32304fc970 crypto/x509: allow matchHostnames to work with absolute domain names
If an absolute domain name (i.e. ends in a '.' like "example.com.") is used
with ssl/tls, the certificate will be reported as invalid. In matchHostnames,
the host and patterns are split on '.' and if the lengths of the resulting
slices do not match, the function returns false. When splitting an absolute
domain name on '.', the slice will have an extra empty string at the end. This
empty string should be discarded before comparison, if present.

Fixes #9828

Change-Id: I0e39674b44a6f93b5024497e76cf1b550832a61d
Reviewed-on: https://go-review.googlesource.com/4380
Reviewed-by: Adam Langley <agl@golang.org>
TryBot: Adam Langley <agl@golang.org>
2015-02-11 01:20:35 +00:00
Keith Randall
6dd31660b0 runtime: don't put container symbols in functab
Container symbols shouldn't be considered as functions in the functab.
Having them present probably messes up function lookup, as you might get
the descriptor of the container instead of the descriptor of the actual
function on the stack.  It also messed up the findfunctab because these
entries caused off-by-one errors in how functab entries were counted.

Normal code is not affected - it only changes (& hopefully fixes) the
behavior for libraries linked as a unit, like:
  net
  runtime/cgo
  runtime/race

Fixes #9804

Change-Id: I81e036e897571ac96567d59e1f1d7f058ca75e85
Reviewed-on: https://go-review.googlesource.com/4290
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-10 23:42:19 +00:00
Mikio Hara
f43a8dea92 net: disable WriteMsgUDP tests on nacl, windows (fix build)
Change-Id: I695b89ec2b63233d94c49c4a40a57b50350ec67c
Reviewed-on: https://go-review.googlesource.com/4350
TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-02-10 23:21:40 +00:00
Mikio Hara
a9a6757c64 net: update documentation for WriteMsgUDP
Change-Id: I69f24887601e491d6d722bfeb2952d927df8ad80
Reviewed-on: https://go-review.googlesource.com/4351
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-02-10 22:27:17 +00:00
Ian Lance Taylor
85cae5d7b8 cmd/pprof/internal/report: fix typo in recognized output unit
Fixes #9814.

Change-Id: I1be49efae0648038f590eeca1262037bf1af3df5
Reviewed-on: https://go-review.googlesource.com/4240
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-10 19:32:59 +00:00
Robert Griesemer
f77696a7f0 math/big: implemented Frexp, Ldexp, IsInt, Copy, bug fixes, more tests
- Frexp, Ldexp are equivalents to the corresponding math functions.
- Set now has the same prec behavior as the other functions
- Copy is a true assignment (replaces old version of Set)
- Cmp now handles infinities
- more tests

Change-Id: I0d33980c08be3095b25d7b3d16bcad1aa7abbd0f
Reviewed-on: https://go-review.googlesource.com/4292
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-10 19:08:53 +00:00
Nicolas S. Dade
263405ea4a net: permit WriteMsgUDP to connected UDP sockets
The sanity checks at the beginning of WriteMsgUDP were too
strict, and did not allow a case sendmsg(2) suppports: sending
to a connected UDP socket.

This fixes the sanity checks. Either the socket is unconnected,
and a destination addresses is required (what all existing callers
must have been doing), or the socket is connected and an explicit
destination address must not be used.

Fixes #9807

Change-Id: I08d4ec3c2bf830335c402acfc0680c841cfcec71
Reviewed-on: https://go-review.googlesource.com/3951
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2015-02-10 08:00:39 +00:00
Alex Brainman
e810a079eb runtime: simplify and comment some windows code
Change-Id: I5cedd9e53f4e020aea74d498d0db88d79a95260c
Reviewed-on: https://go-review.googlesource.com/2718
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-10 03:31:20 +00:00
Rajat Goel
d34ee29a52 net/http: fix test to check that requests to 'localhost' are not proxied
I think the test was meant to test requests to 'localhost:80' instead
of 'localhost:80:80'. It passes even with 'localhost:80:80' because
net.SplitHostPort fails inside useProxy. Please comment if you want to
leave old 'localhost:80' is the list too to check old code path.

Change-Id: Ic4cd21901563449e3d4e2f4c8caf723f4ca15bac
u
Reviewed-on: https://go-review.googlesource.com/4293
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-10 03:01:30 +00:00
Andrew Gerrand
a1dbb9201d cmd/go: use current go source code when generating doc.go
Change-Id: Iad1764707d173a09467fd36e8c49a58147f12219
Reviewed-on: https://go-review.googlesource.com/4320
Reviewed-by: Minux Ma <minux@golang.org>
2015-02-10 02:31:27 +00:00
Alex Brainman
5c4a86d0d0 runtime: introduce CPU access functions on windows
This CL introduces new methods for 'context' type, so we can
manipulate its values in an architecture independent way.

Use new methods to replace both 386 and amd64 versions of
dosigprof with single piece of code.

There is more similar code to be converted in the following CLs.

Also remove os_windows_386.go and os_windows_amd64.go. These
contain unused functions.

Change-Id: I28f76aeb97f6e4249843d30d3d0c33fb233d3f7f
Reviewed-on: https://go-review.googlesource.com/2790
Reviewed-by: Minux Ma <minux@golang.org>
2015-02-10 01:46:30 +00:00
Rob Pike
1e5d8bb544 cmd/go: document that -run isn't implemented
I am an idiot but the failure to implement this means we can decide
exactly what its design should be for 1.5

Change-Id: Ie2b025fcd899d306ddeddd09d1d0e8f9a99ab7a8
Reviewed-on: https://go-review.googlesource.com/4291
Reviewed-by: Minux Ma <minux@golang.org>
2015-02-10 00:56:24 +00:00
mattn
ea22a08fd4 net: re-implement Interfaces and InterfaceAddrs for IPNet, IPv6 on Windows
Fixes #5395

Change-Id: I4322bc8a974d04d9bae6b48c71c5d32d9252973c
Reviewed-on: https://go-review.googlesource.com/3024
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-02-10 00:44:05 +00:00
Dave Cheney
e6fbce3596 cmd/dist: reactivate vfp detection on linux/arm
Fixes #9732
Fixes #9819

Rather than detecting vfp support via catching SIGILL signals,
parse the contents of /proc/cpuinfo.

As the GOARM values for NaCl and freebsd are hard coded, this parsing
logic only needs to support linux/arm.

This change also fixes the nacl/arm build which is broken because the
first stage of nacltest.bash is executed with GOARM=5, embedding that
into 5g.

The second stage of nacltest.bash correctly detects GOARM=7, but this is
ignored as we pass --no-clean at that point, and thus do not replace
the compiler.

Lastyly, include a fix to error message in nacltest.bash

Change-Id: I13f306ff07a99b44b493fade72ac00d0d5097e1c
Reviewed-on: https://go-review.googlesource.com/3981
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-10 00:17:06 +00:00
Shenghou Ma
0661143447 liblink, runtime: move all references to runtime.tlsg to tls_arm.s
CL 2118 makes the assumption that all references to runtime.tlsg
should be accompanied by a declaration of runtime.tlsg if its type
should be a normal variable, instead of a placeholder for TLS
relocation.

Because if runtime.tlsg is not declared by the runtime package,
the type of runtime.tlsg will be zero, so fix the check in liblink
to look for 0 instead of STLSBSS (the type will be initialized by
cmd/ld, but cmd/ld doesn't run during assembly).

Change-Id: I691ac5c3faea902f8b9a0b963e781b22e7b269a7
Reviewed-on: https://go-review.googlesource.com/4030
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-02-09 22:14:06 +00:00
Robert Griesemer
04ce9dbf35 math/big: correct umax
Change-Id: I208c8ac44d1a8882d8fdeb18347dc20941e20374
Reviewed-on: https://go-review.googlesource.com/4250
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-09 19:32:12 +00:00
Rahul Chaudhry
f8176f8111 cmd/go: stream test output if parallelism is set to 1.
"go test -v" buffers output if more than one package is
being tested to avoid mixing the outputs from multiple
tests running in parallel. It currently enables streaming
if there's only a single package under test.

It is ok to stream output from multiple tests if we know
that they're not going to be running in parallel.

To see the difference: go test -v -p=1 runtime fmt -short

Change-Id: Idc24575c899eac30d553e0bf52b86f90e189392d
Reviewed-on: https://go-review.googlesource.com/4153
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-02-09 18:20:28 +00:00
Robert Griesemer
acfe3a59bd math/big: API cleanup
- better and more consistent documentation
- more functions implemented
- more tests

Change-Id: If4c591e7af4ec5434fbb411a48dd0f8add993720
Reviewed-on: https://go-review.googlesource.com/4140
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-02-09 17:53:18 +00:00
Rahul Chaudhry
afac4f0a40 os: embed "sleep 1" within the test binary itself.
This is an alternative to http://golang.org/cl/4150,
and is motivated by a review comment on that CL.

testKillProcess() tries to build and run the Go equivalent
for "sleep 1". This doesn't work for testing cross compilers
since the Go compiler is not available on the targets. This
change embeds the "sleep 1" functionality within the "os.test"
binary itself.

Change-Id: I6bad513deaa6c9e2704e70319098eb4983f1bb23
Reviewed-on: https://go-review.googlesource.com/4190
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-02-09 16:50:39 +00:00
Dmitry Vyukov
6d06d4862d net: don't allocate dialer closure if we won't use it
When we use dialMulti we also allocate dialSingle closure for no reason.

Change-Id: I074282a9d6e2c2a1063ab311a1b95e10fe65219f
Reviewed-on: https://go-review.googlesource.com/4119
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-09 08:30:40 +00:00
Dmitry Vyukov
8ffc450049 cmd/gc: remove dead code
Change-Id: Ib46a42fc873066b1cc00368fe43648f08dce48bd
Reviewed-on: https://go-review.googlesource.com/4200
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-09 08:30:32 +00:00