]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years agoruntime: simplify OpenBSD semaphores
Matthew Dempsky [Mon, 23 Feb 2015 08:05:30 +0000 (17:05 +0900)]
runtime: simplify OpenBSD semaphores

OpenBSD's thrsleep system call includes an "abort" parameter, which
specifies a memory address to be tested after being registered on the
sleep channel (i.e., capable of being woken up by thrwakeup).  By
passing a pointer to waitsemacount for this parameter, we avoid race
conditions without needing a lock.  Instead we just need to use
atomicload, cas, and xadd to mutate the semaphore count.

Change-Id: If9f2ab7cfd682da217f9912783cadea7e72283a8
Reviewed-on: https://go-review.googlesource.com/5563
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Joel Sing <jsing@google.com>
10 years agosyscall: split implementation of Dup2 per linux GOOS
Dave Cheney [Wed, 25 Feb 2015 00:23:04 +0000 (11:23 +1100)]
syscall: split implementation of Dup2 per linux GOOS

Updates #9974

This proposal moves the definition of Dup2 from the generic syscall_linux.go
to the GOOS specific variants. This is in preparation for the arm64 port.

For all existing platforms Dup2 is not affected. When arm64 is added we'll use
either a forwarding method to Dup3 or

//sysnb        Dup2(oldfd int, newfd int) (err error) = SYS_DUP3

Because mksycall.pl does not sort symbols before generating the output file
the diff includes some unavoidable code moves as Dup2 is processed latter in
the run.

Discussion: https://groups.google.com/forum/#!topic/golang-dev/zpeFtN2z5Fc

Change-Id: Icdedf55bb29e749c4230e1ee371bf9d0bd0cfb38
Reviewed-on: https://go-review.googlesource.com/5835
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>

10 years agodoc/go1.5: mention the change in certificate wildcard handling.
Adam Langley [Wed, 25 Feb 2015 00:06:08 +0000 (16:06 -0800)]
doc/go1.5: mention the change in certificate wildcard handling.

https://go-review.googlesource.com/#/c/5691/ shouldn't affect anyone
because it reflects the RFC and behaviour of modern browsers, but it's
probably worth mentioning.

Change-Id: I8a8eedaac5226b1d8018dc56de6b2d41bd82a642
Reviewed-on: https://go-review.googlesource.com/5862
Reviewed-by: Rob Pike <r@golang.org>
10 years agomath/big: permit passing of (possibly nil) *Float to MantExp to avoid allocation
Robert Griesemer [Wed, 25 Feb 2015 00:42:39 +0000 (16:42 -0800)]
math/big: permit passing of (possibly nil) *Float to MantExp to avoid allocation

Change-Id: Ia92eea833283f8b16fa09d4ca1c9cb3bc0eb18a2
Reviewed-on: https://go-review.googlesource.com/5870
Reviewed-by: Rob Pike <r@golang.org>
10 years agosyscall: split implementation of Pipe/Pipe2 per GOOS
Dave Cheney [Tue, 24 Feb 2015 23:20:13 +0000 (10:20 +1100)]
syscall: split implementation of Pipe/Pipe2 per GOOS

Updates #9974

This proposal moves the definition of Pipe an Pipe2 from the generic
syscall_linux.go to the GOOS specific variants. This is in preparation
for the arm64 port.

For platforms where pipe2(2) is not supported in the minimum 2.6.23 kernel,
amd64 and 386, we retain pipe(2). For all other platforms pipe(2) is removed
and Pipe forwards to pipe2(2).

Because mksycall.pl does not sort symbols before generating the output file
the diff includes some unavoidable code moves as Pipe and Pipe2 are processed
latter in the run.

Discussion: https://groups.google.com/forum/#!topic/golang-dev/zpeFtN2z5Fc

Change-Id: Ie26d6761eeb9760dbaff974ee8bc0d57a9ceaee4
Reviewed-on: https://go-review.googlesource.com/5833
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

10 years agocmd/dist: respect runtime.NumCPU when bootstrapping arm hosts
Dave Cheney [Tue, 24 Feb 2015 23:59:20 +0000 (10:59 +1100)]
cmd/dist: respect runtime.NumCPU when bootstrapping arm hosts

This is a reproposal of CL 2957. This reproposal restricts the
scope of this change to just arm systems.

With respect to rsc's comments on 2957, on all my arm hosts they perform
the build significantly faster with this change in place.

Change-Id: Ie09be1a73d5bb777ec5bca3ba93ba73d5612d141
Reviewed-on: https://go-review.googlesource.com/5834
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoruntime: reset gcscanvalid and gcworkdone when GODEBUG=gctrace=2
Rick Hudson [Tue, 24 Feb 2015 22:49:55 +0000 (17:49 -0500)]
runtime: reset gcscanvalid and gcworkdone when GODEBUG=gctrace=2

When GODEBUG=gctrace=2 two gcs are preformed. During the first gc
the stack scan sets the g's gcscanvalid and gcworkdone flags to true
indicating that the stacks have to be scanned and do not need to
be rescanned. These need to be reset to false for the second GC so the
stacks are rescanned, otherwise if the only pointer to an object is
on the stack it will not be discovered and the object will be freed.
Typically this will include the object that was just allocated in
the mallocgc call that initiated the GC.

Change-Id: Ic25163f4689905fd810c90abfca777324005c02f
Reviewed-on: https://go-review.googlesource.com/5861
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agosyscall: rebuild zsyscall_linux_*.go
Dave Cheney [Tue, 24 Feb 2015 21:39:07 +0000 (08:39 +1100)]
syscall: rebuild zsyscall_linux_*.go

Rebuild the zsyscall_linux_*.go files in preperation for #9974

The only change is the ppc64/ppc64le files which were not rebuilt when
syscall.use was added.

Change-Id: I804c63731e4900c782025de04ea3585d99688958
Reviewed-on: https://go-review.googlesource.com/5831
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agomath/big: fix test for 32bit platforms (fix build)
Robert Griesemer [Tue, 24 Feb 2015 21:54:42 +0000 (13:54 -0800)]
math/big: fix test for 32bit platforms (fix build)

Change-Id: I73509cd0e0866cfe2b2ae46a26fb4d043dd050c4
Reviewed-on: https://go-review.googlesource.com/5840
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agogo/ast, go/parser: correct End() position for *ast.EmptyStmt
Robert Griesemer [Tue, 24 Feb 2015 07:51:05 +0000 (23:51 -0800)]
go/ast, go/parser: correct End() position for *ast.EmptyStmt

- added a new field ast.EmptyStmt.Implicit to indicate explicit
  or implicit semicolon
- fix ast.EmptyStmt.End() accordingly
- adjusted parser and added test case

Fixes #9979.

Change-Id: I72b0983b3a0cabea085598e1bf6c8df629776b57
Reviewed-on: https://go-review.googlesource.com/5720
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agomath/big: change Float.SetMantExp to always multiply mant by 2**exp
Robert Griesemer [Tue, 24 Feb 2015 19:24:27 +0000 (11:24 -0800)]
math/big: change Float.SetMantExp to always multiply mant by 2**exp

Change-Id: If840e647376a2141f8c17729f7ef251bfff13f5f
Reviewed-on: https://go-review.googlesource.com/5810
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/asm: fix build for new aliases
Rob Pike [Tue, 24 Feb 2015 20:30:39 +0000 (12:30 -0800)]
cmd/asm: fix build for new aliases

