]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agocmd/go: set buildmode=pie default for android/arm64.
Rahul Chaudhry [Mon, 9 Nov 2015 07:30:43 +0000 (23:30 -0800)]
cmd/go: set buildmode=pie default for android/arm64.

Just like android/arm, android/arm64 refuses to execute non-PIE
binaries. In addition, starting from the M release (Marshmallow),
Android refuses to execute binaries with any text relocations
(this was just a warning in the L release). This makes "-shared"
necessary as well when building executables for Android.

Change-Id: Id8802de5be98ff472fc370f8d22ffbde316aaf1e
Reviewed-on: https://go-review.googlesource.com/16744
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: handle sysReserve returning a pointer below the arena
Austin Clements [Mon, 16 Nov 2015 04:13:16 +0000 (23:13 -0500)]
runtime: handle sysReserve returning a pointer below the arena

In mheap.sysAlloc, if an allocation at arena_used would exceed
arena_end (but wouldn't yet push us past arena_start+_MaxArean32), it
trie to extend the arena reservation by another 256 MB. It extends the
arena by calling sysReserve, which, on 32-bit, calls mmap without
MAP_FIXED, which means the address is just a hint and the kernel can
put the mapping wherever it wants. In particular, mmap may choose an
address below arena_start (the kernel also chose arena_start, so there
could be lots of space below it). Currently, we don't detect this case
and, if it happens, mheap.sysAlloc will corrupt arena_end and
arena_used then return the low pointer to mheap.grow, which will crash
when it attempts to index in to h_spans with an underflowed index.

Fix this by checking not only that that p+p_size isn't too high, but
that p isn't too low.

Fixes #13143.

Change-Id: I8d0f42bd1484460282a83c6f1a6f8f0df7fb2048
Reviewed-on: https://go-review.googlesource.com/16927
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: avoid stat underflow crash
Austin Clements [Mon, 16 Nov 2015 04:09:16 +0000 (23:09 -0500)]
runtime: avoid stat underflow crash

If the area returned by sysReserve in mheap.sysAlloc is outside the
usable arena, we sysFree it. We pass a fake stat pointer to sysFree
because we haven't added the allocation to any stat at that point.
However, we pass a 0 stat, so sysFree panics when it decrements the
stat because the fake stat underflows.

Fix this by setting the fake stat to the allocation size.

Updates #13143 (this is a prerequisite to fixing that bug).

Change-Id: I61a6c9be19ac1c95863cf6a8435e19790c8bfc9a
Reviewed-on: https://go-review.googlesource.com/16926
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agounicode/utf8: removed uses of ranging over string
Marcel van Lohuizen [Thu, 5 Nov 2015 16:52:53 +0000 (17:52 +0100)]
unicode/utf8: removed uses of ranging over string

Ranging over string is much slower than using DecodeRuneInString.
See golang.org/issue/13162.

Replacing ranging over a string with the implementation of the Bytes
counterpart results in the following performance improvements:

RuneCountInStringTenASCIIChars-8     43.0ns ± 1%  16.4ns ± 2%  -61.80%  (p=0.000 n=7+8)
RuneCountInStringTenJapaneseChars-8   161ns ± 2%   154ns ± 2%   -4.58%  (p=0.000 n=8+8)
ValidStringTenASCIIChars-8           52.2ns ± 1%  13.2ns ± 1%  -74.62%  (p=0.001 n=7+7)
ValidStringTenJapaneseChars-8         173ns ± 2%   153ns ± 2%  -11.78%  (p=0.000 n=7+8)

Update golang/go#13162

Change-Id: Ifc40a6a94bb3317f1f2d929d310bd2694645e9f6
Reviewed-on: https://go-review.googlesource.com/16695
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist, cmd/go: run testshared on arm64
Michael Hudson-Doyle [Fri, 28 Aug 2015 00:09:13 +0000 (12:09 +1200)]
cmd/dist, cmd/go: run testshared on arm64

And enable PIE in the go tool.

Change-Id: Ibb60ccfe62518cde6e33080bbc78bfcbecff6a4e
Reviewed-on: https://go-review.googlesource.com/14000
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agocmd/link: work around arm64 linker bugs with GOT relocations against local symbols
Michael Hudson-Doyle [Mon, 2 Nov 2015 21:23:56 +0000 (10:23 +1300)]
cmd/link: work around arm64 linker bugs with GOT relocations against local symbols

Change-Id: Ie14530c57720f1af1960ab77686b860e906058c6
Reviewed-on: https://go-review.googlesource.com/16582
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj, cmd/link: access global data via a GOT in -dynlink mode on arm64
Michael Hudson-Doyle [Thu, 27 Aug 2015 09:09:46 +0000 (21:09 +1200)]
cmd/internal/obj, cmd/link: access global data via a GOT in -dynlink mode on arm64

Change-Id: I6ca9406207e40c7c2c661075ccfe57b6600235cf
Reviewed-on: https://go-review.googlesource.com/13997
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocrypto/tls: add TLS_RSA_WITH_AES_128_GCM_SHA256 and TLS_RSA_WITH_AES_256_GCM_SHA384...
Shenghou Ma [Sun, 15 Nov 2015 00:53:03 +0000 (19:53 -0500)]
crypto/tls: add TLS_RSA_WITH_AES_128_GCM_SHA256 and TLS_RSA_WITH_AES_256_GCM_SHA384 cipher suites

Fixes #9894.

Change-Id: I9c7ce771df2e2d1c99a06f800dce63c4e1875993
Reviewed-on: https://go-review.googlesource.com/16924
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
9 years agomath/rand: add a comment for the i=0 iteration
Jingguo Yao [Thu, 12 Nov 2015 13:59:30 +0000 (21:59 +0800)]
math/rand: add a comment for the i=0 iteration

Fixes #13215

Change-Id: I126117d42e7c1e69cbc7fad0760e225b03ed15bd
Reviewed-on: https://go-review.googlesource.com/16852
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/go, runtime: always use position-independent code to invoke vsyscall helper on...
Michael Hudson-Doyle [Wed, 11 Nov 2015 23:55:57 +0000 (12:55 +1300)]
cmd/go, runtime: always use position-independent code to invoke vsyscall helper on linux/386

golang.org/cl/16346 changed the runtime on linux/386 to invoke the vsyscall
helper via a PIC sequence (CALL 0x10(GS)) when dynamically linking. But it's
actually quite easy to make that code sequence work all the time, so do that,
and remove the ugly machinery that passed the buildmode from the go tool to the
assembly.

This means enlarging m.tls so that we can safely access 0x10(GS) (GS is set to
&m.tls + 4, so 0x10(GS) accesses m_tls[5]).

Change-Id: I1345c34029b149cb5f25320bf19a3cdd73a056fa
Reviewed-on: https://go-review.googlesource.com/16796
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: remove go:nosplit comment from reflect.typelinks
Ian Lance Taylor [Sat, 14 Nov 2015 23:31:32 +0000 (15:31 -0800)]
runtime: remove go:nosplit comment from reflect.typelinks

A nosplit comment was added to reflect.typelinks accidentally in
https://golang.org/cl/98510044.  There is only one caller of
reflect.typelinks, reflect.typesByString, and that function is not
nosplit.  There is no reason for reflect.typelinks to be nosplit.

Change-Id: I0fd3cc66fafcd92643e38e53fa586d6b2f868a0a
Reviewed-on: https://go-review.googlesource.com/16932
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoencoding/json: use reflect.SetBytes when decoding bytes
Håvard Haugen [Sun, 25 Oct 2015 21:42:41 +0000 (22:42 +0100)]
encoding/json: use reflect.SetBytes when decoding bytes

This allows slices of custom types with byte as underlying type to be
decoded, fixing a regression introduced in CL 9371.

Fixes #12921.

Change-Id: I62a715eaeaaa912b6bc599e94f9981a9ba5cb242
Reviewed-on: https://go-review.googlesource.com/16303
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile: regenerate builtin.go
Didier Spezia [Wed, 11 Nov 2015 11:00:56 +0000 (11:00 +0000)]
cmd/compile: regenerate builtin.go

Following a recent change, file builtin.go is not up-to-date.
Generate it again by running go generate.

Fixes #13203

Change-Id: Ib91c5ccc93665c043da95c7d3783ce5d94e48466
Reviewed-on: https://go-review.googlesource.com/16821
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/dist: disable shootout/spectralnorm on linux/mips64 builder
Shenghou Ma [Sat, 14 Nov 2015 05:06:46 +0000 (00:06 -0500)]
cmd/dist: disable shootout/spectralnorm on linux/mips64 builder

It is too slow with kernel FPU emulator.

Updates #12688.

Change-Id: Ib3a5adfeb46e894550231b14eb0f4fb20aecee11
Reviewed-on: https://go-review.googlesource.com/16922
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/link, cmd/go, cmd/dist: use copy of libgcc.a for internal linking
Ian Lance Taylor [Wed, 4 Nov 2015 19:14:19 +0000 (11:14 -0800)]
cmd/link, cmd/go, cmd/dist: use copy of libgcc.a for internal linking

Change the linker to use a copy of the C compiler support library,
libgcc.a, when doing internal linking.  This will be used to satisfy any
undefined symbols referenced by host objects.

Change the dist tool to copy the support library into a new directory
tree under GOROOT/pkg/libgcc.  This ensures that libgcc is available
even when building Go programs on a system that has no C compiler.  The
C compiler is required when building the Go installation in the first
place, but is not required thereafter.

Change the go tool to not link libgcc into cgo objects.

Correct the linker handling of a weak symbol in an ELF input object to
not always create a new symbol, but to use an existing symbol if there
is one; this is necessary on freebsd-amd64, where libgcc contains a weak
definition of compilerrt_abort_impl.

Fixes #9510.

Change-Id: I1ab28182263238d9bcaf6a42804e5da2a87d8778
Reviewed-on: https://go-review.googlesource.com/16741
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocrypto/tls, crypto/aes: remove allocations when Writing & Reading
Brad Fitzpatrick [Thu, 12 Nov 2015 14:09:03 +0000 (14:09 +0000)]
crypto/tls, crypto/aes: remove allocations when Writing & Reading

benchmark          old ns/op     new ns/op     delta
BenchmarkTLS-4     8571          7938          -7.39%

benchmark          old MB/s     new MB/s     speedup
BenchmarkTLS-4     119.46       128.98       1.08x

benchmark          old allocs     new allocs     delta
BenchmarkTLS-4     8              0              -100.00%

benchmark          old bytes     new bytes     delta
BenchmarkTLS-4     128           0             -100.00%

On:

func BenchmarkTLS(b *testing.B) {
        b.ReportAllocs()
        b.SetBytes(1024)
        ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
                io.Copy(ioutil.Discard, r.Body)
        }))
        defer ts.Close()
        buf := make([]byte, 1024)
        for i := range buf {
                buf[i] = byte(i)
        }
        c, err := tls.Dial("tcp", ts.Listener.Addr().String(), &tls.Config{
                InsecureSkipVerify: true,
        })
        if err != nil {
                b.Fatal(err)
        }
        defer c.Close()
        clen := int64(b.N) * 1024
        if _, err := c.Write([]byte(
            "POST / HTTP/1.1\r\nHost: foo\r\nContent-Length: " +
            fmt.Sprint(clen) + "\r\n\r\n")); err != nil {
                b.Fatal(err)
        }
        b.ResetTimer()
        for i := 0; i < b.N; i++ {
                if _, err := c.Write(buf); err != nil {
                        b.Fatal(err)
                }
        }
}

