- 16 Nov, 2015 7 commits
-
-
Ian Lance Taylor authored
The change to the write barrier in https://golang.org/cl/16899 means that the compiler now emits tests of the first field of a struct. That was using a register that was not used before. This change fixes that for amd64 by adding a special case for the first field of a struct. Update #12416. Change-Id: Ia57baa62cd741592fbeb9be82f1e846be73d6edd Reviewed-on: https://go-review.googlesource.com/16933 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Ian Lance Taylor authored
If you set GODEBUG=cgocheck=2 the runtime package will use the write barrier to detect cases where a Go program writes a Go pointer into non-Go memory. In conjunction with the existing cgo checks, and the not-yet-implemented cgo check for exported functions, this should reliably detect all cases (that do not import the unsafe package) in which a Go pointer is incorrectly shared with C code. This check is optional because it turns on the write barrier at all times, which is known to be expensive. Update #12416. Change-Id: I549d8b2956daa76eac853928e9280e615d6365f4 Reviewed-on: https://go-review.googlesource.com/16899Reviewed-by: Russ Cox <rsc@golang.org>
-
Ian Lance Taylor authored
The current mkdeps.bash just checks for dependencies for GOOS=windows with the current GOARCH. This is not always accurate as some package imports only happen on specific GOOS/GOARCH combinations. Check a selected, easily changed, combination of GOOS/GOARCH values. This generates a deps.go identical to the one in the repository today. Fixes #13221. Change-Id: I96d67d49c8c63641d578acedbb28be807607db65 Reviewed-on: https://go-review.googlesource.com/16882Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Rahul Chaudhry authored
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/16744Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
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>
-
Austin Clements authored
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/16926Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Marcel van Lohuizen authored
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/16695Reviewed-by: Russ Cox <rsc@golang.org>
-
- 15 Nov, 2015 7 commits
-
-
Michael Hudson-Doyle authored
And enable PIE in the go tool. Change-Id: Ibb60ccfe62518cde6e33080bbc78bfcbecff6a4e Reviewed-on: https://go-review.googlesource.com/14000Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Michael Hudson-Doyle authored
Change-Id: Ie14530c57720f1af1960ab77686b860e906058c6 Reviewed-on: https://go-review.googlesource.com/16582Reviewed-by: Russ Cox <rsc@golang.org>
-
Michael Hudson-Doyle authored
Change-Id: I6ca9406207e40c7c2c661075ccfe57b6600235cf Reviewed-on: https://go-review.googlesource.com/13997Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Shenghou Ma authored
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>
-
Jingguo Yao authored
Fixes #13215 Change-Id: I126117d42e7c1e69cbc7fad0760e225b03ed15bd Reviewed-on: https://go-review.googlesource.com/16852Reviewed-by: Keith Randall <khr@golang.org>
-
Michael Hudson-Doyle authored
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/16796Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
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>
-
- 14 Nov, 2015 12 commits
-
-
Håvard Haugen authored
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/16303Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Didier Spezia authored
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/16821Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Shenghou Ma authored
It is too slow with kernel FPU emulator. Updates #12688. Change-Id: Ib3a5adfeb46e894550231b14eb0f4fb20aecee11 Reviewed-on: https://go-review.googlesource.com/16922Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
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/16741Reviewed-by: Russ Cox <rsc@golang.org>
-
Brad Fitzpatrick authored
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/16828Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Robert Griesemer authored
Fixes #13248. TBR: iant Change-Id: Ic8b10704f945e6daef04bb38a00e249854b4ef19 Reviewed-on: https://go-review.googlesource.com/16930Reviewed-by: Robert Griesemer <gri@golang.org>
-
Russ Cox authored
Fixes #11380. Change-Id: I0a284ad2a46826ce82486479ea4e79f0f470292f Reviewed-on: https://go-review.googlesource.com/16635Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Robert Griesemer authored
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>
-
Robert Griesemer authored
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>
-
Robert Griesemer authored
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>
-
Robert Griesemer authored
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>
-
Robert Griesemer authored
- 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>
-
- 13 Nov, 2015 14 commits
-
-
Matthew Dempsky authored
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>
-
Marcel van Lohuizen authored
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/16305Reviewed-by: Russ Cox <rsc@golang.org>
-
Brad Fitzpatrick authored
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/16864Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Robert Griesemer authored
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>
-
Ian Lance Taylor authored
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/16761Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Brad Fitzpatrick authored
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/16825Reviewed-by: Russ Cox <rsc@golang.org>
-
David Crawshaw authored
Revert "cmd/internal/obj/arm64, cmd/link: use two instructions rather than three for loads from memory" This reverts commit 3a9bc571. Breaks darwin/arm64. Change-Id: Ib958beacabca48020a6a47332fbdec99d994060b Reviewed-on: https://go-review.googlesource.com/16906Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
-
Brad Fitzpatrick authored
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>
-
Brad Fitzpatrick authored
Fixes #12078 Change-Id: Ia8738123b07ca29be4a0cf400ee143729c8b5b3c Reviewed-on: https://go-review.googlesource.com/16860Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shenghou Ma authored
Change-Id: If9dc08d6c29bf60b63d75d973033897ad8bf8cc4 Reviewed-on: https://go-review.googlesource.com/16905Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Shenghou Ma authored
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>
-
Joe Tsai authored
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/16838Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Shenghou Ma authored
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>
-
Matthew Dempsky authored
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/16176Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com>
-