Missing leading A on names.

Change-Id: I6f3a66bdd3a21220f45a898f0822930b6a7bfa38
Reviewed-on: https://go-review.googlesource.com/5801
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/asm: add alias for MOVOA=MOVO on amd64
Rob Pike [Tue, 24 Feb 2015 19:00:07 +0000 (11:00 -0800)]
cmd/asm: add alias for MOVOA=MOVO on amd64

The alias should exist for both 386 and amd64.
There were a few others missing as well. Add them.

Change-Id: Ia0c3e71abc79f67a7a66941c0d932a8d5d6e9989
Reviewed-on: https://go-review.googlesource.com/5800
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocrypto/x509: make behaviour of absolute DNS names match Chromium.
Adam Langley [Mon, 23 Feb 2015 23:32:08 +0000 (15:32 -0800)]
crypto/x509: make behaviour of absolute DNS names match Chromium.

Previously, we didn't handle absolute DNS names in certificates the same
way as Chromium, and we probably shouldn't diverge from major browsers.

Change-Id: I56a3962ad1002f68b5dbd65ae90991b82c2f5629
Reviewed-on: https://go-review.googlesource.com/5692
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocrypto/x509: allow wildcards only as the first label.
Adam Langley [Mon, 23 Feb 2015 23:11:39 +0000 (15:11 -0800)]
crypto/x509: allow wildcards only as the first label.

RFC 6125 now specifies that wildcards are only allowed for the leftmost
label in a pattern: https://tools.ietf.org/html/rfc6125#section-6.4.3.

This change updates Go to match the behaviour of major browsers in this
respect.

Fixes #9834.

Change-Id: I37c10a35177133624568f2e0cf2767533926b04a
Reviewed-on: https://go-review.googlesource.com/5691
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocrypto/tls: allow larger initial records.
Adam Langley [Mon, 23 Feb 2015 22:51:40 +0000 (14:51 -0800)]
crypto/tls: allow larger initial records.

Some servers which misunderstood the point of the CertificateRequest
message send huge reply records. These records are large enough that
they were considered “insane” by the TLS code and rejected.

This change removes the sanity test for record lengths. Although the
maxCiphertext test still remains, just above, which (roughly) enforces
the 16KB protocol limit on record sizes:
https://tools.ietf.org/html/rfc5246#section-6.2.1

Fixes #8928.

Change-Id: Idf89a2561b1947325b7ddc2613dc2da638d7d1c9
Reviewed-on: https://go-review.googlesource.com/5690
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocrypto/x509: don't reject certs with critical policy extensions.
Adam Langley [Mon, 23 Feb 2015 22:27:50 +0000 (14:27 -0800)]
crypto/x509: don't reject certs with critical policy extensions.

There was a missing continue that caused certificates with critical
certificate-policy extensions to be rejected. Additionally, that code
structure in general was prone to exactly that bug so I changed it
around to hopefully be more robust in the future.

Fixes #9964.

Change-Id: I58fc6ef3a84c1bd292a35b8b700f44ef312ec1c1
Reviewed-on: https://go-review.googlesource.com/5670
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agomath/big: fix several issues with string->Float conversion
Robert Griesemer [Sat, 14 Feb 2015 01:57:26 +0000 (17:57 -0800)]
math/big: fix several issues with string->Float conversion

Change-Id: I7bf7154e2d8d779fdf7f1d2bb561a06ad174f3b0
Reviewed-on: https://go-review.googlesource.com/4883
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agocmd/go: limit default darwin/arm parallelism
David Crawshaw [Tue, 24 Feb 2015 16:10:13 +0000 (11:10 -0500)]
cmd/go: limit default darwin/arm parallelism

iOS devices can only run tests serially.

Change-Id: I3f4e7abddf812a186895d9d5138999c8bded698f
Reviewed-on: https://go-review.googlesource.com/5751
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
10 years agosync: add active spinning to Mutex
Dmitry Vyukov [Fri, 20 Feb 2015 08:50:56 +0000 (11:50 +0300)]
sync: add active spinning to Mutex

Currently sync.Mutex is fully cooperative. That is, once contention is discovered,
the goroutine calls into scheduler. This is suboptimal as the resource can become
free soon after (especially if critical sections are short). Server software
usually runs at ~~50% CPU utilization, that is, switching to other goroutines
is not necessary profitable.

This change adds limited active spinning to sync.Mutex if:
1. running on a multicore machine and
2. GOMAXPROCS>1 and
3. there is at least one other running P and
4. local runq is empty.
As opposed to runtime mutex we don't do passive spinning,
because there can be work on global runq on on other Ps.

benchmark                   old ns/op     new ns/op     delta
BenchmarkMutexNoSpin        1271          1272          +0.08%
BenchmarkMutexNoSpin-2      702           683           -2.71%
BenchmarkMutexNoSpin-4      377           372           -1.33%
BenchmarkMutexNoSpin-8      197           190           -3.55%
BenchmarkMutexNoSpin-16     131           122           -6.87%
BenchmarkMutexNoSpin-32     170           164           -3.53%
BenchmarkMutexSpin          4724          4728          +0.08%
BenchmarkMutexSpin-2        2501          2491          -0.40%
BenchmarkMutexSpin-4        1330          1325          -0.38%
BenchmarkMutexSpin-8        684           684           +0.00%
BenchmarkMutexSpin-16       414           372           -10.14%
BenchmarkMutexSpin-32       559           469           -16.10%

BenchmarkMutex                 19.1          19.1          +0.00%
BenchmarkMutex-2               81.6          54.3          -33.46%
BenchmarkMutex-4               143           100           -30.07%
BenchmarkMutex-8               154           156           +1.30%
BenchmarkMutex-16              140           159           +13.57%
BenchmarkMutex-32              141           163           +15.60%
BenchmarkMutexSlack            33.3          31.2          -6.31%
BenchmarkMutexSlack-2          122           97.7          -19.92%
BenchmarkMutexSlack-4          168           158           -5.95%
BenchmarkMutexSlack-8          152           158           +3.95%
BenchmarkMutexSlack-16         140           159           +13.57%
BenchmarkMutexSlack-32         146           162           +10.96%
BenchmarkMutexWork             154           154           +0.00%
BenchmarkMutexWork-2           89.2          89.9          +0.78%
BenchmarkMutexWork-4           139           86.1          -38.06%
BenchmarkMutexWork-8           177           162           -8.47%
BenchmarkMutexWork-16          170           173           +1.76%
BenchmarkMutexWork-32          176           176           +0.00%
BenchmarkMutexWorkSlack        160           160           +0.00%
BenchmarkMutexWorkSlack-2      103           99.1          -3.79%
BenchmarkMutexWorkSlack-4      155           148           -4.52%
BenchmarkMutexWorkSlack-8      176           170           -3.41%
BenchmarkMutexWorkSlack-16     170           173           +1.76%
BenchmarkMutexWorkSlack-32     175           176           +0.57%

"No work" benchmarks are not very interesting (BenchmarkMutex and
BenchmarkMutexSlack), as they are absolutely not realistic.

Fixes #8889

Change-Id: I6f14f42af1fa48f73a776fdd11f0af6dd2bb428b
Reviewed-on: https://go-review.googlesource.com/5430
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>

