- 12 Jun, 2014 7 commits
-
-
Rui Ueyama authored
Optimize IP.String, IPMask.String and ParseIP. benchmark old ns/op new ns/op delta BenchmarkParseIP 2216 1849 -16.56% BenchmarkIPString 7828 2486 -68.24% BenchmarkIPMaskString 3872 659 -82.98% LGTM=mikioh.mikioh, dave, bradfitz R=golang-codereviews, mikioh.mikioh, dave, bradfitz CC=golang-codereviews https://golang.org/cl/95750043
-
Rui Ueyama authored
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/104080043
-
Andrew Gerrand authored
Fixes #8168. TBR=bradfitz R=golang-codereviews CC=golang-codereviews https://golang.org/cl/107950043
-
Andrew Gerrand authored
TBR=bradfitz R=golang-codereviews CC=golang-codereviews https://golang.org/cl/104090044
-
Rui Ueyama authored
Call copy with as large buffer as possible to reduce the number of function calls. benchmark old ns/op new ns/op delta BenchmarkBytesRepeat 540 162 -70.00% BenchmarkStringsRepeat 563 177 -68.56% LGTM=josharian R=golang-codereviews, josharian, dave, dvyukov CC=golang-codereviews https://golang.org/cl/90550043
-
Rui Ueyama authored
Remove unnecessary blank line. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/105040045
-
Keith Randall authored
Make sure stack copier doesn't barf on a nil defer. Bug was fixed in https://golang.org/cl/101800043 This change just adds a test. Fixes #8047 LGTM=dvyukov, rsc R=dvyukov, rsc CC=golang-codereviews https://golang.org/cl/108840043
-
- 11 Jun, 2014 7 commits
-
-
Robert Griesemer authored
LGTM=adonovan R=rsc, adonovan CC=golang-codereviews https://golang.org/cl/104050045
-
Rui Ueyama authored
Previously, an input string was stripped of newline characters at the beginning of DecodeString and then passed to Decode. Decode again tried to strip newline characters. That's waste of time. benchmark old MB/s new MB/s speedup BenchmarkDecodeString 38.37 65.20 1.70x LGTM=dave, bradfitz R=golang-codereviews, dave, bradfitz CC=golang-codereviews https://golang.org/cl/91770051
-
Russ Cox authored
There is a hierarchy of location defined by loop depth: -1 = the heap 0 = function results 1 = local variables (and parameters) 2 = local variable declared inside a loop 3 = local variable declared inside a loop inside a loop etc In general if an address from loopdepth n is assigned to something in loop depth m < n, that indicates an extended lifetime of some form that requires a heap allocation. Function results can be local variables too, though, and so they don't actually fit into the hierarchy very well. Treat the address of a function result as level 1 so that if it is written back into a result, the address is treated as escaping. Fixes #8185. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/108870044
-
Robert Griesemer authored
Pending CL 101750048. For submission after the 1.3 release. Fixes #8065. LGTM=adonovan R=adonovan CC=golang-codereviews https://golang.org/cl/93550043
-
Robert Griesemer authored
Provide Nextafter64 as alias to Nextafter. For submission after the 1.3 release. Fixes #8117. LGTM=adonovan R=adonovan CC=golang-codereviews https://golang.org/cl/101750048
-
Russ Cox authored
The analysis for &x was using the loop depth on x set during x's declaration. A type switch creates a list of implicit declarations that were not getting initialized with loop depths. Fixes #8176. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/108860043
-
Shenghou Ma authored
LGTM=rsc R=dave, rsc CC=golang-codereviews https://golang.org/cl/105030043
-
- 10 Jun, 2014 4 commits
-
-
Brad Fitzpatrick authored
Fixes #8180 LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/105040043
-
Ian Lance Taylor authored
The putpclcdelta function set the DWARF line number PC to s->value + pcline->pc, which is correct, but the code then set the local variable pc to epc, which can be a different value. This caused the next delta in the DWARF table to be wrong. Fixes #8098. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/104950045
-
Rob Pike authored
Fixes #8156. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/108840045
-
Rob Pike authored
align=middle is invalid; use align=center LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/106910044
-
- 06 Jun, 2014 1 commit
-
-
Russ Cox authored
A runtime.Goexit during a panic-invoked deferred call left the panic stack intact even though all the stack frames are gone when the goroutine is torn down. The next goroutine to reuse that struct will have a bogus panic stack and can cause the traceback routines to walk into garbage. Most likely to happen during tests, because t.Fatal might be called during a deferred func and uses runtime.Goexit. This "not enough cleared in Goexit" failure mode has happened to us multiple times now. Clear all the pointers that don't make sense to keep, not just gp->panic. Fixes #8158. LGTM=iant, dvyukov R=iant, dvyukov CC=golang-codereviews https://golang.org/cl/102220043
-
- 05 Jun, 2014 4 commits
-
-
Russ Cox authored
I am not sure what the rounding here was trying to do, but it was skipping the first pointer on native client. The code above the rounding already checks that xoffset is widthptr-aligned, so the rnd was a no-op everywhere but on Native Client. And on Native Client it was wrong. Perhaps it was supposed to be rounding down, not up, but zerorange handles the extra 32 bits correctly, so the rnd does not seem to be necessary at all. This wouldn't be worth doing for Go 1.3 except that it can affect code on the playground. Fixes #8155. LGTM=r, iant R=golang-codereviews, r, iant CC=dvyukov, golang-codereviews, khr https://golang.org/cl/108740047
-
Russ Cox authored
LGTM=r R=r, 0xjnml, bradfitz, iant CC=golang-codereviews https://golang.org/cl/103070046
-
Ian Lance Taylor authored
Fixes #8148. LGTM=cookieo9, rsc R=rsc, cookieo9 CC=golang-codereviews https://golang.org/cl/103080043
-
Dmitriy Vyukov authored
The current wording is reversed in 2 places. Not sure how it got 4 LGTMs (mine was there as well). Update #6242. LGTM=dan.kortschak, r, rsc R=golang-codereviews, 0xjnml, dan.kortschak, r, rsc CC=golang-codereviews https://golang.org/cl/101980047
-
- 04 Jun, 2014 1 commit
-
-
Shenghou Ma authored
doc/install-source.html: document that GO386 will be auto-detected when building on both 386 and amd64. Fixes #8152. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/102150046
-
- 03 Jun, 2014 7 commits
-
-
Ian Lance Taylor authored
It's not clear how widespread this issue is, but we do have a test case generated by a development version of clang. I don't know whether this should go into 1.3 or not; happy to hear arguments either way. LGTM=rsc R=golang-codereviews, bradfitz, rsc CC=golang-codereviews https://golang.org/cl/96680045
-
Ian Lance Taylor authored
Fixes #8126. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/103020044
-
Russ Cox authored
I introduced this bug when I changed the escape analysis to run in phases based on call graph dependency order, in order to be more precise about inputs escaping back to outputs (functions returning their arguments). Given func f(z **int) *int { return *z } we were tagging the function as 'z does not escape and is not returned', which is all true, but not enough information. If used as: var x int p := &x q := &p leak(f(q)) then the compiler might try to keep x, p, and q all on the stack, since (according to the recorded information) nothing interesting ends up being passed to leak. In fact since f returns *q = p, &x is passed to leak and x needs to be heap allocated. To trigger the bug, you need a chain that the compiler wants to keep on the stack (like x, p, q above), and you need a function that returns an indirect of its argument, and you need to pass the head of the chain to that function. This doesn't come up very often: this bug has been present since June 2012 (between Go 1 and Go 1.1) and we haven't seen it until now. It helps that most functions that return indirects are getters that are simple enough to be inlined, avoiding the bug. Earlier versions of Go also had the benefit that if &x really wasn't used beyond x's lifetime, nothing broke if you put &x in a heap-allocated structure accidentally. With the new stack copying, though, heap-allocated structures containing &x are not updated when the stack is copied and x moves, leading to crashes in Go 1.3 that were not crashes in Go 1.2 or Go 1.1. The fix is in two parts. First, in the analysis of a function, recognize when a value obtained via indirect of a parameter ends up being returned. Mark those parameters as having content escape back to the return results (but we don't bother to write down which result). Second, when using the analysis to analyze, say, f(q), mark parameters with content escaping as having any indirections escape to the heap. (We don't bother trying to match the content to the return value.) The fix could be less precise (simpler). In the first part we might mark all content-escaping parameters as plain escaping, and then the second part could be dropped. Or we might assume that when calling f(q) all the things pointed at by q escape always (for any f and q). The fix could also be more precise (more complex). We might record the specific mapping from parameter to result along with the number of indirects from the parameter to the thing being returned as the result, and then at the call sites we could set up exactly the right graph for the called function. That would make notleaks(f(q)) be able to keep x on the stack, because the reuslt of f(q) isn't passed to anything that leaks it. The less precise the fix, the more stack allocations become heap allocations. This fix is exactly as precise as it needs to be so that none of the current stack allocations in the standard library turn into heap allocations. Fixes #8120. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews, khr, r https://golang.org/cl/102040046
-
Brad Fitzpatrick authored
Thanks to Frithjof Schulze for noticing. LGTM=adg R=adg CC=agl, golang-codereviews, r https://golang.org/cl/107740043
-
Brad Fitzpatrick authored
Fixes #8134 LGTM=iant R=golang-codereviews, iant CC=golang-codereviews, r, rsc https://golang.org/cl/100930044
-
Russ Cox authored
The 'address taken' bit in a function variable was not propagating into the inlined copies, causing incorrect liveness information. LGTM=dsymonds, bradfitz R=golang-codereviews, bradfitz CC=dsymonds, golang-codereviews, iant, khr, r https://golang.org/cl/96670046
-
Russ Cox authored
The 1-byte write was silently clearing a byte on the stack. If there was another function call with more arguments in the same stack frame, no harm done. Otherwise, if the variable at that location was already zero, no harm done. Otherwise, problems. Fixes #8139. LGTM=dsymonds R=golang-codereviews, dsymonds CC=golang-codereviews, iant, r https://golang.org/cl/100940043
-
- 02 Jun, 2014 8 commits
-
-
Rob Pike authored
This is a workaround - the code should be better than this - but the fix avoids generating large numbers of linehist entries for the wrapper functions that enable interface conversions. There can be many of them, they all happen at the end of compilation, and they can all share a linehist entry. Avoids bad n^2 behavior in liblink. Test case in issue 8135 goes from 64 seconds to 2.5 seconds (still bad but not intolerable). Fixes #8135. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/104840043
-
Ian Lance Taylor authored
If we see a typedef to an anonymous struct more than once, presumably in two different Go files that import "C", use the same Go type name. Fixes #8133. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/102080043
-
Ian Lance Taylor authored
LGTM=r R=khr, r CC=golang-codereviews https://golang.org/cl/103810044
-
Andrew Gerrand authored
Not sure how this snuck in undetected. TBR=bradfitz R=golang-codereviews CC=golang-codereviews https://golang.org/cl/106760043
-
Andrew Gerrand authored
LGTM=minux R=golang-codereviews, minux CC=golang-codereviews https://golang.org/cl/106750043
-
Shenghou Ma authored
LGTM=adg R=golang-codereviews, r, adg CC=golang-codereviews https://golang.org/cl/102020045
-
Andrew Gerrand authored
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/102040047
-
Brad Fitzpatrick authored
Update #8112 LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/104790045
-
- 01 Jun, 2014 1 commit
-
-
Shenghou Ma authored
Fix plan 9 build. TBR=rsc R=golang-codereviews CC=golang-codereviews https://golang.org/cl/100880047
-