- 13 Feb, 2015 2 commits
-
-
Josh Bleecher Snyder authored
Using a zero register results in shorter, faster code. 5g already did this. Bring 6g, 8g, and 9g up to speed. Reduces godoc binary size by 0.29% using 6g. This CL includes cosmetic changes to 5g and 8g. With those cosmetic changes included, componentgen is now character-for-character equivalent across the four architectures. Change-Id: I0e13dd48374bad830c725b117a1c86d4197d390c Reviewed-on: https://go-review.googlesource.com/2606Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
Fix a flipped nil check. The flipped check prevented componentgen from zeroing a non-cadable nl. This fix reduces the number of non-SB LEAQs in godoc from 35323 to 34920 (-1.1%). Update #1914 Change-Id: I15ea303068835f606f883ddf4a2bb4cb2287e9ae Reviewed-on: https://go-review.googlesource.com/2605Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
- 12 Feb, 2015 16 commits
-
-
Josh Bleecher Snyder authored
Consider an interface value i of type I and concrete value c of type C. Prior to this CL, i==c was evaluated as I(c) == i Evaluating I(c) can allocate. This CL changes the evaluation of i==c to x, ok := i.(C); ok && x == c The new generated code is shorter and does not allocate directly. If C is small, as it is in every instance in the stdlib, the new code also uses less stack space and makes one runtime call instead of two. If C is very large, the original implementation is used. The cutoff for "very large" is 1<<16, following the stack vs heap cutoff used elsewhere. This kind of comparison occurs in 38 places in the stdlib, mostly in the net and os packages. benchmark old ns/op new ns/op delta BenchmarkEqEfaceConcrete 29.5 7.92 -73.15% BenchmarkEqIfaceConcrete 32.1 7.90 -75.39% BenchmarkNeEfaceConcrete 29.9 7.90 -73.58% BenchmarkNeIfaceConcrete 35.9 7.90 -77.99% Fixes #9370. Change-Id: I7c4555950bcd6406ee5c613be1f2128da2c9a2b7 Reviewed-on: https://go-review.googlesource.com/2096Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
When compiling the stdlib most of the calls to sgen are for exactly 2 or 3 words: 85% for 6g and 70% for 8g. Special case them for performance. This optimization is not relevant to 5g and 9g. 6g benchmark old ns/op new ns/op delta BenchmarkCopyFat16 3.25 0.82 -74.77% BenchmarkCopyFat24 5.47 0.95 -82.63% 8g benchmark old ns/op new ns/op delta BenchmarkCopyFat8 3.84 2.42 -36.98% BenchmarkCopyFat12 4.94 2.15 -56.48% Change-Id: I8bc60b453f12597dfd916df2d072a7d5fc33ab85 Reviewed-on: https://go-review.googlesource.com/2607Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
When possible, generate nodl/nodr directly into DI/SI rather than going through a temporary register. CX has already been saved; use it during trailing bytes cleanup. Change-Id: I4ec6209bcc5d3bfdc927c5c132009bd8d791ada3 Reviewed-on: https://go-review.googlesource.com/2608Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Robert Griesemer authored
Change-Id: Ic270ffa7ec6f6dd4b0a951c64ad965447cce1417 Reviewed-on: https://go-review.googlesource.com/4571Reviewed-by: Alan Donovan <adonovan@google.com>
-
Austin Clements authored
No code modifications. This is in preparation for improving the wbuf abstraction. Change-Id: I719543a345c34d079b7e39b251eccd5dd8a07826 Reviewed-on: https://go-review.googlesource.com/4710Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
Plan 9's sysFree has an optimization where if the object being freed is the last object allocated, it will roll back the brk to allow the memory to be reused by sysAlloc. However, it does not zero this "returned" memory, so as a result, sysAlloc can return non-zeroed memory after a sysFree. This leads to corruption because the runtime assumes sysAlloc returns zeroed memory. Fix this by zeroing the memory returned by sysFree. Fixes #9846. Change-Id: Id328c58236eb7c464b31ac1da376a0b757a5dc6a Reviewed-on: https://go-review.googlesource.com/4700Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: David du Colombier <0intro@gmail.com>
-
Andrew Gerrand authored
Change-Id: Id86994c8692e29f9d073b6322733ce9219887dc3 Reviewed-on: https://go-review.googlesource.com/4520 Run-TryBot: Andrew Gerrand <adg@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Dmitry Vyukov authored
Extend escape analysis to make(map[k]v). If it does not escape, allocate temp buffer for hmap and one bucket on stack. There are 75 cases of non-escaping maps in std lib. benchmark old allocs new allocs delta BenchmarkConcurrentStmtQuery 16161 15161 -6.19% BenchmarkConcurrentTxQuery 17658 16658 -5.66% BenchmarkConcurrentTxStmtQuery 16157 15156 -6.20% BenchmarkConcurrentRandom 13637 13114 -3.84% BenchmarkManyConcurrentQueries 22 20 -9.09% BenchmarkDecodeComplex128Slice 250 188 -24.80% BenchmarkDecodeFloat64Slice 250 188 -24.80% BenchmarkDecodeInt32Slice 250 188 -24.80% BenchmarkDecodeStringSlice 2250 2188 -2.76% BenchmarkNewEmptyMap 1 0 -100.00% BenchmarkNewSmallMap 2 0 -100.00% benchmark old ns/op new ns/op delta BenchmarkNewEmptyMap 124 55.7 -55.08% BenchmarkNewSmallMap 317 148 -53.31% benchmark old allocs new allocs delta BenchmarkNewEmptyMap 1 0 -100.00% BenchmarkNewSmallMap 2 0 -100.00% benchmark old bytes new bytes delta BenchmarkNewEmptyMap 48 0 -100.00% BenchmarkNewSmallMap 192 0 -100.00% Fixes #5449 Change-Id: I24fa66f949d2f138885d9e66a0d160240dc9e8fa Reviewed-on: https://go-review.googlesource.com/3508Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
-
Dmitry Vyukov authored
Dump frames of functions. Add function name and var width to output. Change-Id: Ida06b8def96178fa550ca90836eb4a2509b9e13f Reviewed-on: https://go-review.googlesource.com/3870Reviewed-by: Russ Cox <rsc@golang.org>
-
Dmitry Vyukov authored
typedslicecopy is another write barrier that is not understood by racewalk. It seems quite complex to handle it in the compiler, so instead just instrument it in runtime. Update #9796 Change-Id: I0eb6abf3a2cd2491a338fab5f7da22f01bf7e89b Reviewed-on: https://go-review.googlesource.com/4370Reviewed-by: Russ Cox <rsc@golang.org>
-
Dmitry Vyukov authored
Walk calls it outervalue, racewalk calls it basenod, isstack does it manually and slightly differently. Change-Id: Id5b5d32b8faf143fe9d34bd08457bfab6fb33daa Reviewed-on: https://go-review.googlesource.com/3745Reviewed-by: Russ Cox <rsc@golang.org>
-
Dmitry Vyukov authored
Support the following conversions in escape analysis: []rune("foo") []byte("foo") string([]rune{}) If the result does not escape, allocate temp buffer on stack and pass it to runtime functions. Change-Id: I1d075907eab8b0109ad7ad1878104b02b3d5c690 Reviewed-on: https://go-review.googlesource.com/3590Reviewed-by: Russ Cox <rsc@golang.org>
-
Brad Fitzpatrick authored
We don't have executable memory anymore. Change-Id: I9835f03a7bcd97d809841ecbed8718b3048bfb32 Reviewed-on: https://go-review.googlesource.com/4681Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: Dave Cheney <dave@cheney.net>
-
Alex Brainman authored
Change-Id: I40291561a18bed3ca6be9dca12a664bdf28cb2f1 Reviewed-on: https://go-review.googlesource.com/4660Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alex Brainman authored
Change-Id: I35fe76661c80ca808a711acf608a23c77aeb0608 Reviewed-on: https://go-review.googlesource.com/4651Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
mattn authored
Fixes #9190 Change-Id: I22177687ed834feed165454019d28c11fcbf0fa2 Reviewed-on: https://go-review.googlesource.com/2307Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
-
- 11 Feb, 2015 18 commits
-
-
Russ Cox authored
(In non-Go print formats, the 016 includes the leading 0x prefix. No one noticed, but we were printing hex numbers with a minimum of 30 digits, not 32.) Change-Id: I10ff7a51a567ad7c8440418ac034be9e4b2d6bc1 Reviewed-on: https://go-review.googlesource.com/4592Reviewed-by: Austin Clements <austin@google.com>
-
Russ Cox authored
This matches all the other pseudo-packages. The line was simply forgotten. Change-Id: I278f6cbcfc883ea7efad07f99fc8c853b9b5d274 Reviewed-on: https://go-review.googlesource.com/4591Reviewed-by: Austin Clements <austin@google.com>
-
Russ Cox authored
Otherwise different qsort implementations might result in different sort orders and therefore different compiled object files. Change-Id: Ie783ba55a55af06941307e150b0c406e0a8128b0 Reviewed-on: https://go-review.googlesource.com/4590Reviewed-by: Austin Clements <austin@google.com>
-
Russ Cox authored
It does not convert to Go well. Being able to do this just once, instead of 4 times, was the primary motivation for all the recent refactoring (not that it wasn't overdue). Still bit-for-bit identical. Change-Id: Ia01f17948441bf64fa78ec4226f0bb40af0bbaab Reviewed-on: https://go-review.googlesource.com/3962Reviewed-by: Austin Clements <austin@google.com>
-
Russ Cox authored
Now there is only one registerizer shared among all the systems. There are some unfortunate special cases based on arch.thechar in reg.c, to preserve bit-for-bit compatibility during the refactoring. Most are probably bugs one way or another and should be revisited. Change-Id: I153b435c0eaa05bbbeaf8876822eeb6dedaae3cf Reviewed-on: https://go-review.googlesource.com/3883Reviewed-by: Austin Clements <austin@google.com>
-
Russ Cox authored
gc/order.c rewrites OASOP nodes into ordinary assignments. The back ends never see them anymore. Change-Id: I268ac8bdc92dccd7123110a21f99ada3ceeb2baa Reviewed-on: https://go-review.googlesource.com/3882Reviewed-by: Austin Clements <austin@google.com>
-
Russ Cox authored
This isn't everything, but it's a start. Still producing bit-identical compiler output. The semantics of the old back ends is preserved, even when they are probably buggy. There are some TODOs in gc/gsubr.c to remove special cases to preserve bugs in 5g and 8g. Change-Id: I28ae295fbfc94ef9df43e13ab96bd6fc2f194bc4 Reviewed-on: https://go-review.googlesource.com/3802Reviewed-by: Austin Clements <austin@google.com>
-
Robert Griesemer authored
benchmark old ns/op new ns/op delta BenchmarkFormatFloatDecimal 300 283 -5.67% BenchmarkFormatFloat 383 381 -0.52% BenchmarkFormatFloatExp 359 357 -0.56% BenchmarkFormatFloatNegExp 357 358 +0.28% BenchmarkFormatFloatBig 468 430 -8.12% BenchmarkAppendFloatDecimal 104 92.5 -11.06% BenchmarkAppendFloat 199 190 -4.52% BenchmarkAppendFloatExp 172 167 -2.91% BenchmarkAppendFloatNegExp 172 169 -1.74% BenchmarkAppendFloatBig 280 235 -16.07% BenchmarkAppendFloat32Integer 104 92.4 -11.15% BenchmarkAppendFloat32ExactFraction 168 171 +1.79% BenchmarkAppendFloat32Point 206 199 -3.40% BenchmarkAppendFloat32Exp 167 167 +0.00% BenchmarkAppendFloat32NegExp 167 166 -0.60% BenchmarkAppendFloat64Fixed1 134 129 -3.73% BenchmarkAppendFloat64Fixed2 144 136 -5.56% BenchmarkAppendFloat64Fixed3 138 134 -2.90% BenchmarkAppendFloat64Fixed4 145 138 -4.83% Change-Id: Ia143840cb34cbd1cebd6b691dd0a45b7264b406c Reviewed-on: https://go-review.googlesource.com/3920Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
Change-Id: Ib3738492a2ec8fc99323e687168b17b7239db6ad Reviewed-on: https://go-review.googlesource.com/4511Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
Change-Id: Ic5f3864bc6d94d60b754e3ccf72b1d40c5c09117 Reviewed-on: https://go-review.googlesource.com/4510Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
Change-Id: Id98f7333fe6ae1b64e0469c6d01f02360c1f8f55 Reviewed-on: https://go-review.googlesource.com/4481Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
This avoids surprises. Change-Id: Iaae67da2d12e29c4e797ad6313e0895f7ce80cb1 Reviewed-on: https://go-review.googlesource.com/4480Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-
Rick Hudson authored
Add local workbufs to the m struct in order to reduce contention. Add consistency checks for workbuf ownership. Chain workbufs through call change to avoid swapping them to and from the m struct. Adjust the size of the workbuf so that the mutators can more frequently pass modifications to the GC thus shifting some work from the STW mark termination phase to the concurrent mark phase. Change-Id: I557b53af34ad9972265e0ed9f5996e52d548563d Reviewed-on: https://go-review.googlesource.com/3972Reviewed-by: Austin Clements <austin@google.com>
-
Dmitry Vyukov authored
Fixes #9791 g.issystem flag setup races with other code wherever we set it. Even if we set both in parent goroutine and in the system goroutine, it is still possible that some other goroutine crashes before the flag is set. We could pass issystem flag to newproc1, but we start all goroutines with go nowadays. Instead look at g.startpc to distinguish system goroutines (similar to topofstack). Change-Id: Ia3467968dee27fa07d9fecedd4c2b00928f26645 Reviewed-on: https://go-review.googlesource.com/4113Reviewed-by: Keith Randall <khr@golang.org>
-
Dmitry Vyukov authored
benchmark old allocs new allocs delta BenchmarkSkipValue 14914 14202 -4.77% Change-Id: I40e1fe8843cc6a099a2abfcd814ecc2a2d6a5b1f Reviewed-on: https://go-review.googlesource.com/3744Reviewed-by: Keith Randall <khr@golang.org>
-
Dmitry Vyukov authored
Update #8832 This is probably not the root cause of the issue. Resolve TODO about setting unusedsince on a wrong span. Change-Id: I69c87e3d93cb025e3e6fa80a8cffba6ad6ad1395 Reviewed-on: https://go-review.googlesource.com/4390Reviewed-by: Keith Randall <khr@golang.org>
-
Austin Clements authored
Currently, if there is a VERSION.cache, running make.bash will set runtime.theVersion to the revision as of the *last* make.bash run instead of the current make.bash run. For example, $ git rev-parse --short HEAD 5c4a86d0 $ ./make.bash ... $ cat ../VERSION.cache devel +5c4a86d0 Tue Feb 10 01:46:30 2015 +0000 $ git checkout a1dbb920 $ ./make.bash ... $ go version go version devel +5c4a86d0 Tue Feb 10 01:46:30 2015 +0000 linux/amd64 $ ./make.bash ... $ go version go version devel +a1dbb920 Tue Feb 10 02:31:27 2015 +0000 linux/amd64 This happens because go tool dist reads the potentially stale VERSION.cache into goversion during early initialization; then cleans, which deletes VERSION.cache; then builds the runtime using the stale revision read in to goversion. It isn't until make later in the build process, when make.bash invokes go tool dist again, that VERSION.cache gets updated with the current revision. To address this, simply don't bother fetching the version until go tool dist needs it and don't bother caching the value in memory. This is more robust since it interacts with cleaning in the expected ways. Futhermore, there's no downside to eliminating the in-memory cache; the file system cache is perfectly reasonable for the whole three times make.bash consults it. Change-Id: I8c480100e56bb2db0816e8a088177004d9e87973 Reviewed-on: https://go-review.googlesource.com/4540Reviewed-by: Russ Cox <rsc@golang.org>
-
rubyist authored
If an absolute domain name (i.e. ends in a '.' like "example.com.") is used with ssl/tls, the certificate will be reported as invalid. In matchHostnames, the host and patterns are split on '.' and if the lengths of the resulting slices do not match, the function returns false. When splitting an absolute domain name on '.', the slice will have an extra empty string at the end. This empty string should be discarded before comparison, if present. Fixes #9828 Change-Id: I0e39674b44a6f93b5024497e76cf1b550832a61d Reviewed-on: https://go-review.googlesource.com/4380Reviewed-by: Adam Langley <agl@golang.org> TryBot: Adam Langley <agl@golang.org>
-
- 10 Feb, 2015 4 commits
-
-
Keith Randall authored
Container symbols shouldn't be considered as functions in the functab. Having them present probably messes up function lookup, as you might get the descriptor of the container instead of the descriptor of the actual function on the stack. It also messed up the findfunctab because these entries caused off-by-one errors in how functab entries were counted. Normal code is not affected - it only changes (& hopefully fixes) the behavior for libraries linked as a unit, like: net runtime/cgo runtime/race Fixes #9804 Change-Id: I81e036e897571ac96567d59e1f1d7f058ca75e85 Reviewed-on: https://go-review.googlesource.com/4290Reviewed-by: Russ Cox <rsc@golang.org>
-
Mikio Hara authored
Change-Id: I695b89ec2b63233d94c49c4a40a57b50350ec67c Reviewed-on: https://go-review.googlesource.com/4350 TryBot: Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
Change-Id: I69f24887601e491d6d722bfeb2952d927df8ad80 Reviewed-on: https://go-review.googlesource.com/4351Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Fixes #9814. Change-Id: I1be49efae0648038f590eeca1262037bf1af3df5 Reviewed-on: https://go-review.googlesource.com/4240Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-