10 years agonet: enable TestTCPReadWriteAllocs in short mode
Mikio Hara [Tue, 24 Feb 2015 05:13:47 +0000 (14:13 +0900)]
net: enable TestTCPReadWriteAllocs in short mode

The change 2096 removed unwanted allocations and a few noises in test
using AllocsPerRun. Now it's safe to enable this canary test on netpoll
hotpaths.

Change-Id: Icdbee813d81c1410a48ea9960d46447042976905
Reviewed-on: https://go-review.googlesource.com/5713
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agocrypto/rsa: drop the primality check in crypto/rsa.Validate.
Adam Langley [Mon, 23 Feb 2015 21:28:57 +0000 (13:28 -0800)]
crypto/rsa: drop the primality check in crypto/rsa.Validate.

This check is expensive and adversely impacts startup times for some
servers with several, large RSA keys.

It was nice to have, but it's not really going to stop a targetted
attack and was never designed to – hopefully people's private keys
aren't attacker controlled!

Overall I think the feeling is that people would rather have the CPU
time back.

Fixes #6626.

Change-Id: I0143a58c9f22381116d4ca2a3bbba0d28575f3e5
Reviewed-on: https://go-review.googlesource.com/5641
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>

10 years agomath: Dim, Max, Min - allow more bit patterns for NaN
Charlie Dorian [Sun, 22 Feb 2015 21:12:51 +0000 (16:12 -0500)]
math: Dim, Max, Min - allow more bit patterns for NaN

Fixes #9919

Change-Id: Ib443c762f727d4986ca7f8a404362f92b0e91aff
Reviewed-on: https://go-review.googlesource.com/5553
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoall: merge dev.cc (a91c2e0) into master
Russ Cox [Mon, 23 Feb 2015 21:50:05 +0000 (16:50 -0500)]
all: merge dev.cc (a91c2e0) into master

This change deletes the C implementations of
the Go compiler and assembler from the master branch.

The Go implementations are a bit slower right now,
due mainly to garbage generated by taking addresses
of stack variables all over the place (it was C code,
after all). That will be cleaned up (mechanically) over the
next week or so, and things will get faster.

Change-Id: I66b2b3477aec8835f9960d0798f5752dcd98d08f

10 years agoruntime: eliminate unnecessary assumption in heapBitsForObject
Austin Clements [Mon, 23 Feb 2015 19:33:56 +0000 (14:33 -0500)]
runtime: eliminate unnecessary assumption in heapBitsForObject

The slow path of heapBitsForObjects somewhat subtly assumes that the
pointer will not point to the first word of the object and will round
the pointer wrong if this assumption is violated.  This assumption is
safe because the fast path should always take care of this case, but
there's no benefit to making this assumption, it makes the code more
difficult to experiment with than necessary, and it's trivial to
eliminate.

Change-Id: Iedd336f7d529a27d3abeb83e77dfb32a285ea73a
Reviewed-on: https://go-review.googlesource.com/5636
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/internal/obj: set ctxt.Windows != 0 on windows
Russ Cox [Mon, 23 Feb 2015 21:29:00 +0000 (16:29 -0500)]
[dev.cc] cmd/internal/obj: set ctxt.Windows != 0 on windows

May fix windows build.

Change-Id: Ic4e32a4478caf758da6b02bc9126ddacb0fc07e0
Reviewed-on: https://go-review.googlesource.com/5650
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/5g etc: code cleanup: delay var decls and eliminate dead code
Russ Cox [Mon, 23 Feb 2015 21:07:24 +0000 (16:07 -0500)]
[dev.cc] cmd/5g etc: code cleanup: delay var decls and eliminate dead code

Ran rsc.io/grind rev 6f0e601 on the source files.

The cleanups move var declarations as close to the use
as possible, splitting disjoint uses of the var into separate
variables. They also remove dead code (especially in
func sudoaddable), which helps with the var moving.

There's more cleanup to come, but this alone cuts the
time spent compiling html/template on my 2013 MacBook Pro
from 3.1 seconds to 2.3 seconds.

Change-Id: I4de499f47b1dd47a560c310bbcde6b08d425cfd6
Reviewed-on: https://go-review.googlesource.com/5637
Reviewed-by: Rob Pike <r@golang.org>
10 years agomath/big: fix formatting for 'b' format
Robert Griesemer [Mon, 23 Feb 2015 21:15:10 +0000 (13:15 -0800)]
math/big: fix formatting for 'b' format

Fixes #9939.

Change-Id: I9d60722b648fbc00650115da539a7466c6c86552
Reviewed-on: https://go-review.googlesource.com/5640
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoruntime/pprof: make TestBlockProfile more robust
Shenghou Ma [Mon, 23 Feb 2015 08:55:54 +0000 (03:55 -0500)]
runtime/pprof: make TestBlockProfile more robust

It's using debug mode of pprof.writeBlock, so the output actually goes
through text/tabwriter. It is possible that tabwriter expands each tab
into multiple tabs in certain cases.

For example, this output has been observed on the new arm64 port:
10073805 1 @ 0x1088ec 0xd1b8c 0xd0628 0xb68c0 0x867f4
# 0x1088ec sync.(*Cond).Wait+0xfc /home/minux/go.git/src/sync/cond.go:63
# 0xd1b8c runtime/pprof_test.blockCond+0x22c /home/minux/go.git/src/runtime/pprof/pprof_test.go:454
# 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359
# 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447

10069965 1 @ 0x14008 0xd1390 0xd0628 0xb68c0 0x867f4
# 0x14008 runtime.chansend1+0x48 /home/minux/go.git/src/runtime/chan.go:76
# 0xd1390 runtime/pprof_test.blockChanSend+0x100 /home/minux/go.git/src/runtime/pprof/pprof_test.go:396
# 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359
# 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447

10069706 1 @ 0x108e0c 0xd193c 0xd0628 0xb68c0 0x867f4
# 0x108e0c sync.(*Mutex).Lock+0x19c /home/minux/go.git/src/sync/mutex.go:67
# 0xd193c runtime/pprof_test.blockMutex+0xbc /home/minux/go.git/src/runtime/pprof/pprof_test.go:441
# 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359
# 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447

Change-Id: I3bef778c5fe01a894cfdc526fdc5fecb873b8ade
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/5554
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agomath: faster Cbrt
Charles Dorian [Thu, 19 Feb 2015 01:05:38 +0000 (20:05 -0500)]
math: faster Cbrt

Old 45.3 ns/op, new 19.9 ns/op.

Change-Id: If2a201981dcc259846631ecbc694c401e0a80287
Reviewed-on: https://go-review.googlesource.com/5260
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/6a, cmd/6g etc: replace C implementations with Go implementations
Russ Cox [Mon, 23 Feb 2015 19:20:01 +0000 (14:20 -0500)]
[dev.cc] cmd/6a, cmd/6g etc: replace C implementations with Go implementations

Change-Id: I58e00a39cf63df07813d21453f91e68eef6a413c
Reviewed-on: https://go-review.googlesource.com/5635
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/dist, cmd/go: stop building C implementations of compilers, assemblers
Russ Cox [Mon, 23 Feb 2015 19:10:08 +0000 (14:10 -0500)]
[dev.cc] cmd/dist, cmd/go: stop building C implementations of compilers, assemblers

Also stop building objwriter, which was only used by them.