Change-Id: I206e7e2118b97148f9751b740d8470895634d3f5
Reviewed-on: https://go-review.googlesource.com/16828
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile/internal/gc: consume at least one token in case of syntax error
Robert Griesemer [Sat, 14 Nov 2015 05:21:39 +0000 (21:21 -0800)]
cmd/compile/internal/gc: consume at least one token in case of syntax error

Fixes #13248.

TBR: iant

Change-Id: Ic8b10704f945e6daef04bb38a00e249854b4ef19
Reviewed-on: https://go-review.googlesource.com/16930
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agocmd/dist: default to clang, not gcc, on freebsd
Russ Cox [Wed, 4 Nov 2015 17:41:04 +0000 (12:41 -0500)]
cmd/dist: default to clang, not gcc, on freebsd

Fixes #11380.

Change-Id: I0a284ad2a46826ce82486479ea4e79f0f470292f
Reviewed-on: https://go-review.googlesource.com/16635
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/compile: associate tracking issue numbers with TODOs
Robert Griesemer [Sat, 14 Nov 2015 00:28:46 +0000 (16:28 -0800)]
cmd/compile: associate tracking issue numbers with TODOs

Comment changes only.

Change-Id: Ib365b3cd16af9995cb0a2cce48fbe35d73899438
Reviewed-on: https://go-review.googlesource.com/16898
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
9 years agocmd/compile: cleanup in parser (3)
Robert Griesemer [Sat, 14 Nov 2015 00:00:46 +0000 (16:00 -0800)]
cmd/compile: cleanup in parser (3)

Factored out functionality of dotname (was inlined in 3 places).

Change-Id: Ica782737c8decbb757465830b25ba87faa9115a4
Reviewed-on: https://go-review.googlesource.com/16897
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
9 years agocmd/compile: cleanup in parser.go (2)
Robert Griesemer [Fri, 13 Nov 2015 23:35:26 +0000 (15:35 -0800)]
cmd/compile: cleanup in parser.go (2)

Inlined fntype, othertype, recvchantype, ptrtype into ntype
and simplified callers. Minor cleanups elsewhere (better names).

Change-Id: I54924969996641a802de00c078b4cd0eabfda8c1
Reviewed-on: https://go-review.googlesource.com/16894
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
9 years agocmd/compile: cleanup in parser.go
Robert Griesemer [Fri, 13 Nov 2015 22:31:31 +0000 (14:31 -0800)]
cmd/compile: cleanup in parser.go

Inlined non_dcl_stmt in stmt since it was called only from there.

Change-Id: I616c41332cfd86bbf3493d0ce7b1256384215220
Reviewed-on: https://go-review.googlesource.com/16893
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
9 years agocmd/compile: better syntax error handling for new parser
Robert Griesemer [Fri, 13 Nov 2015 22:04:40 +0000 (14:04 -0800)]
cmd/compile: better syntax error handling for new parser

- better error messages
- better error recovery by advancing to "follow" token after error
- make sure that we make progress after all errors
- minor cleanups

Change-Id: Ie43b8b02799618d70dc8fc227fab3e4e9e0d8e3a
Reviewed-on: https://go-review.googlesource.com/16892
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime: remove zgoarch_*.go files
Matthew Dempsky [Fri, 13 Nov 2015 19:41:52 +0000 (11:41 -0800)]
runtime: remove zgoarch_*.go files

These now live in runtime/internal/sys.

Change-Id: I270597142516512bfc1395419e51d8083ba1663f
Reviewed-on: https://go-review.googlesource.com/16891
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/rpc: verify that embedding works with changed semantics
Marcel van Lohuizen [Mon, 26 Oct 2015 15:09:48 +0000 (16:09 +0100)]
net/rpc: verify that embedding works with changed semantics