Change-Id: Ia2353abd9426026a81a263cb46a72dd39c360ce4
Reviewed-on: https://go-review.googlesource.com/5634
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/internal/gc: reconvert to pick up bug fixes
Russ Cox [Mon, 23 Feb 2015 19:02:27 +0000 (14:02 -0500)]
[dev.cc] cmd/internal/gc: reconvert to pick up bug fixes

Convert using rsc.io/c2go rev a97ff47.

Notable changes:
- %% in format string now correctly preserved
- reintroduce "signal handler" to hide internal faults
  after errors have been printed

Change-Id: Ic5a94f1c3a8015a9054e21c8969b52d964a36c45
Reviewed-on: https://go-review.googlesource.com/5633
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] test: disable syntax error tests
Russ Cox [Mon, 23 Feb 2015 19:00:51 +0000 (14:00 -0500)]
[dev.cc] test: disable syntax error tests

These don't work with the new compiler, because the
new compiler doesn't have the custom syntax errors
that I built for the old compiler. It will, just not yet.
(Issue #9968.)

Change-Id: I658f7dab2c7f855340a501f9ae4479c097b28cd3
Reviewed-on: https://go-review.googlesource.com/5632
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/asm: add end to end test for amd64
Rob Pike [Mon, 23 Feb 2015 19:49:36 +0000 (11:49 -0800)]
[dev.cc] cmd/asm: add end to end test for amd64

Change-Id: I40839c2d1c0c105a5ba9aadcb55a13693bf4afa6
Reviewed-on: https://go-review.googlesource.com/5592
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/go: do not install tools while executing them
Russ Cox [Mon, 23 Feb 2015 16:47:48 +0000 (11:47 -0500)]
[dev.cc] cmd/go: do not install tools while executing them

Change-Id: I3417efc203f555a0a6101701f387ead84f9a08d1
Reviewed-on: https://go-review.googlesource.com/5577
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] all: merge master (6a10f72) into dev.cc
Russ Cox [Mon, 23 Feb 2015 19:27:55 +0000 (14:27 -0500)]
[dev.cc] all: merge master (6a10f72) into dev.cc

To pick up darwin/arm fix and hopefully fix build.

Change-Id: I06996d0b13b777e476f65405aee031482fc76439

10 years agomath/big: don't return io.EOF on successful call of ParseFloat
Robert Griesemer [Mon, 23 Feb 2015 18:57:21 +0000 (10:57 -0800)]
math/big: don't return io.EOF on successful call of ParseFloat

Fixes $9938.

Change-Id: Ie8680a875225748abd660fb26b4c25546e7b92d3
Reviewed-on: https://go-review.googlesource.com/5620
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoruntime: Add prefetch to allocation code
Rick Hudson [Thu, 19 Feb 2015 23:11:24 +0000 (18:11 -0500)]
runtime: Add prefetch to allocation code

The routine mallocgc retrieves objects from freelists. Prefetch
the object that will be returned in the next call to mallocgc.
Experiments indicate that this produces a 1% improvement when using
prefetchnta and less when using prefetcht0, prefetcht1, or prefetcht2.

Benchmark numbers indicate a 1% improvement over no
prefetch, much less over prefetcht0, prefetcht1, and prefetcht2.
These numbers were for the garbage benchmark with MAXPROCS=4
no prefetch                          >> 5.96 / 5.77 / 5.89
prefetcht0(uintptr(v.ptr().next))    >> 5.88 / 6.17 / 5.84
prefetcht1(uintptr(v.ptr().next))    >> 5.88 / 5.89 / 5.91
prefetcht2(uintptr(v.ptr().next))    >> 5.87 / 6.47 / 5.92
prefetchnta(uintptr(v.ptr().next))   >> 5.72 / 5.84 / 5.85

Change-Id: I54e07172081cccb097d5b5ce8789d74daa055ed9
Reviewed-on: https://go-review.googlesource.com/5350
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Austin Clements <austin@google.com>
10 years agogo/token: document that column positions and file offsets are in bytes
Robert Griesemer [Mon, 23 Feb 2015 18:20:20 +0000 (10:20 -0800)]
go/token: document that column positions and file offsets are in bytes

Fixes #9948.

Change-Id: I7b354fccd5e933eeeb2253a66acec050ebff6e41
Reviewed-on: https://go-review.googlesource.com/5611
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: incorporated feedback from prior TBR reviews
Robert Griesemer [Mon, 23 Feb 2015 18:05:02 +0000 (10:05 -0800)]
math/big: incorporated feedback from prior TBR reviews

Change-Id: Ida847365223ef09b4a3846e240b4bb6919cb0fe9
Reviewed-on: https://go-review.googlesource.com/5610
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agonet/mail: move RFC 2047 code to internal/mime
Alexandre Cesaro [Tue, 23 Dec 2014 19:29:13 +0000 (20:29 +0100)]
net/mail: move RFC 2047 code to internal/mime

The code concerning quoted-printable encoding (RFC 2045) and its
variant for MIME headers (RFC 2047) is currently spread in
mime/multipart and net/mail. It is also not exported.

This commit is the second step to fix that issue. It moves the
RFC 2047 encoding and decoding functions from net/mail to
internal/mime. The exported API is unchanged.

Updates #4943

Change-Id: I5f58aa58e74bbe4ec91b2e9b8c81921338053b00
Reviewed-on: https://go-review.googlesource.com/2101
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/go: link cgo into tests on darwin/arm
David Crawshaw [Fri, 20 Feb 2015 16:05:36 +0000 (11:05 -0500)]
cmd/go: link cgo into tests on darwin/arm

We currently have only one supported darwin/arm device, a locked iOS
machine. It requires cgo binaries.

Change-Id: If36a152e6a743e4a58ea3470e62cccb742630a5d
Reviewed-on: https://go-review.googlesource.com/5443
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] misc/nacl: add testdata for cmd/internal/rsc.io/x86/x86asm
Russ Cox [Mon, 23 Feb 2015 15:29:25 +0000 (10:29 -0500)]
[dev.cc] misc/nacl: add testdata for cmd/internal/rsc.io/x86/x86asm

Should fix nacl build on dev.cc.

Change-Id: I166a03b5f6903bd8bbce65af4e5f2899807bb6cc
Reviewed-on: https://go-review.googlesource.com/5575
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

10 years ago[dev.cc] runtime, syscall: add names to FP offsets in freebsd, netbsd arm assembly
Russ Cox [Mon, 23 Feb 2015 15:56:10 +0000 (10:56 -0500)]
[dev.cc] runtime, syscall: add names to FP offsets in freebsd, netbsd arm assembly

Makes them compatible with the new asm.
Applied mechanically from vet diagnostics.

Manual edits: the names for arguments in time·now(SB) in runtime/sys_*_arm.s.

Change-Id: Ib295390d9509d306afc67714e3f50dc832256625
Reviewed-on: https://go-review.googlesource.com/5576
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/new6g, etc: reconvert to add profiling
Russ Cox [Mon, 23 Feb 2015 15:22:26 +0000 (10:22 -0500)]
[dev.cc] cmd/new6g, etc: reconvert to add profiling

Converted from rsc.io/c2go rev a9bc7f2.
Adds profiling support.

Change-Id: Ie04f86b71e0713c7294416c77d349e0d93798403
Reviewed-on: https://go-review.googlesource.com/5574
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] all: merge master (48469a2) into dev.cc
Russ Cox [Mon, 23 Feb 2015 15:15:35 +0000 (10:15 -0500)]
[dev.cc] all: merge master (48469a2) into dev.cc

Change-Id: I10f7950d173b302151f2a31daebce297b4306ebe

10 years ago[dev.cc] cmd/go: fix expansion of cmd
Russ Cox [Sun, 22 Feb 2015 18:17:43 +0000 (13:17 -0500)]
[dev.cc] cmd/go: fix expansion of cmd

This was supposed to be in the previous CL, but I forgot to 'git rw' it down.

Change-Id: Ia5e14ca2c7640f08abbbed1a777a6cf04d71d0e7
Reviewed-on: https://go-review.googlesource.com/5570
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] doc/go1.5: mention cmd/go meaning of std change
Russ Cox [Sun, 22 Feb 2015 17:48:16 +0000 (12:48 -0500)]
[dev.cc] doc/go1.5: mention cmd/go meaning of std change

Change-Id: I259e88f019b6818c57caaa1ec236b7c2e2ae1382
Reviewed-on: https://go-review.googlesource.com/5551
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/go: fix expansion of 'std', add 'cmd'
Russ Cox [Sun, 22 Feb 2015 17:41:32 +0000 (12:41 -0500)]
[dev.cc] cmd/go: fix expansion of 'std', add 'cmd'

The wildcard 'std' is defined in documentation to be all the packages
in the Go standard library. It has also historically matched commands
in the main repo, but as we implement core commands in Go, that
becomes problematic. We need a wildcard that means just the library,
and since 'std' is already documented to have that definition, make it so.

Add a new wildcard 'cmd' for the commands in the main repo ($GOROOT).
Commands that want both can say 'std cmd' (or 'cmd std') to get the
effect of the old 'std'.

Update make.bash etc to say both std and cmd most of the time.

Exception: in race.bash, do not install race-enabled versions of
the actual commands. This avoids trying to write binaries while
using them, but more importantly it avoids enabling the race
detector and its associated memory overhead for the already
memory-hungry compilers.

Change-Id: I26bb06cb13b636dfbe71a015ee0babeb270a0275
Reviewed-on: https://go-review.googlesource.com/5550
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/ld: fix warning on Plan 9
David du Colombier [Sat, 21 Feb 2015 01:53:07 +0000 (02:53 +0100)]
cmd/ld: fix warning on Plan 9

cpp: src/cmd/ld/lib.h:349 No newline at end of file

Change-Id: Id21851963f7778364ba9337da3bacd312443f51f
Reviewed-on: https://go-review.googlesource.com/5520
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoruntime: remove unneeded C header files
Matthew Dempsky [Mon, 23 Feb 2015 06:24:49 +0000 (15:24 +0900)]
runtime: remove unneeded C header files

Change-Id: I239ae86cfebfece607dce39a96d9123cbacbee7d
Reviewed-on: https://go-review.googlesource.com/5562
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
10 years agonet/http: Removed some unused constants in request.go.
Aaron Jacobs [Sun, 22 Feb 2015 23:44:39 +0000 (10:44 +1100)]
net/http: Removed some unused constants in request.go.

Change-Id: I05cdf357249166a45105703e9317793aa2088844
Reviewed-on: https://go-review.googlesource.com/5560
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agogdb: fix "gdb.error: No struct named reflect.rtype."
Jan Kratochvil [Sat, 21 Feb 2015 16:35:01 +0000 (17:35 +0100)]
gdb: fix "gdb.error: No struct named reflect.rtype."

With a trivial Golang-built program loaded in gdb-7.8.90.20150214-7.fc23.x86_64
I get this error:

(gdb) source ./src/runtime/runtime-gdb.py
Loading Go Runtime support.
Traceback (most recent call last):
  File "./src/runtime/runtime-gdb.py", line 230, in <module>
    _rctp_type = gdb.lookup_type("struct reflect.rtype").pointer()
gdb.error: No struct type named reflect.rtype.
(gdb) q

No matter if this struct should or should not be in every Golang-built binary
this change should fix that with no disadvantages.

Change-Id: I0c490d3c9bbe93c65a2183b41bfbdc0c0f405bd1
Reviewed-on: https://go-review.googlesource.com/5521
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoCall --> CallSlice in two spots. No logic change, docs only.
Mark Bucciarelli [Sun, 22 Feb 2015 02:14:45 +0000 (21:14 -0500)]
Call --> CallSlice in two spots.  No logic change, docs only.

Change-Id: I6011e162214db2d65efc1ecdb5ec600ca8e5bfe9
Reviewed-on: https://go-review.googlesource.com/5542
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years ago[dev.cc] cmd/asm/internal/asm: fix test on nacl
Russ Cox [Sat, 21 Feb 2015 18:05:25 +0000 (13:05 -0500)]
[dev.cc] cmd/asm/internal/asm: fix test on nacl

Need to add testdata to NaCl's testing file system.

Change-Id: Ie9703b5475c7f87e737a06de85d1f88e2062f090
Reviewed-on: https://go-review.googlesource.com/5541
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm/internal/asm: fix test on windows
Russ Cox [Sat, 21 Feb 2015 17:53:30 +0000 (12:53 -0500)]
[dev.cc] cmd/asm/internal/asm: fix test on windows

Change-Id: Ia6cf3204d71740bc2b6e26c53ac5206e8a33a180
Reviewed-on: https://go-review.googlesource.com/5540
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/go: reenable verifyCompiler
Russ Cox [Fri, 20 Feb 2015 18:55:50 +0000 (13:55 -0500)]
[dev.cc] cmd/go: reenable verifyCompiler

Change-Id: Ic7367f2c6e6d4e6b802ce8436022412a1862ca58
Reviewed-on: https://go-review.googlesource.com/5472
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/new6g etc: reconvert from C
Russ Cox [Fri, 20 Feb 2015 18:54:45 +0000 (13:54 -0500)]
[dev.cc] cmd/new6g etc: reconvert from C

Reconvert using rsc.io/c2go rev 27b3f59.
(Same as last conversion, but C sources have changed
due to merging master into this branch.)

Change-Id: Ib314bb9ac14a726ceb83e2ecf4d1ad2d0b331c38
Reviewed-on: https://go-review.googlesource.com/5471
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/asm: fix build: broken end to end test
Rob Pike [Sat, 21 Feb 2015 03:31:37 +0000 (19:31 -0800)]
[dev.cc] cmd/asm: fix build: broken end to end test

This time for sure.

Change-Id: I77ed6b70d82a6f4ba371afba2f53c8b146ac110f
Reviewed-on: https://go-review.googlesource.com/5530
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/asm: fix build
Rob Pike [Sat, 21 Feb 2015 02:15:20 +0000 (18:15 -0800)]
[dev.cc] cmd/asm: fix build

Representation in printout of MRC instruction differs between
32- and 64-bit machines. It's just a hex dump. Fix this one day,
but for now just comment out the instruction.

Change-Id: I4709390659e2e0f2d18ff6f8e762f97cdbfb4c16
Reviewed-on: https://go-review.googlesource.com/5424
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/asm: add end-to-end test
Rob Pike [Fri, 20 Feb 2015 18:06:44 +0000 (10:06 -0800)]
[dev.cc] cmd/asm: add end-to-end test