Exported methods of unexported embedded structs get added
correctly to the pool. Behavior is unchanged before and after
https://golang.org/cl/14085.

Change-Id: I2b4053bab02ff045f0a4577b8114808a60aae27e
Reviewed-on: https://go-review.googlesource.com/16305
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoA+C: add Steve Newman (Google CLA)
Brad Fitzpatrick [Fri, 13 Nov 2015 15:19:07 +0000 (15:19 +0000)]
A+C: add Steve Newman (Google CLA)

Steve Newman (Google CLA) was missing from the CONTRIBUTORS file,
presumably because his old commits (made prior to Go being open
source) in SVN/perforce were imported into hg/git later as
"devnull@localhost", which probably didn't match anything, and we
didn't start tracking CLA contributions prior to the Go
open source release.

As a fun historical note, the initial HTTP client from Steve:
https://github.com/golang/go/commit/f315fb3

Change-Id: I2b8da4564d99820504788ecc41495a62391078d5
Reviewed-on: https://go-review.googlesource.com/16864
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/compile/internal/gc: recursive-descent parser
Robert Griesemer [Wed, 4 Nov 2015 17:21:49 +0000 (09:21 -0800)]
cmd/compile/internal/gc: recursive-descent parser

This is a translation of the yacc-based parser with adjustements
to make the grammar work for a recursive-descent parser followed
by cleanups and simplifications.

The yacc actions were mostly literally copied for correctness
with better temporary names.

A few of the syntax tests were adjusted for slightly different
error messages (it is very difficult to match the yacc-based
error messages in all cases, and sometimes the new parser could
produce better errors).

The new parser is enabled by default.
To switch back to the yacc-based parser, set -oldparser.
To hardwire the switch back, uncomment "oldparser = 1" in lex.go.

- passes all.bash
- ~18% reduced parse time per file on average for make.bash
- ~3% reduced compile time for building cmd/compile

Change-Id: Icb5651bb9d8b9f66261762d2c94a03793050d4ce
Reviewed-on: https://go-review.googlesource.com/16665
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: fix build -n when adding to archive with gc toolchain
Ian Lance Taylor [Mon, 9 Nov 2015 21:31:03 +0000 (13:31 -0800)]
cmd/go: fix build -n when adding to archive with gc toolchain

Fix the output of build -n when adding to an existing archive with the
gc toolchain by observing that we are, now, always doing that.  When
using the gc toolchain the archive is now always created by the Go
compiler, and never by the pack command.

No test because we have not historically tested build -n output.

Fixes #13118.

Change-Id: I3a5c43cf45169fa6c9581e4741309c77d2b6e58b
Reviewed-on: https://go-review.googlesource.com/16761
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoA+C: automated updates
Brad Fitzpatrick [Thu, 12 Nov 2015 12:06:14 +0000 (12:06 +0000)]
A+C: automated updates

Add Alberto Bertogli (individual CLA)
Add Alexander Demakin (individual CLA)
Add Angelo Bulfone (individual CLA)
Add Anthony Canino (individual CLA)
Add Arnout Engelen (individual CLA)
Add Cedric Staub (corporate CLA for Square, Inc.)
Add Dan Caddigan (individual CLA)
Add Dan Jacques (corporate CLA for Google Inc.)
Add Daniel Skinner (individual CLA)
Add David Howden (individual CLA)
Add Dmitry Yakunin (individual CLA)
Add Emmanuel Odeke (individual CLA)
Add Eric Koleda (corporate CLA for Google Inc.)
Add Erik Dubbelboer (individual CLA)
Add Evan Broder (corporate CLA for Stripe, Inc.)
Add Ford Hurley (individual CLA)
Add Francisco Claude (individual CLA)
Add Gaurish Sharma (individual CLA)
Add Hsin-Ho Yeh (individual CLA)
Add Ian Gudger (individual CLA)
Add Ilya Tocar (corporate CLA for Intel Corporation)
Add John Jenkins (individual CLA)
Add Kenny Grant (individual CLA)
Add Kevin Malachowski (corporate CLA for Google Inc.)
Add Kim Shrier (corporate CLA for RackTop Systems Inc.)
Add Klaus Post (individual CLA)
Add Lewin Bormann (individual CLA)
Add Manu S Ajith (individual CLA)
Add Matt Drollette (individual CLA)
Add Meng Zhuo (individual CLA)
Add Mhd Sulhan (individual CLA)
Add Mohit Agarwal (individual CLA)
Add Nathan Otterness (individual CLA)
Add Nathan VanBenschoten (individual CLA)
Add Paul Hankin (corporate CLA for Google Inc.)
Add Paul Meyer (individual CLA)
Add Pavel Paulau (individual CLA)
Add Ralph Corderoy (individual CLA)
Add Rob Norman (individual CLA)
Add Seth Hoenig (individual CLA)
Add Spencer Nelson (individual CLA)
Add Steve Phillips (individual CLA)
Add Thorben Krueger (individual CLA)
Add Tormod Erevik Lea (individual CLA)
Add Will Chan (corporate CLA for Google Inc.)
Add Yao Zhang (individual CLA)
Add Yasuharu Goto (individual CLA)
Add Yuki Yugui Sonoda (corporate CLA for Google Inc.)

Updates #12042

Change-Id: Ia5f8e184fdbe8b135b2c29bb75f20bf72042abae
Reviewed-on: https://go-review.googlesource.com/16825
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoRevert "cmd/internal/obj/arm64, cmd/link: use two instructions rather than three...
David Crawshaw [Fri, 13 Nov 2015 08:32:33 +0000 (08:32 +0000)]
Revert "cmd/internal/obj/arm64, cmd/link: use two instructions rather than three for loads from memory"

This reverts commit 3a9bc571b0b8c4ab4cf026d68ea3b71dec608da3.

Breaks darwin/arm64.

Change-Id: Ib958beacabca48020a6a47332fbdec99d994060b
Reviewed-on: https://go-review.googlesource.com/16906
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
9 years agonet/http: require valid methods in NewRequest and Transport.RoundTrip
Brad Fitzpatrick [Thu, 12 Nov 2015 15:16:06 +0000 (15:16 +0000)]
net/http: require valid methods in NewRequest and Transport.RoundTrip

Fixes #12078

Change-Id: If09c927fae639ec4ed3894a2b393a87c1e677803
Reviewed-on: https://go-review.googlesource.com/16829
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agonet/http: add method constants
Brad Fitzpatrick [Thu, 12 Nov 2015 15:33:23 +0000 (15:33 +0000)]
net/http: add method constants

Fixes #12078

Change-Id: Ia8738123b07ca29be4a0cf400ee143729c8b5b3c
Reviewed-on: https://go-review.googlesource.com/16860
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agodoc: add mips64/mips64le to supported GOARCHes
Shenghou Ma [Fri, 13 Nov 2015 08:12:26 +0000 (03:12 -0500)]
doc: add mips64/mips64le to supported GOARCHes

Change-Id: If9dc08d6c29bf60b63d75d973033897ad8bf8cc4
Reviewed-on: https://go-review.googlesource.com/16905
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoapi: update next.txt
Shenghou Ma [Fri, 13 Nov 2015 07:37:59 +0000 (02:37 -0500)]
api: update next.txt

Change-Id: I4903014f2883d3f52a75a3500dc9e01a5cad8611
Reviewed-on: https://go-review.googlesource.com/16904
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocompress/gzip: specify when Reader.Header is valid
Joe Tsai [Thu, 12 Nov 2015 18:41:09 +0000 (10:41 -0800)]
compress/gzip: specify when Reader.Header is valid