Add trivial golden test that verifies output matches expectation.
The input is based on the old grammar and is intended to cover
the space of the input language.

PPC64 and ARM only for now; others to follow.

Change-Id: Ib5957822bcafd5b9d4c1dea1c03cc6ee1238f7ef
Reviewed-on: https://go-review.googlesource.com/5421
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cm/asm: fix up arm after cross-check with 5a
Rob Pike [Sat, 21 Feb 2015 00:02:11 +0000 (16:02 -0800)]
[dev.cc] cm/asm: fix up arm after cross-check with 5a

As with the previous round for ppc64, this CL fixes a couple of things
that 5a supported but asm did not, both simple.

1) Allow condition code on MRC instruction; this was marked as a TODO.
2) Allow R(n) notation in ARM register shifts.  The code needs a rethink
but the tests we're leading toward will make the rewrite easier to test and
trust.

Change-Id: I5b52ad25d177a74cf07e089dddfeeab21863c424
Reviewed-on: https://go-review.googlesource.com/5422
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] crypto/md5, crypto/sha1: restore a few SP references
Russ Cox [Fri, 20 Feb 2015 18:40:12 +0000 (13:40 -0500)]
[dev.cc] crypto/md5, crypto/sha1: restore a few SP references

Applying my post-submit comments from CL 5120.
The rewrite there changed the code from writing to the stack
frame to writing below the stack frame.

Change-Id: Ie7e0563c0c1731fede2bcefeaf3c9d88a0cf4063
Reviewed-on: https://go-review.googlesource.com/5470
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years ago[dev.cc] cmd/asm: add ppc64le support
Russ Cox [Fri, 20 Feb 2015 17:23:27 +0000 (12:23 -0500)]
[dev.cc] cmd/asm: add ppc64le support

Change-Id: I780ed76c9217d387a73fd7530af2f40948aa1fe4
Reviewed-on: https://go-review.googlesource.com/5452
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/go: install cmd/asm as a tool
Russ Cox [Fri, 20 Feb 2015 17:22:50 +0000 (12:22 -0500)]
[dev.cc] cmd/go: install cmd/asm as a tool

cmd/dist was doing the right thing, but not cmd/go.

Change-Id: I5412140cfc07e806152915cc49db7f63352d01ca
Reviewed-on: https://go-review.googlesource.com/5451
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/trace: add new command
Dmitry Vyukov [Fri, 30 Jan 2015 10:31:43 +0000 (13:31 +0300)]
cmd/trace: add new command

Trace command allows to visualize and analyze traces.
Run as:
$ go tool trace binary trace.file
The commands opens web browser with the main page,
which contains links for trace visualization,
blocking profiler, network IO profiler and per-goroutine
traces.

Also move trace parser from runtime/pprof/trace_parser_test.go
to internal/trace/parser.go, so that it can be shared between
tests and the command.

Change-Id: Ic97ed59ad6e4c7e1dc9eca5e979701a2b4aed7cf
Reviewed-on: https://go-review.googlesource.com/3601
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years ago[dev.cc] runtime: print to stderr as well as android logd
David Crawshaw [Fri, 20 Feb 2015 18:15:56 +0000 (13:15 -0500)]
[dev.cc] runtime: print to stderr as well as android logd

Restores stack traces in the android/arm builder.

Change-Id: If637aa2ed6f8886126b77cf9cc8a0535ec7c4369
Reviewed-on: https://go-review.googlesource.com/5453
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
10 years agoruntime/race: update race runtime to rev 229396
Dmitry Vyukov [Mon, 16 Feb 2015 15:41:56 +0000 (18:41 +0300)]
runtime/race: update race runtime to rev 229396

Fixes #9720
Fixes #8053
Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=89

Change-Id: I7d598e53de86586bb9702d8e9276a4d6aece2dfc
Reviewed-on: https://go-review.googlesource.com/4950
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: adjust program counters in race detector
Dmitry Vyukov [Sat, 14 Feb 2015 12:54:25 +0000 (15:54 +0300)]
runtime: adjust program counters in race detector

In most cases we pass return PC to race detector,
and race runtime subtracts one from them.
However, in manual instrumentation in runtime
we pass function start PC to race runtime.
Race runtime can't distinguish these cases
and so it does not subtract one from top PC.
This leads to bogus line numbers in some cases.
Make it consistent and always pass what looks
like a return PC, so that race runtime can
subtract one and still get PC in the same function.

Also delete two unused functions.

Update #8053

Change-Id: I4242dec5e055e460c9a8990eaca1d085ae240ed2
Reviewed-on: https://go-review.googlesource.com/4902
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: split gc_m into gcMark and gcSweep
Russ Cox [Thu, 19 Feb 2015 21:43:27 +0000 (16:43 -0500)]
runtime: split gc_m into gcMark and gcSweep

This is a nice split but more importantly it provides a better
way to fit the checkmark phase into the sequencing.

Also factor out common span copying into gcSpanCopy.

Change-Id: Ia058644974e4ed4ac3cf4b017a3446eb2284d053
Reviewed-on: https://go-review.googlesource.com/5333
Reviewed-by: Austin Clements <austin@google.com>
10 years agoruntime: unroll gc_m loop
Russ Cox [Thu, 19 Feb 2015 21:21:00 +0000 (16:21 -0500)]
runtime: unroll gc_m loop

The loop made more sense when gc_m was not its own function.

Change-Id: I71a7f21d777e69c1924e3b534c507476daa4dfdd
Reviewed-on: https://go-review.googlesource.com/5332
Reviewed-by: Austin Clements <austin@google.com>
10 years agoruntime: tidy GC driver
Russ Cox [Thu, 19 Feb 2015 20:48:40 +0000 (15:48 -0500)]
runtime: tidy GC driver

Change-Id: I0da26e89ae73272e49e82c6549c774e5bc97f64c
Reviewed-on: https://go-review.googlesource.com/5331
Reviewed-by: Austin Clements <austin@google.com>
10 years agoruntime: fix cputicks on x86
Dmitry Vyukov [Tue, 17 Feb 2015 11:25:49 +0000 (14:25 +0300)]
runtime: fix cputicks on x86

See the following issue for context:
https://github.com/golang/go/issues/9729#issuecomment-74648287
In short, RDTSC can produce skewed results without preceding LFENCE/MFENCE.
Information on this matter is very scrappy in the internet.
But this is what linux kernel does (see rdtsc_barrier).
It also fixes the test program on my machine.

Update #9729

Change-Id: I3c1ffbf129fdfdd388bd5b7911b392b319248e68
Reviewed-on: https://go-review.googlesource.com/5033
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years ago[dev.cc] cmd/asm: implement FMADD for ppc64
Rob Pike [Fri, 20 Feb 2015 05:10:00 +0000 (21:10 -0800)]
[dev.cc] cmd/asm: implement FMADD for ppc64

Missed this one instruction in the previous pass.

Change-Id: Ic8cdae4d3bfd626c6bbe0ce49fce28b53db2ad1c
Reviewed-on: https://go-review.googlesource.com/5420
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] all: merge master (5868ce3) into dev.cc
Russ Cox [Fri, 20 Feb 2015 15:28:36 +0000 (10:28 -0500)]
[dev.cc] all: merge master (5868ce3) into dev.cc

This time for sure!

Change-Id: I7e7ea24edb7c2f711489e162fb97237a87533089

10 years ago[dev.cc] cmd/go: disable verifyCompiler
Russ Cox [Fri, 20 Feb 2015 00:47:13 +0000 (19:47 -0500)]
[dev.cc] cmd/go: disable verifyCompiler

The merge brought in new C sources without Go updates.

Change-Id: Iad08b58f894173a7b34396275b72db34f3031fe3
Reviewed-on: https://go-review.googlesource.com/5352
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agopath/filepath: add example for filepath.Split
Andrew Gerrand [Fri, 20 Feb 2015 05:46:48 +0000 (16:46 +1100)]
path/filepath: add example for filepath.Split

Fixes #9928

Change-Id: Iab37051078755a132f211ad48e756422f7c55a39
Reviewed-on: https://go-review.googlesource.com/5416
Reviewed-by: Minux Ma <minux@golang.org>
10 years agonet, syscall: more accurate parsers for routing messages on BSD variants
Mikio Hara [Tue, 10 Feb 2015 03:24:11 +0000 (12:24 +0900)]
net, syscall: more accurate parsers for routing messages on BSD variants

This changes fixes two issues with regard to handling routing messages
as follows:
- Misparsing on platforms (such as FreeBSD) supporting multiple
  architectures in the same kernel (kern.supported_archs="amd64 i386")
- Misparsing with unimplemented messages such as route, interface
  address state notifications

To fix those issues, this change implements all the required socket
address parsers, adds a processor architecture identifying function to
FreeBSD and tests.

Fixes #9707.
Fixes #8203.

Change-Id: I7ed7b4a0b6f10f54b29edc681a2f35603f2d8d45
Reviewed-on: https://go-review.googlesource.com/4330
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/go: simplify/fix handling private github repos
Ingo Oeser [Thu, 29 Jan 2015 14:37:37 +0000 (15:37 +0100)]
cmd/go: simplify/fix handling private github repos

Before Go 1.4, the traditional way to work with a private Github
repository was to run something similar the following:

```
git config --global url."git@github.com:".insteadOf "https://github.com/"
```

It would allow go get and friends to transparently work as expected,
automatically rewriting https URLs to use SSH for auth. This worked both
when pushing and pulling.

In Go 1.4 this broke, now requiring the use of `go get -f` instead of `go get`
in order to fetch private repositories. This seems neither intended nor
practical, as it requires changing a lot of tooling.

So just use `git config remote.origin.url` instead of `git remote -v` as
this reflects the actual substitution intended in the `insteadOf` config
directive.

Also remove now useless parsing.

Also add a check against supported schemes to avoid errors in later
commands using this URL and expecting such a scheme.

Fixes #9697

Change-Id: I907327f83504302288f913a68f8222a5c2d673ee
Reviewed-on: https://go-review.googlesource.com/3504
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agodoc: dummy commit in go1.5.txt
Russ Cox [Fri, 20 Feb 2015 01:42:09 +0000 (20:42 -0500)]
doc: dummy commit in go1.5.txt

Change-Id: I678336daf99f7d7d19f99506f1a604de8e05bf43
Reviewed-on: https://go-review.googlesource.com/5400
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: bring asm on ppc64 in sync with 9a
Rob Pike [Fri, 20 Feb 2015 00:34:51 +0000 (16:34 -0800)]
[dev.cc] cmd/asm: bring asm on ppc64 in sync with 9a

I created a .s file that covered every instruction and operand production
in 9a/a.y and made sure that 9a and asm give bit-identical results for it.
I found a few things, including one addressing mode (R1+R2) that was
not present in the source we use. Fixed those

I also found quite a few things where 9a's grammar accepts the instruction
but liblink rejects it. These need to be sorted out, and I will do that separately.
Once that's done, I'll turn my test file into a proper test.

Change-Id: Ib093271b0f7ffd64ffed164ed2a820ebf2420e34
Reviewed-on: https://go-review.googlesource.com/5361
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] runtime,syscall: quiet some more vet errors
Rob Pike [Thu, 19 Feb 2015 21:44:06 +0000 (13:44 -0800)]
[dev.cc] runtime,syscall: quiet some more vet errors

Fix many incorrect FP references and a few other details.

Some errors remain, especially in vlop, but fixing them requires semantics. For another day.

Change-Id: Ib769fb519b465e79fc08d004a51acc5644e8b259
Reviewed-on: https://go-review.googlesource.com/5288
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/internal/obj, cmd/internal/gc, new6g: reconvert
Russ Cox [Wed, 18 Feb 2015 03:13:49 +0000 (22:13 -0500)]
[dev.cc] cmd/internal/obj, cmd/internal/gc, new6g: reconvert

Reconvert using rsc.io/c2go rev 27b3f59.

Changes to converter:
 - fatal does not return, so no fallthrough after fatal in switch
 - many more function results and variables identified as bool
 - simplification of negated boolean expressions

Change-Id: I3bc67da5e46cb7ee613e230cf7e9533036cc870b
Reviewed-on: https://go-review.googlesource.com/5171
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years ago[dev.cc] cmd/gc: tweak default fatal in ordersafeexpr for c2go
Russ Cox [Wed, 18 Feb 2015 02:52:42 +0000 (21:52 -0500)]
[dev.cc] cmd/gc: tweak default fatal in ordersafeexpr for c2go

c2go was putting a fallthrough after the fatal call.
Changed c2go to know that fatal doesn't return,
but then there is a missing return at the end of
the translated Go function.
Move code around a little to make C and Go agree.

Change-Id: Icef3d55ccdde0709c02dd0c2b78826f6da33a146
Reviewed-on: https://go-review.googlesource.com/5170
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years agocmd/dist: show friendlier error message when building outside a Git repo
Andrew Gerrand [Thu, 19 Feb 2015 21:34:30 +0000 (08:34 +1100)]
cmd/dist: show friendlier error message when building outside a Git repo

Fixes #9932

Change-Id: I7943470a1784278a5c6e99c3b66c59d4953734ba
Reviewed-on: https://go-review.googlesource.com/5340
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoruntime: do not unmap work.spans until after checkmark phase
Russ Cox [Thu, 19 Feb 2015 21:21:42 +0000 (16:21 -0500)]
runtime: do not unmap work.spans until after checkmark phase

This is causing crashes.

Change-Id: I1832f33d114bc29894e491dd2baac45d7ab3a50d
Reviewed-on: https://go-review.googlesource.com/5330
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] runtime,syscall: add symbols for FP and SP references in darwin-arm
Rob Pike [Thu, 19 Feb 2015 21:09:01 +0000 (13:09 -0800)]
[dev.cc] runtime,syscall: add symbols for FP and SP references in darwin-arm

Maybe fix build.

Change-Id: I99ea76f0e6e472f0e88405bf5d77f72d4b097abd
Reviewed-on: https://go-review.googlesource.com/5287
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/go: enable verifyAsm for all architectures
Rob Pike [Thu, 19 Feb 2015 05:11:42 +0000 (21:11 -0800)]
[dev.cc] cmd/go: enable verifyAsm for all architectures

Change-Id: Ia1ba28c81e31d149c59a48d5f71628ac0ff14d8e
Reviewed-on: https://go-review.googlesource.com/5283
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: accept #define A /* nothing */
Rob Pike [Thu, 19 Feb 2015 20:57:33 +0000 (12:57 -0800)]
[dev.cc] cmd/asm: accept #define A /* nothing */