The gzip package is asymmetrical in the way it handles headers.
In Writer, the Header is written on the first call to Write, Flush, or Close.
In Reader, the Header is read on calls to NewReader or Reset as opposed to
after the first Read. Thus, we document this difference.

Fixes #13211

Change-Id: I5f87beff036e5e2fd68a02a15fdb7137e9ca4c37
Reviewed-on: https://go-review.googlesource.com/16838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/internal/obj/arm64: rewrite branches that are too far
Shenghou Ma [Fri, 13 Nov 2015 02:23:21 +0000 (21:23 -0500)]
cmd/internal/obj/arm64: rewrite branches that are too far

Fixes #12540.

Change-Id: I7893fdc023145b0aca4b4c7df7e08e47edcf5bba
Reviewed-on: https://go-review.googlesource.com/16902
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: move m's OS-specific semaphore fields into mOS
Matthew Dempsky [Thu, 22 Oct 2015 01:36:05 +0000 (18:36 -0700)]
runtime: move m's OS-specific semaphore fields into mOS

Allows removing fields that aren't relevant to a particular OS or
changing their types to match the underlying OS system calls they'll
be used for.

Change-Id: I5cea89ee77b4e7b985bff41337e561887c3272ff
Reviewed-on: https://go-review.googlesource.com/16176
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>

9 years agocmd/dist: set timeout for go1 benchmark too
Shenghou Ma [Fri, 13 Nov 2015 01:05:06 +0000 (20:05 -0500)]
cmd/dist: set timeout for go1 benchmark too

so that GO_TEST_TIMEOUT_SCALE can be applied too.
It's for the mips64 builder, which is so slow that the
go1 benchmark can't finish startup within 10 minutes.

Change-Id: I1b824eb0649460101b294fb442da784e872403e7
Reviewed-on: https://go-review.googlesource.com/16901
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoarchive/tar: make output deterministic
Matt Layher [Thu, 27 Aug 2015 18:52:06 +0000 (14:52 -0400)]
archive/tar: make output deterministic

Replaces PID in PaxHeaders with 0.  Sorts PAX header keys before writing
them to the archive.

Fixes #12358

Change-Id: If239f89c85f1c9d9895a253fb06a47ad44960124
Reviewed-on: https://go-review.googlesource.com/13975
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
9 years agoruntime: replace tls0 with m0.tls
Matthew Dempsky [Thu, 12 Nov 2015 23:35:50 +0000 (15:35 -0800)]
runtime: replace tls0 with m0.tls

We're allocating TLS storage for m0 anyway, so might as well use it.

Change-Id: I7dc20bbea5320c8ab8a367f18a9540706751e771
Reviewed-on: https://go-review.googlesource.com/16890
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet: make TestInterfaceList work on non-English Windows
Yasuhiro Matsumoto [Tue, 10 Nov 2015 02:23:41 +0000 (11:23 +0900)]
net: make TestInterfaceList work on non-English Windows

Fixes #13198

The output of netsh is encoded with ANSI encoding. So doesn't match with UTF-8 strings.
Write output as UTF-8 using powershell.

Change-Id: I6c7e93c590ed407f24ae847601d71df9523e028c
Reviewed-on: https://go-review.googlesource.com/16756
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
9 years agoruntime: disable prefetching on 386
Shenghou Ma [Sat, 17 Oct 2015 22:21:44 +0000 (18:21 -0400)]
runtime: disable prefetching on 386

It doesn't seem to help on modern processors and it makes Go impossible to run
on Pentium MMX (which is the documented minimum hardware requirement.)

Old is with prefetch, new is w/o. Both are compiled with GO386=sse2.
Benchmarking is done on Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz.

name                     old time/op    new time/op    delta
BinaryTree17-4              2.89s ± 2%     2.87s ± 0%    ~     (p=0.061 n=11+10)
Fannkuch11-4                3.65s ± 0%     3.65s ± 0%    ~     (p=0.365 n=11+11)
FmtFprintfEmpty-4          52.1ns ± 0%    52.1ns ± 0%    ~      (p=0.065 n=10+9)
FmtFprintfString-4          168ns ± 0%     167ns ± 0%  -0.48%   (p=0.000 n=8+10)
FmtFprintfInt-4             167ns ± 0%     167ns ± 1%    ~      (p=0.591 n=9+10)
FmtFprintfIntInt-4          295ns ± 0%     292ns ± 0%  -0.99%   (p=0.000 n=9+10)
FmtFprintfPrefixedInt-4     327ns ± 0%     326ns ± 0%  -0.24%  (p=0.007 n=10+10)
FmtFprintfFloat-4           431ns ± 0%     431ns ± 0%  -0.07%  (p=0.000 n=10+11)
FmtManyArgs-4              1.13µs ± 0%    1.13µs ± 0%  -0.37%  (p=0.009 n=11+11)
GobDecode-4                9.36ms ± 1%    9.33ms ± 0%  -0.31%  (p=0.006 n=11+10)
GobEncode-4                7.38ms ± 1%    7.38ms ± 1%    ~     (p=0.797 n=11+11)
Gzip-4                      394ms ± 0%     395ms ± 1%    ~     (p=0.519 n=11+11)
Gunzip-4                   65.4ms ± 0%    65.4ms ± 0%    ~     (p=0.739 n=10+10)
HTTPClientServer-4         52.4µs ± 1%    52.5µs ± 1%    ~     (p=0.748 n=11+11)
JSONEncode-4               19.0ms ± 0%    19.0ms ± 0%    ~      (p=0.780 n=9+10)
JSONDecode-4               59.6ms ± 0%    59.6ms ± 0%    ~      (p=0.720 n=9+10)
Mandelbrot200-4            4.09ms ± 0%    4.09ms ± 0%    ~      (p=0.295 n=11+9)
GoParse-4                  3.45ms ± 1%    3.43ms ± 1%  -0.35%  (p=0.040 n=11+11)
RegexpMatchEasy0_32-4       101ns ± 1%     101ns ± 1%    ~     (p=1.000 n=11+11)
RegexpMatchEasy0_1K-4       796ns ± 0%     796ns ± 0%    ~      (p=0.954 n=10+8)
RegexpMatchEasy1_32-4       110ns ± 0%     110ns ± 1%    ~      (p=0.289 n=9+11)
RegexpMatchEasy1_1K-4       991ns ± 0%     991ns ± 0%    ~      (p=0.784 n=10+8)
RegexpMatchMedium_32-4      131ns ± 0%     130ns ± 0%  -0.42%   (p=0.004 n=11+9)
RegexpMatchMedium_1K-4     41.9µs ± 1%    41.6µs ± 0%    ~      (p=0.067 n=11+9)
RegexpMatchHard_32-4       2.34µs ± 0%    2.34µs ± 0%    ~     (p=0.208 n=11+11)
RegexpMatchHard_1K-4       70.9µs ± 0%    71.0µs ± 0%    ~      (p=0.968 n=9+10)
Revcomp-4                   819ms ± 0%     818ms ± 0%    ~     (p=0.251 n=10+11)
Template-4                 73.9ms ± 0%    73.8ms ± 0%  -0.25%  (p=0.013 n=10+11)
TimeParse-4                 414ns ± 0%     414ns ± 0%    ~     (p=0.809 n=11+10)
TimeFormat-4                485ns ± 0%     485ns ± 0%    ~      (p=0.404 n=11+7)