Was rejected but should be legal.

Change-Id: I0189e3bef6b67c6ba390c75a48a8d9d8f39b7636
Reviewed-on: https://go-review.googlesource.com/5286
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: missed change from reorganization CL
Russ Cox [Thu, 19 Feb 2015 20:45:29 +0000 (15:45 -0500)]
runtime: missed change from reorganization CL

That is, I accidentally dropped this change of Austin's
when preparing my CL. I blame Git.

Change-Id: I9dd772c84edefad96c4b16785fdd2dea04a4a0d6
Reviewed-on: https://go-review.googlesource.com/5320
Reviewed-by: Austin Clements <austin@google.com>
10 years agoruntime: reorganize memory code
Russ Cox [Thu, 19 Feb 2015 18:38:46 +0000 (13:38 -0500)]
runtime: reorganize memory code

Move code from malloc1.go, malloc2.go, mem.go, mgc0.go into
appropriate locations.

Factor mgc.go into mgc.go, mgcmark.go, mgcsweep.go, mstats.go.

A lot of this code was in certain files because the right place was in
a C file but it was written in Go, or vice versa. This is one step toward
making things actually well-organized again.

Change-Id: I6741deb88a7cfb1c17ffe0bcca3989e10207968f
Reviewed-on: https://go-review.googlesource.com/5300
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years ago[dev.cc] test: disable rotate tests
Russ Cox [Thu, 19 Feb 2015 20:12:42 +0000 (15:12 -0500)]
[dev.cc] test: disable rotate tests

They use too much memory in the current Go compiler draft.
This should fix some builders.

Reenabling is #9933.

Change-Id: Ib5ef348b2c55d2012ffed765f2a6df99dec171f4
Reviewed-on: https://go-review.googlesource.com/5302
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/pprof: add -runtime flag
Dmitry Vyukov [Thu, 19 Feb 2015 12:21:05 +0000 (15:21 +0300)]
cmd/pprof: add -runtime flag

The flag disables stripping of runtime frames in profiles.
This is useful when analyzing runtime itself.

Before:
$ go tool pprof --text --alloc_objects --lines fmt.test /tmp/mprof
      flat  flat%   sum%        cum   cum%
      2768 79.65% 79.65%      32768 79.65%  fmt_test.TestComplexFormatting fmt/fmt_test.go:744
      6554 15.93% 95.58%       6554 15.93%  regexp/syntax.(*compiler).rune regexp/syntax/compile.go:267
      1820  4.42%   100%       1820  4.42%  runtime.malg runtime/proc1.go:1977

After:
$ go tool pprof --text --alloc_objects --lines --runtime fmt.test /tmp/mprof
      flat  flat%   sum%        cum   cum%
     32768 79.65% 79.65%      32768 79.65%  runtime.convT2E runtime/iface.go:139
      6554 15.93% 95.58%       6554 15.93%  runtime.growslice runtime/slice.go:89
      1820  4.42%   100%       1820  4.42%  runtime.malg runtime/proc1.go:1977

Change-Id: If468dfa5c5bbd0809c45a58d912d3115fac009ed
Reviewed-on: https://go-review.googlesource.com/5291
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agoruntime: don't test gdb on darwin
Josh Bleecher Snyder [Wed, 18 Feb 2015 23:29:32 +0000 (15:29 -0800)]
runtime: don't test gdb on darwin

Fixes #9927

Change-Id: I2114cc21f7a4772e3d42bcad9642a8a545cd8e16
Reviewed-on: https://go-review.googlesource.com/5285
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoruntime: use more natural types in struct workbuf
Austin Clements [Thu, 19 Feb 2015 02:56:12 +0000 (21:56 -0500)]
runtime: use more natural types in struct workbuf

Until recently, struct workbuf had only lfnode and uintptr fields
before the obj array to make it convenient to compute the size of the
obj array.  It slowly grew more fields until this became inconvenient
enough that it was restructured to make the size computation easy.
Now the size computation doesn't care what the field types are, so
switch to more natural types.

Change-Id: I966140ba7ebb4aeb41d5c66d9d2a3bdc17dd4bcf
Reviewed-on: https://go-review.googlesource.com/5262
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: switch to gcWork abstraction
Austin Clements [Tue, 17 Feb 2015 15:53:31 +0000 (10:53 -0500)]
runtime: switch to gcWork abstraction

This converts the garbage collector from directly manipulating work
buffers to using the new gcWork abstraction.

The previous management of work buffers was rather ad hoc.  As a
result, switching to the gcWork abstraction changes many details of
work buffer management.

If greyobject fills a work buffer, it can now pull from work.partial
in addition to work.empty.

Previously, gcDrain started with a partial or empty work buffer and
fetched an empty work buffer if it filled its current buffer (in
greyobject).  Now, gcDrain starts with a full work buffer and fetches
an partial or empty work buffer if it fills its current buffer (in
greyobject).  The original behavior was bad because gcDrain would
immediately drop the empty work buffer returned by greyobject and
fetch a full work buffer, which greyobject was likely to immediately
overflow, fetching another empty work buffer, etc.  The new behavior
isn't great at the start because greyobject is likely to immediately
overflow the full buffer, but the steady-state behavior should be more
stable.  Both before and after this change, gcDrain fetches a full
work buffer if it drains its current buffer.  Basically all of these
choices are bad; the right answer is to use a dual work buffer scheme.

Previously, shade always fetched a work buffer (though usually from
m.currentwbuf), even if the object was already marked.  Now it only
fetches a work buffer if it actually greys an object.

Change-Id: I8b880ed660eb63135236fa5d5678f0c1c041881f
Reviewed-on: https://go-review.googlesource.com/5232
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agoruntime: introduce higher-level GC work abstraction
Austin Clements [Thu, 12 Feb 2015 17:53:48 +0000 (12:53 -0500)]
runtime: introduce higher-level GC work abstraction

This introduces a producer/consumer abstraction for GC work pointers
that internally handles the details of filling, draining, and
shuffling work buffers.

In addition to simplifying the GC code, this should make it easy for
us to change how we use work buffers, including cleaning up how we use
the work.partial queue, reintroducing a FIFO lookahead cache, adding
prefetching, and using dual buffers to avoid flapping.

This commit doesn't change any existing code.  The following commit
will switch the garbage collector from explicit workbuf manipulation
to gcWork.

Change-Id: Ifbfe5fff45bf0362d6d7c3cecb061f0c9874077d
Reviewed-on: https://go-review.googlesource.com/5231
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agoruntime: drop unused workbufhdr.id field
Austin Clements [Thu, 19 Feb 2015 02:59:41 +0000 (21:59 -0500)]
runtime: drop unused workbufhdr.id field

Change-Id: If7729b3c7df6dc7fcd41f293e2ef2472c769fe8b
Reviewed-on: https://go-review.googlesource.com/5261
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agodoc: fix broken link in README
Ryan Seys [Thu, 19 Feb 2015 02:34:44 +0000 (21:34 -0500)]
doc: fix broken link in README

Change-Id: I73450aeb59571f3285ff59ae214739e1866c9aa0
Reviewed-on: https://go-review.googlesource.com/5270
Reviewed-by: Andrew Gerrand <adg@golang.org>