name                     old speed      new speed      delta
GobDecode-4              82.0MB/s ± 1%  82.3MB/s ± 0%  +0.31%  (p=0.007 n=11+10)
GobEncode-4               104MB/s ± 1%   104MB/s ± 1%    ~     (p=0.797 n=11+11)
Gzip-4                   49.2MB/s ± 0%  49.1MB/s ± 1%    ~     (p=0.507 n=11+11)
Gunzip-4                  297MB/s ± 0%   297MB/s ± 0%    ~     (p=0.670 n=10+10)
JSONEncode-4              102MB/s ± 0%   102MB/s ± 0%    ~      (p=0.794 n=9+10)
JSONDecode-4             32.6MB/s ± 0%  32.6MB/s ± 0%    ~       (p=0.334 n=9+9)
GoParse-4                16.8MB/s ± 1%  16.9MB/s ± 1%    ~     (p=0.052 n=11+11)
RegexpMatchEasy0_32-4     314MB/s ± 0%   314MB/s ± 1%    ~     (p=0.618 n=11+11)
RegexpMatchEasy0_1K-4    1.29GB/s ± 0%  1.29GB/s ± 0%    ~     (p=0.315 n=10+10)
RegexpMatchEasy1_32-4     290MB/s ± 1%   290MB/s ± 1%    ~     (p=0.667 n=10+11)
RegexpMatchEasy1_1K-4    1.03GB/s ± 0%  1.03GB/s ± 0%    ~      (p=0.829 n=10+8)
RegexpMatchMedium_32-4   7.63MB/s ± 0%  7.65MB/s ± 0%    ~     (p=0.142 n=11+11)
RegexpMatchMedium_1K-4   24.4MB/s ± 1%  24.6MB/s ± 0%    ~      (p=0.063 n=11+9)
RegexpMatchHard_32-4     13.7MB/s ± 0%  13.7MB/s ± 0%    ~     (p=0.302 n=11+11)
RegexpMatchHard_1K-4     14.4MB/s ± 0%  14.4MB/s ± 0%    ~      (p=0.784 n=9+10)
Revcomp-4                 310MB/s ± 0%   311MB/s ± 0%    ~     (p=0.243 n=10+11)
Template-4               26.2MB/s ± 0%  26.3MB/s ± 0%  +0.24%  (p=0.009 n=10+11)

Update #12970.

Change-Id: Id185080687a60c229a5cb2e5220e7ca1b53910e2
Reviewed-on: https://go-review.googlesource.com/15999
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoos: add document for ErrInvalid
Shenghou Ma [Thu, 12 Nov 2015 20:27:51 +0000 (15:27 -0500)]
os: add document for ErrInvalid

Fixes #12391.

Change-Id: I31211cd711c035151785c3083571594d15c7d93e
Reviewed-on: https://go-review.googlesource.com/16873
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/dist: run testshared on linux/ppc64le
Michael Hudson-Doyle [Wed, 4 Nov 2015 20:56:32 +0000 (09:56 +1300)]
cmd/dist: run testshared on linux/ppc64le

Change-Id: I4d079d29408e5344701056c88882cfd3b3857478
Reviewed-on: https://go-review.googlesource.com/15973
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>

9 years agocmd/link, runtime: implement & call addmoduledata on ppc64le
Michael Hudson-Doyle [Fri, 16 Oct 2015 08:22:20 +0000 (21:22 +1300)]
cmd/link, runtime: implement & call addmoduledata on ppc64le

Change-Id: I3980d82c7df95e69522c3d2c90311f89c6fef0e1
Reviewed-on: https://go-review.googlesource.com/15972
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj/ppc64: avoid calling morestack via a PLT when dynamically linking
Michael Hudson-Doyle [Fri, 16 Oct 2015 07:50:59 +0000 (20:50 +1300)]
cmd/internal/obj/ppc64: avoid calling morestack via a PLT when dynamically linking

Change-Id: Ie79f72786b1d7154f1910e717a0faf354b913b89
Reviewed-on: https://go-review.googlesource.com/15970
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj, cmd/link: access global data via GOT when dynlinking on ppc64le
Michael Hudson-Doyle [Fri, 16 Oct 2015 02:54:10 +0000 (15:54 +1300)]
cmd/internal/obj, cmd/link: access global data via GOT when dynlinking on ppc64le

Change-Id: I79c60241df6c785f35371e70c777a7bd6e93571c
Reviewed-on: https://go-review.googlesource.com/15968
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go, cmd/link: enable -buildmode=shared on linux/ppc64le
Michael Hudson-Doyle [Wed, 4 Nov 2015 20:55:44 +0000 (09:55 +1300)]
cmd/go, cmd/link: enable -buildmode=shared on linux/ppc64le

Change-Id: Ifba76413b8aa78a221385bf505b92a3a5fbc3d24
Reviewed-on: https://go-review.googlesource.com/16713
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/internal/obj, runtime: implement IE model TLS on ppc64le
Michael Hudson-Doyle [Fri, 16 Oct 2015 08:15:18 +0000 (21:15 +1300)]
cmd/internal/obj, runtime: implement IE model TLS on ppc64le

This requires changing the tls access code to match the patterns documented in
the ABI documentation or the system linker will "optimize" it into ridiculousness.

With this change, -buildmode=pie works, although as it is tested in testshared,
the tests are not run yet.

Change-Id: I1efa6687af0a5b8db3385b10f6542a49056b2eb3
Reviewed-on: https://go-review.googlesource.com/15971
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj, cmd/link: generate position independent loads of static data
Michael Hudson-Doyle [Fri, 16 Oct 2015 07:48:56 +0000 (20:48 +1300)]
cmd/internal/obj, cmd/link: generate position independent loads of static data

Change-Id: I0a8448c2b69f5cfa6f099d772f5eb3412f853045
Reviewed-on: https://go-review.googlesource.com/15969
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile, cmd/link, runtime: on ppc64x, maintain the TOC pointer in R2 when compil...
Michael Hudson-Doyle [Fri, 16 Oct 2015 02:42:09 +0000 (15:42 +1300)]
cmd/compile, cmd/link, runtime: on ppc64x, maintain the TOC pointer in R2 when compiling PIC

The PowerPC ISA does not have a PC-relative load instruction, which poses
obvious challenges when generating position-independent code. The way the ELFv2
ABI addresses this is to specify that r2 points to a per "module" (shared
library or executable) TOC pointer. Maintaining this pointer requires
cooperation between codegen and the system linker:

 * Non-leaf functions leave space on the stack at r1+24 to save the TOC pointer.
 * A call to a function that *might* have to go via a PLT stub must be followed
   by a nop instruction that the system linker can replace with "ld r1, 24(r1)"
   to restore the TOC pointer (only when dynamically linking Go code).
 * When calling a function via a function pointer, the address of the function
   must be in r12, and the first couple of instructions (the "global entry
   point") of the called function use this to derive the address of the TOC
   for the module it is in.
 * When calling a function that is implemented in the same module, the system
   linker adjusts the call to skip over the instructions mentioned above (the
   "local entry point"), assuming that r2 is already correctly set.

So this changeset adds the global entry point instructions, sets the metadata so
the system linker knows where the local entry point is, inserts code to save the
TOC pointer at 24(r1), adds a nop after any call not known to be local and copes
with the odd non-local code transfer in the runtime (e.g. the stuff around
jmpdefer). It does not actually compile PIC yet.

Change-Id: I7522e22bdfd2f891745a900c60254fe9e372c854
Reviewed-on: https://go-review.googlesource.com/15967
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: update newosproc asm to access m.id directly
Matthew Dempsky [Thu, 12 Nov 2015 22:26:19 +0000 (14:26 -0800)]
runtime: update newosproc asm to access m.id directly

darwin/386, freebsd/386, and linux/386 use a setldt system call to
setup each M's thread-local storage area, and they need access to the
M's id for this.  The current code copies m.id into m.tls[0] (and this
logic has been cargo culted to OSes like NetBSD and OpenBSD, which
don't even need m.id to configure TLS), and then the 386 assembly
loads m.tls[0]... but since the assembly code already has a pointer to
the M, it might as well just load m.id directly.

Change-Id: I1a7278f1ec8ebda8d1de3aa3a61993070e3a8cdf
Reviewed-on: https://go-review.googlesource.com/16881
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/obj, cmd/link, runtime: use a larger stack frame on ppc64
Michael Hudson-Doyle [Thu, 29 Oct 2015 23:36:08 +0000 (12:36 +1300)]
cmd/internal/obj, cmd/link, runtime: use a larger stack frame on ppc64

The larger stack frames causes the nosplit stack to overflow so the next change
increases the stackguard.

Change-Id: Ib2b4f24f0649eb1d13e3a58d265f13d1b6cc9bf9
Reviewed-on: https://go-review.googlesource.com/15964
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj, cmd/link, runtime: increase stack limit to accommodate larger frame...
Michael Hudson-Doyle [Thu, 29 Oct 2015 23:47:24 +0000 (12:47 +1300)]
cmd/internal/obj, cmd/link, runtime: increase stack limit to accommodate larger frames on ppc64x

Larger stack frames mean nosplit functions use more stack and so the limit
needs to increase.

The change to test/nosplit.go is a bit ugly but I can't really think of a
way to make it nicer.

Change-Id: I2616b58015f0b62abbd62951575fcd0d2d8643c2
Reviewed-on: https://go-review.googlesource.com/16504
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/internal/sys: remove Intptr
Matthew Dempsky [Thu, 12 Nov 2015 21:27:40 +0000 (13:27 -0800)]
runtime/internal/sys: remove Intptr

Apparently its last use was removed in CL 8899.

Change-Id: I4f3a789b3cc4c249582e81463af62b576a281e40
Reviewed-on: https://go-review.googlesource.com/16880
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime/race: update race runtime
Dmitry Vyukov [Thu, 12 Nov 2015 13:12:48 +0000 (14:12 +0100)]
runtime/race: update race runtime

The new revision is 389d49d4943780efbfcd2a434f4462b6d0f23c44 (Nov 13, 2015).
The runtimes are built using the new x/build/cmd/racebuild utility.
This update fixes a bug in race detection algorithm that can
lead to occasional false negatives (#10589). But generally just
brings in an up-to-date runtime.

Update #8653
Fixes #10589

Change-Id: I7ac9614d014ee89c2302ce5e096d326ef293f367
Reviewed-on: https://go-review.googlesource.com/16827
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoruntime, runtime/internal/sys: fix build for linux/{mips64,mips64le}
Shenghou Ma [Thu, 12 Nov 2015 20:43:18 +0000 (15:43 -0500)]
runtime, runtime/internal/sys: fix build for linux/{mips64,mips64le}

Change-Id: I37bac9680efdfd797ca5dca90bd9a9e1001bfb68
Reviewed-on: https://go-review.googlesource.com/16874
Reviewed-by: Michael Matloob <matloob@golang.org>
9 years agoruntime: delete runtime/internal/atomic/textflag.h
Michael Matloob [Thu, 12 Nov 2015 16:30:33 +0000 (11:30 -0500)]
runtime: delete runtime/internal/atomic/textflag.h

As per mdempsky's comment on golang.org/cl/14204, textflag.h is
copied to the includes dir by cmd/dist, and the copy in
runtime/internal/atomic is not actually being used.

Updates #11647

Change-Id: Ie95c08903a9df54cea4c70ee9d5291176f7b5609
Reviewed-on: https://go-review.googlesource.com/16871
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
9 years agoruntime: ignore rt_sigaction error if it is for SIGRTMAX
Michael Hudson-Doyle [Thu, 12 Nov 2015 19:55:44 +0000 (08:55 +1300)]
runtime: ignore rt_sigaction error if it is for SIGRTMAX

A forward port of https://codereview.appspot.com/124900043/ which somehow
got lost somewhere.

Fixes #13024

Change-Id: Iab128899e65c51d90f6704e3e1b2fc9326e3a1c2
Reviewed-on: https://go-review.googlesource.com/16853
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: use WriteConsole to implement print and panic on windows
Daniel Theophanes [Fri, 6 Nov 2015 06:47:45 +0000 (22:47 -0800)]
runtime: use WriteConsole to implement print and panic on windows

Fixes #7864

Change-Id: Id13369352aeccac8387876f0b911e383c543c28e
Reviewed-on: https://go-review.googlesource.com/16714
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agopath/filepath: in Rel use case-insensitive comparison on Windows
Yasuhiro Matsumoto [Wed, 11 Nov 2015 01:21:49 +0000 (10:21 +0900)]
path/filepath: in Rel use case-insensitive comparison on Windows

Fixes #10802

Compare Volume name and each path elements using strings.EqualFold.

Change-Id: Ibdefdb801d0326e53755bc9cc8c10eed998094e5
Reviewed-on: https://go-review.googlesource.com/16795
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: copy textflag.h for runtime/internal/* too
Shenghou Ma [Thu, 12 Nov 2015 19:52:01 +0000 (14:52 -0500)]
cmd/dist: copy textflag.h for runtime/internal/* too

Change-Id: I22216df83898e560cfe6d97344f05e3678c2db99
Reviewed-on: https://go-review.googlesource.com/16872
Reviewed-by: Michael Matloob <matloob@golang.org>
9 years agoruntime: move arch_mips64(le)?.go into runtime/internal/sys
Michael Matloob [Thu, 12 Nov 2015 18:43:27 +0000 (13:43 -0500)]
runtime: move arch_mips64(le)?.go into runtime/internal/sys

Somehow these were left out of the orignial CL.

Updates #11647

Change-Id: I058a30eaa25fbb72d60e7fb6bc9ff0a3b54fdb2a
Reviewed-on: https://go-review.googlesource.com/16870
Reviewed-by: Minux Ma <minux@golang.org>
9 years agotesting: only call flag.Parse if it has not been called before
Alberto Bertogli [Fri, 6 Nov 2015 01:40:56 +0000 (01:40 +0000)]
testing: only call flag.Parse if it has not been called before

Calling flag.Parse twice can be problematic if other goroutines called
flag.Parsed in between: the race detector complains due to the
write after read from a different goroutine.

This can happen if TestMain calls flag.Parse and launches goroutines
that call flag.Parsed, for example if it initializes a server which
checks flags.

This patch makes testing.M.Run only parse the flags if they have not
been parsed already.

Change-Id: Id9f8c31c5f90614e3f34c63d1a32cf7e9055d68e
Reviewed-on: https://go-review.googlesource.com/16739
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotest: really force heap profile update in heapsampling.go
Austin Clements [Thu, 12 Nov 2015 17:24:36 +0000 (12:24 -0500)]
test: really force heap profile update in heapsampling.go

The heap profile is only guaranteed to be up-to-date after two GC
cycles, so force two GCs instead of just one.

Updates #13098.

Change-Id: I4fb9287b698f4a3b90b8af9fc6a2efb3b082bfe5
Reviewed-on: https://go-review.googlesource.com/16848
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime/internal/atomic: delete arch1_*.go files
Michael Matloob [Thu, 12 Nov 2015 17:09:29 +0000 (12:09 -0500)]
runtime/internal/atomic: delete arch1_*.go files

I made a copy of the per-arch _CacheLineSize definitons when checking in
runtime/internal/atomic. Now that runtime/internal/sys is checked in,
we can use the definition there.

Change-Id: I7242f6b633e4164f033b67ff471416b9d71c64d2
Reviewed-on: https://go-review.googlesource.com/16847
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: make SIGPROF skip stacks that are being copied
Austin Clements [Wed, 11 Nov 2015 20:34:54 +0000 (15:34 -0500)]
runtime: make SIGPROF skip stacks that are being copied

sigprof tracebacks the stack across systemstack switches to make
profile tracebacks more complete. However, it does this even if the
user stack is currently being copied, which means it may be in an
inconsistent state that will cause the traceback to panic.

One specific way this can happen is during stack shrinking. Some
goroutine blocks for STW, then enters gchelper, which then assists
with root marking. If that root marking happens to pick the original
goroutine and its stack needs to be shrunk, it will begin to copy that
stack. During this copy, the stack is generally inconsistent and, in
particular, the actual locations of the stack barriers and their
recorded locations are temporarily out of sync. If a SIGPROF happens
during this inconsistency, it will walk the stack all the way back to
the blocked goroutine and panic when it fails to unwind the stack
barriers.

Fix this by disallowing jumping to the user stack during SIGPROF if
that user stack is in the process of being copied.

Fixes #12932.

Change-Id: I9ef694c2c01e3653e292ce22612418dd3daff1b4
Reviewed-on: https://go-review.googlesource.com/16819
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoRevert "cmd/go: use shallow clones for new git checkouts"
Burcu Dogan [Wed, 11 Nov 2015 23:45:09 +0000 (15:45 -0800)]
Revert "cmd/go: use shallow clones for new git checkouts"

This reverts commit bc1f9d20b40998b87c9a5f56f2b22595de65c2d4.

The current go-get strategy doesn't support cases that servers
cannot handle shallow clients.

Also, `go get -u` is broken and is not compatible with already
go-getted unshallow repos.

Fixes #13213.
Fixes #13206.

Change-Id: Ie89d7603d96d323db64ad82997793fda0972f709
Reviewed-on: https://go-review.googlesource.com/16832
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: delete the runtime_internal_atomic.go builtin defs file
Michael Matloob [Thu, 12 Nov 2015 15:44:37 +0000 (10:44 -0500)]
cmd/compile: delete the runtime_internal_atomic.go builtin defs file

The file was automatically placed in the cl by a tool I had built.
Since the compiler doesn't hook into the atomic package, it's unnecessary.

Change-Id: I631fd876813b381bb12604865b00fc5b268dce84
Reviewed-on: https://go-review.googlesource.com/16844
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agomisc/sortac: add tool to sort the AUTHORS and CONTRIBUTORS files
Brad Fitzpatrick [Thu, 12 Nov 2015 11:50:24 +0000 (11:50 +0000)]
misc/sortac: add tool to sort the AUTHORS and CONTRIBUTORS files

I keep losing this utility, used as part of other tools to auto-update
the AUTHORS and CONTRIBUTORS files.  Check it in to the repo so I
don't lose it, and so others can use it as well.

Updates #12042

Change-Id: Ib5886b85799087aaaddcec4c81169e2726322c05
Reviewed-on: https://go-review.googlesource.com/16824
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: remove race binaries when rebuilding everything
Russ Cox [Thu, 12 Nov 2015 16:28:07 +0000 (11:28 -0500)]
cmd/dist: remove race binaries when rebuilding everything

Fixes #13214.

Change-Id: Id8fbb252b8beadb0b41f839dcd85d6165dea86a3
Reviewed-on: https://go-review.googlesource.com/16845
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: break out system-specific constants into package sys
Michael Matloob [Wed, 11 Nov 2015 17:39:30 +0000 (12:39 -0500)]
runtime: break out system-specific constants into package sys

runtime/internal/sys will hold system-, architecture- and config-
specific constants.

Updates #11647

Change-Id: I6db29c312556087a42e8d2bdd9af40d157c56b54
Reviewed-on: https://go-review.googlesource.com/16817
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotest: force heap profile update in heapsampling.go test
Austin Clements [Thu, 12 Nov 2015 16:30:26 +0000 (11:30 -0500)]
test: force heap profile update in heapsampling.go test

The heapsampling.go test occasionally fails on some architectures
because it finds zero heap samples in main.alloc. This happens because
the byte and object counts are only updated at a GC. Hence, if a GC
happens part way through allocInterleaved, but then doesn't happen
after we start calling main.alloc, checkAllocations will see buckets
for the lines in main.alloc (which are created eagerly), but the
object and byte counts will be zero.

Fix this by forcing a GC to update the profile before we collect it.

Fixes #13098.

Change-Id: Ia7a9918eea6399307f10499dd7abefd4f6d13cf6
Reviewed-on: https://go-review.googlesource.com/16846
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agocmd/go: subdirs of runtime other than runtime/internal do depend on runtime
Ian Lance Taylor [Thu, 12 Nov 2015 07:13:14 +0000 (23:13 -0800)]
cmd/go: subdirs of runtime other than runtime/internal do depend on runtime

Correct an error in the last change: it caused runtime/cgo and
runtime/race to not depend on runtime.

Fixes #13214.

Change-Id: Ib48b3b5e9a74567ddfaccb7ab4a897ee2aedc2b8
Reviewed-on: https://go-review.googlesource.com/16837
Reviewed-by: Michael Matloob <matloob@golang.org>
9 years agoA+C: alter email-address description to cover more than two
Ralph Corderoy [Thu, 12 Nov 2015 13:00:57 +0000 (13:00 +0000)]
A+C: alter email-address description to cover more than two

Explictly list the alternative formats in each file.  In AUTHORS, refer
to CONTRIBUTORS' definition of multiple email addresses.  Indent with
four spaces;  AUTHORS used a tab, but CONTRIBUTORS used four spaces.
s/Rietveld/Gerrit/

Change the tab separating Sebastien Binet from his email address,
added in 2010's 18b02f6c.

Change-Id: Id52228ae6b62dd88ad8098110c22373bf14e068f
Reviewed-on: https://go-review.googlesource.com/16826
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: fix vet warning about println
Matthew Dempsky [Thu, 12 Nov 2015 04:49:37 +0000 (20:49 -0800)]
runtime: fix vet warning about println

lfstack.go:19: println call ends with newline

Change-Id: I2a903eef80a5300e9014999c2f0bc5d40ed5c735
Reviewed-on: https://go-review.googlesource.com/16836
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: fix vet warning about +build rule
Matthew Dempsky [Thu, 12 Nov 2015 04:47:25 +0000 (20:47 -0800)]
runtime: fix vet warning about +build rule

cgo_ppc64x.go:7: +build comment must appear before package clause and be followed by a blank line

Change-Id: Ib6dedddae70cc75dc3f137eb37ea338a64f8b595
Reviewed-on: https://go-review.googlesource.com/16835
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agodoc: update go1.6.txt
Shenghou Ma [Thu, 12 Nov 2015 05:08:09 +0000 (00:08 -0500)]
doc: update go1.6.txt

Change-Id: I9161c4a7e747d35ad7643b8cf0fe8b66eaea963b
Reviewed-on: https://go-review.googlesource.com/16842
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/dist: added support for GOARCH=mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 14:16:45 +0000 (10:16 -0400)]
cmd/dist: added support for GOARCH=mips64{,le}

Change-Id: I22ea3352ad0794fc611334c2f2ec5f1e894985ce
Reviewed-on: https://go-review.googlesource.com/14460
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agotest: fix nosplit.go, fixedbugs/issue11656.go and skip two tests for mips64{,le}
Yao Zhang [Mon, 28 Sep 2015 21:30:32 +0000 (17:30 -0400)]
test: fix nosplit.go, fixedbugs/issue11656.go and skip two tests for mips64{,le}

Skip fixedbugs/issue10607.go because external linking is not supported
yet.

Skip nilptr3.go because of issue #9058 (same as ppc64).

Change-Id: Ib3dfbd9a03ee4052871cf57c74b3cc5e745e1f80
Reviewed-on: https://go-review.googlesource.com/14461
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime/debug: skip TestFreeOSMemory for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:48 +0000 (11:33 -0400)]
runtime/debug: skip TestFreeOSMemory for mips64{,le}

Change-Id: I419f3b8bf1bddffd4a775b0cd7b98f0239fe19cb
Reviewed-on: https://go-review.googlesource.com/14458
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agointernal/syscall/unix: added support for linux/mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:39 +0000 (11:33 -0400)]
internal/syscall/unix: added support for linux/mips64{,le}

Change-Id: Ib6f168b6a2daf3befbf75b4b95967ff91ac95d12
Reviewed-on: https://go-review.googlesource.com/14456
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http: fixed TestLinuxSendfile for mips64
Yao Zhang [Thu, 10 Sep 2015 15:33:31 +0000 (11:33 -0400)]
net/http: fixed TestLinuxSendfile for mips64

mips64 strace doesn't support sendfile64 and will error out if we
specify that with `-e trace='. So we use sendfile for mips64 here.

Change-Id: If5e2bb39866ca3a77dcc40e4db338ba486921d89
Reviewed-on: https://go-review.googlesource.com/14455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agohash/crc32: added mips64{,le} build tags
Yao Zhang [Thu, 10 Sep 2015 15:33:26 +0000 (11:33 -0400)]
hash/crc32: added mips64{,le} build tags

Change-Id: I77c6768fff6f0163b36800307c4d573bb6521fe5
Reviewed-on: https://go-review.googlesource.com/14454
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/elf: added MIPS ELF relocations
Yao Zhang [Thu, 10 Sep 2015 13:15:19 +0000 (09:15 -0400)]
debug/elf: added MIPS ELF relocations

Change-Id: I05352749a852095baae2f67fd71ffcf5f727538d
Reviewed-on: https://go-review.googlesource.com/14453
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoreflect: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 01:47:09 +0000 (21:47 -0400)]
reflect: added support for mips64{,le}

Change-Id: I84ced3734410d3d05f195901f44d33f4ae6036b1
Reviewed-on: https://go-review.googlesource.com/14452
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath, math/big: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 02:39:45 +0000 (22:39 -0400)]
math, math/big: added support for mips64{,le}

Change-Id: I5129a5b9dbbc57d97da723c2fc247bd28f951817
Reviewed-on: https://go-review.googlesource.com/14451
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosync/atomic: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 12:08:48 +0000 (08:08 -0400)]
sync/atomic: added support for mips64{,le}

Change-Id: Ibe6c345afd4cbae7e2542a350043fbb6b81d5678
Reviewed-on: https://go-review.googlesource.com/14450
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosyscall: added support for linux/mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 12:48:19 +0000 (08:48 -0400)]
syscall: added support for linux/mips64{,le}

Syscall getdents64 is relatively new in linux/mips64, only since kernel
version 3.10. To support older kernel, syscall getdents is used for
mips64.

Change-Id: I892b05dff7d93e7ddb0d700abd6a5e6d4084ab4c
Reviewed-on: https://go-review.googlesource.com/14449
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosyscall: added machine-generated code for linux/mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 12:50:57 +0000 (08:50 -0400)]
syscall: added machine-generated code for linux/mips64{,le}

Change-Id: I574a2b702bb3db596f890ae7b18fb4bc1fd358d5
Reviewed-on: https://go-review.googlesource.com/14448
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: restructured signal_linux.go, added signal table for mips64.
Yao Zhang [Thu, 24 Sep 2015 12:56:15 +0000 (08:56 -0400)]
runtime: restructured signal_linux.go, added signal table for mips64.

Linux/mips64 uses a different signal table. To avoid code copying,
signal table is factored out from signal_linux.go to
sigtab_linux_generic.go. And a mips64-specific version is added.

Change-Id: I842d7a7467c330bf772855fde01aecc77a42316b
Reviewed-on: https://go-review.googlesource.com/14993
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: renamed os2_linux.go to os2_linux_generic.go, added mips64 support
Yao Zhang [Thu, 24 Sep 2015 12:50:13 +0000 (08:50 -0400)]
runtime: renamed os2_linux.go to os2_linux_generic.go, added mips64 support

Linux/mips64 has a different sigset type and some different constants.
os2_linux.go is renamed to os2_linux_generic.go, and not used in mips64.
The corresponding file os2_linux_mips64x.go is added.

Change-Id: Ief83845a2779f7fe048d236d3c7da52b627ab533
Reviewed-on: https://go-review.googlesource.com/14992
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: restructured os1_linux.go, added mips64 support
Yao Zhang [Thu, 24 Sep 2015 12:42:10 +0000 (08:42 -0400)]
runtime: restructured os1_linux.go, added mips64 support

Linux/mips64 uses a different type of sigset. To deal with it, related
functions in os1_linux.go is refactored to os1_linux_generic.go
(used for non-mips64 architectures), and os1_linux_mips64x.go (only used
in mips64{,le}), to avoid code copying.

Change-Id: I5cadfccd86bfc4b30bf97e12607c3c614903ea4c
Reviewed-on: https://go-review.googlesource.com/14991
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: added mips64{,le} build tags and GOARCH cases
Yao Zhang [Wed, 23 Sep 2015 22:58:05 +0000 (18:58 -0400)]
runtime: added mips64{,le} build tags and GOARCH cases

Change-Id: I381c03d957a0dccae5f655f02e92760e5c0e9629
Reviewed-on: https://go-review.googlesource.com/14929
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: updated automatically generated zgoarch_*.go
Yao Zhang [Wed, 23 Sep 2015 19:30:40 +0000 (15:30 -0400)]
runtime: updated automatically generated zgoarch_*.go

files for unsupported architectures are deleted, as it would require
changing cmd/dist to recognize their names as build tags (probably
need a separated CL).

Change-Id: Ifd164b014867d39b4924d1b859fb84317dce4ab0
Reviewed-on: https://go-review.googlesource.com/14928
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: added go files for linux/mips64{,le} support
Yao Zhang [Thu, 10 Sep 2015 15:21:57 +0000 (11:21 -0400)]
runtime: added go files for linux/mips64{,le} support

Change-Id: I14b537922b97d4bce9e0523d98a822da906348f1
Reviewed-on: https://go-review.googlesource.com/14447
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: added go files for mips64 architecture support
Yao Zhang [Wed, 23 Sep 2015 18:05:16 +0000 (14:05 -0400)]
runtime: added go files for mips64 architecture support

Change-Id: Ia496470e48b3c5d39fb9fef99fac356dfb73a949
Reviewed-on: https://go-review.googlesource.com/14927
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime/internal/atomic: added mips64 support.
Yao Zhang [Thu, 12 Nov 2015 04:05:06 +0000 (23:05 -0500)]
runtime/internal/atomic: added mips64 support.

Change-Id: I2eaf0658771a0ff788429e2f503d116531166315
Reviewed-on: https://go-review.googlesource.com/16834
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: added assembly part of linux/mips64{,le} support
Yao Zhang [Thu, 10 Sep 2015 15:25:58 +0000 (11:25 -0400)]
runtime: added assembly part of linux/mips64{,le} support

Change-Id: I9e94027ef66c88007107de2b2b75c3d7cf1352af
Reviewed-on: https://go-review.googlesource.com/14467
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/cgo: added support for GOARCH=mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:17 +0000 (11:33 -0400)]
cmd/cgo: added support for GOARCH=mips64{,le}

The actual cgo is not supported for now. This is just the cgo command.

Change-Id: I25625100ee552971f47e681b7d613cba16a2132f
Reviewed-on: https://go-review.googlesource.com/14446
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>