- 30 Sep, 2016 5 commits
-
-
David Crawshaw authored
The endcgo function call is currently deferred in case a cgo callback into Go panics and unwinds through cgocall. Typical cgo calls do not have callbacks into Go, and even fewer panic, so we pay the cost of this defer for no typical benefit. Amazingly, there is another defer on the cgocallback path also used to cleanup in case the Go code called by cgo panics. This CL folds the first defer into the second, to reduce the cost of typical cgo calls. This reduces the overhead for a no-op cgo call significantly: name old time/op new time/op delta CgoNoop-8 93.5ns ± 0% 51.1ns ± 1% -45.34% (p=0.016 n=4+5) The total effect between Go 1.7 and 1.8 is even greater, as CL 29656 reduced the cost of defer recently. Hopefully a future Go release will drop the cost of defer to nothing, making this optimization unnecessary. But until then, this is nice. Change-Id: Id1a5648f687a87001d95bec6842e4054bd20ee4f Reviewed-on: https://go-review.googlesource.com/30080 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
Consistently access function parameters using the FP pseudo-register instead of SP (e.g., x+0(FP) instead of x+4(SP) or x+8(SP), depending on register size). Two reasons: 1) doc/asm says the SP pseudo-register should use negative offsets in the range [-framesize, 0), and 2) cmd/vet only validates parameter offsets when indexed from the FP pseudo-register. No binary changes to the compiled object files for any of the affected package/OS/arch combinations. Change-Id: I0efc6079bc7519fcea588c114ec6a39b245d68b0 Reviewed-on: https://go-review.googlesource.com/30085Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
At this point in the compiler we haven't assigned Xoffset values for PAUTO variables anyway, so just immediately store the stack offsets into Xoffset rather than into a global map. Change-Id: I61eb471c857c8b145fd0895cbd98fd4e8d3c3365 Reviewed-on: https://go-review.googlesource.com/30081 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Keith Randall <khr@golang.org>
-
Matthew Dempsky authored
There are only three Prog types that we were creating with an OLITERAL Node: ATEXT, ATYPE, and AFUNCDATA. ATEXT's value we later overwrite in defframe, and ATYPE's we don't even need. AFUNCDATA only needs integer constants, so get rid of all the non-int constant logic and skip creating a Node representation for the constant. While here, there are a few other Naddr code paths that are no longer needed, so turn those into Fatalfs. Passes toolstash/buildall. Change-Id: I4cc9b92c3011890afd4f31ebeba8b1b42b753cab Reviewed-on: https://go-review.googlesource.com/30074 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
I decided not to expand the API for this per discusion on #16220. Fixes #16220 Change-Id: I65cb2eacd4ec28c79438a8f7c30024524a484ce6 Reviewed-on: https://go-review.googlesource.com/30082Reviewed-by:
Daniel Theophanes <kardianos@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 29 Sep, 2016 17 commits
-
-
Matthew Dempsky authored
Naddr used to translate PFUNC Nodes into references to the function literal wrapper, and then Afunclit could be used to rewrite it to reference the function text itself. But now everywhere we use Naddr on PFUNC Nodes, we immediately call Afunclit anyway. So just merge Afunclit's behavior into Naddr. Passes toolstash/buildall. Change-Id: If2ca6d7f314c1a0711df9b8209aace16ba4b8bc0 Reviewed-on: https://go-review.googlesource.com/30073 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Daniel Theophanes authored
To prevent leaking connections, close any open Rows when the context is cancelled. Also enforce context cancel while reading rows off of the wire. Change-Id: I62237ecdb7d250d6734f6ce3d2b0bcb16dc6fda7 Reviewed-on: https://go-review.googlesource.com/29957Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Fixes #17288. Change-Id: I2ddd01d14667d5c6a2e19bd70489da8d9869d308 Reviewed-on: https://go-review.googlesource.com/30072 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Fix an old TODO and use atomic.Value for holding the Transport's alternate protocol map. It is very frequently accessed and almost never set or updated. Change-Id: Ic5a71c504bdac76678114c6390d1fc0673e07aa9 Reviewed-on: https://go-review.googlesource.com/29967 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
No fast path currently for solaris, windows, nacl, plan9. Fixes #13451 Change-Id: I24b3233a2e3a57fc6445e276a5c0d7b097884007 Reviewed-on: https://go-review.googlesource.com/29951Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Nodir Turakulov authored
Currently any script tag is treated as a javascript container, although <script type="text/template"> must not be. Check "type" attribute of "script" tag. If it is present and it is not a JS MIME type, do not transition to elementScript state. Fixes #12149, where // inside text template was treated as regexp. Fixes #6701 Change-Id: I8fc9e504f7280bdd800f40383c061853665ac8a2 Reviewed-on: https://go-review.googlesource.com/14336 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-
Matthew Dempsky authored
All other architectures merge stack-zeroing ranges if there are at most two pointers/registers of memory between them, but x86 is erroneously coded to require *exactly* two. Shaves a tiny amount of text size off cmd/go when building for GOARCH=386 and eliminates an unnecessary inconsistency between x86's defframe and the other GOARCHes'. text data bss dec hex filename 5241015 191051 93336 5525402 544f9a go.before 5240224 191051 93336 5524611 544c83 go.after Change-Id: Ib15ec8c07bca11e824640f0ab32abfc4bb160496 Reviewed-on: https://go-review.googlesource.com/30050 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alberto Donizetti authored
Introduced in CL 9263 (prepare to unexport gc.Mp*) and CL 9267 (prepare Node.Val to be unexported), their only callers were in the old backend and all got deleted in CL 29168 (cmd/compile: delete lots of the legacy backend). Update #16357 Change-Id: I0a5d76b98b418e8ec0984c033c3bc0ac3fc5f38a Reviewed-on: https://go-review.googlesource.com/29997Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Joe Tsai authored
Move all parse/format related functionality into strconv.go and thoroughly test them. This also reduces the amount of noise inside reader.go and writer.go. There was zero functionality change other than moving code around. Change-Id: I3bc288d10c20ebb3814b30b75d8acd7be62b85d7 Reviewed-on: https://go-review.googlesource.com/28470 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Joe Tsai authored
RFC 6265, section 4.2.2 says: <<< Although cookies are serialized linearly in the Cookie header, servers SHOULD NOT rely upon the serialization order. In particular, if the Cookie header contains two cookies with the same name (e.g., that were set with different Path or Domain attributes), servers SHOULD NOT rely upon the order in which these cookies appear in the header. >>> This statement seems to indicate that cookies should conceptually be thought of as a map of keys to sets of values (map[key][]value). However, in practice, everyone pretty much treats cookies as a map[key]value and the API for Request.Cookie seems to indicate that. We should update the documentation for Request.Cookie to warn the user what happens when there is are multiple cookies with the same key. I deliberately did not want to say *which* cookie is returned. Change-Id: Id3e0e24b2b14ca2d9ea8b13f82ba739edaa71cf0 Reviewed-on: https://go-review.googlesource.com/29364Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Change-Id: I573278c9aee80e62463b2542774dabeec7c3b098 Reviewed-on: https://go-review.googlesource.com/29969 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Cherry Zhang <cherryyz@google.com>
-
Brad Fitzpatrick authored
In https://golang.org/cl/28951 I cleaned up the lookupProtocol and lookupPort paths to be consistently case-insensitive across operating systems and to share the same baked-in maps of port & proto values that can be relied on to exist on any platform. I missed the fallback to the baked-in maps on Windows, though, which broke Windows XP. This should fix it. Fixes #17175 Change-Id: Iecd434fb684304137ee27f5521cfaa8c351a1bde Reviewed-on: https://go-review.googlesource.com/29968 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Alberto Donizetti authored
IntLiteral was only called by the gins functions in cmd/compile/internal/{arm64,mips64,ppc64}/gsubr.go but CL 29220 (cmd/compile: remove gins) deleted them, so IntLiteral is now unused. Change-Id: I2652b6d2ace6fdadc1982f65e749f3982513371e Reviewed-on: https://go-review.googlesource.com/29996Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alberto Donizetti authored
Fixes #17276 Change-Id: I0188cf9bc5fdb48c71ad929cc54206d03e0b96e4 Reviewed-on: https://go-review.googlesource.com/29995Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ilya Tocar authored
This makes function fit in 16 bytes, saving 16 bytes. Change-Id: Iac5d2add42f6dae985b2a5cbe19ad4bd4bcc92ec Reviewed-on: https://go-review.googlesource.com/29151 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Keith Randall <khr@golang.org>
-
Cherry Zhang authored
When offset < 0 and -offset fits in instruction, generate SUB instruction, instead of ADD with constant from the pool. Fixes #13280. Change-Id: I57d97fe9300fe1f6554365e2262393ef50acbdd3 Reviewed-on: https://go-review.googlesource.com/30014 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
David Chase <drchase@google.com>
-
Ilya Tocar authored
Remove duplicate vars, commented out code and duplicate lines. When choosing between 2 aliases, on with more uses was chosen. Change-Id: I7bc15f1693de3f6d378cef9c09469970a659db40 Reviewed-on: https://go-review.googlesource.com/29152 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Keith Randall <khr@golang.org>
-
- 28 Sep, 2016 8 commits
-
-
Matthew Dempsky authored
Fixes #17270. Change-Id: I4affa57e10baf1a758bc0977265d160f220b2945 Reviewed-on: https://go-review.googlesource.com/29960 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Cherry Zhang authored
Also add compiler debug ouput and add a test. Fixes #15390. Change-Id: Iceba1414c29bcc213b87837387bf8ded1f3157f1 Reviewed-on: https://go-review.googlesource.com/30011 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Keith Randall <khr@golang.org>
-
Blixt authored
This change adds support for decoding and encoding the bool type. The encoding is a single byte, with a zero value for false and a non-zero value for true. Closes #16856. Change-Id: I1d1114b320263691473bb100cad0f380e0204186 Reviewed-on: https://go-review.googlesource.com/28514Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Andrew Gerrand authored
Change-Id: I6d413f747e6a6c30c5e0e9afdffd5ec18dce7e08 Reviewed-on: https://go-review.googlesource.com/29974Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Mikio Hara authored
This change reverts CL 18814 which is a workaroud for older DragonFly BSD kernels, and fixes #13945 and #13947 in a more general way the same as other platforms except NetBSD. This is a followup to CL 29491. Updates #16329. Change-Id: I771670bc672c827f2b3dbc7fd7417c49897cb991 Reviewed-on: https://go-review.googlesource.com/29971 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Change setsig, setsigstack, getsig, raise, raiseproc to take uint32 for signal number parameter, as that is the type mostly used for signal numbers. Same for dieFromSignal, sigInstallGoHandler, raisebadsignal. Remove setsig restart parameter, as it is always either true or irrelevant. Don't check the handler in setsigstack, as the only caller does that anyhow. Don't bother to convert the handler from sigtramp to sighandler in getsig, as it will never be called when the handler is sigtramp or sighandler. Don't check the return value from rt_sigaction in the GNU/Linux version of setsigstack; no other setsigstack checks it, and it never fails. Change-Id: I6bbd677e048a77eddf974dd3d017bc3c560fbd48 Reviewed-on: https://go-review.googlesource.com/29953 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Andrew Gerrand authored
Fixes #17231 Change-Id: I0d6007ab504f2277cb6affc9e2050157a6ad4d5e Reviewed-on: https://go-review.googlesource.com/29970Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Minux Ma <minux@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alex Brainman authored
This change replaces the use of CryptGenRandom with RtlGenRandom in Windows to generate cryptographically random numbers during process startup. RtlGenRandom uses the same RNG as CryptGenRandom, but it has many fewer DLL dependencies and so does not affect process startup time as much. This makes running simple Go program on my computers faster. Windows XP: benchmark old ns/op new ns/op delta BenchmarkRunningGoProgram-2 47408573 10784148 -77.25% Windows 7 (VM): benchmark old ns/op new ns/op delta BenchmarkRunningGoProgram 16260390 12792150 -21.33% Windows 7: benchmark old ns/op new ns/op delta BenchmarkRunningGoProgram-2 13600778 10050574 -26.10% Fixes #15589 Change-Id: I2816239a2056e3d4a6dcd86a6fa2bb619c6008fe Reviewed-on: https://go-review.googlesource.com/29700Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 27 Sep, 2016 10 commits
-
-
Keith Randall authored
Mark nil check operations as faulting if their arg is zero. This lets the late nilcheck pass remove duplicates. Fixes #17242. Change-Id: I4c9938d8a5a1e43edd85b4a66f0b34004860bcd9 Reviewed-on: https://go-review.googlesource.com/29952 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Cherry Zhang <cherryyz@google.com>
-
Cherry Zhang authored
Also add GP<->FP move addressing mode to FMOVS, FMOVD instructions. Ceil-8 37.1ns ± 0% 7.9ns ± 0% -78.64% (p=0.000 n=4+5) Dim-8 20.9ns ± 1% 11.3ns ± 0% -45.93% (p=0.008 n=5+5) Floor-8 22.9ns ± 0% 7.9ns ± 0% -65.41% (p=0.029 n=4+4) Gamma-8 117ns ± 0% 94ns ± 1% -19.50% (p=0.016 n=4+5) PowInt-8 121ns ± 0% 108ns ± 1% -11.07% (p=0.008 n=5+5) PowFrac-8 331ns ± 0% 318ns ± 0% -3.93% (p=0.000 n=5+4) Trunc-8 18.8ns ± 0% 7.9ns ± 0% -57.83% (p=0.016 n=4+5) Change-Id: I709b7f1a914b28adc27414522db551e2630cfb92 Reviewed-on: https://go-review.googlesource.com/29734 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
David Chase <drchase@google.com>
-
Brad Fitzpatrick authored
It wasn't lowercasing the string, folding widths, and putting strings into NFC form. Do those. Fixes #13835 Change-Id: Ia3de6159417cacec203b48e206e51d79f945df58 Reviewed-on: https://go-review.googlesource.com/29860 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Marcel van Lohuizen <mpvl@golang.org>
-
Brad Fitzpatrick authored
Add golang.org/x/text/unicode/norm from x/text git rev a7c02369. Needed by net/http for IDNA normalization. Updates #13835 Change-Id: I8b024e179d573f2b093c209a4b9e4f71f7d4a1f2 Reviewed-on: https://go-review.googlesource.com/29859 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Marcel van Lohuizen <mpvl@golang.org>
-
mike andrews authored
Documentation made reference to an unknown entity "DisableHTMLEscaping," but I think it actually meant the method "Encoder.SetEscapeHTML." Fixes #17255 Change-Id: I18fda76f8066110caef85fd33698de83d632e646 Reviewed-on: https://go-review.googlesource.com/29931Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
The OS-independent sigmask type was not pulling its weight. Replace it with the OS-dependent sigset type. This requires adding an OS-specific sigaddset function, but permits removing the OS-specific sigmaskToSigset function. Change-Id: I43307b512b0264ec291baadaea902f05ce212305 Reviewed-on: https://go-review.googlesource.com/29950 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Daniel Theophanes authored
Add context methods to sql and sql/driver methods. If the driver doesn't implement context methods the connection pool will still handle timeouts when a query fails to return in time or when a connection is not available from the pool in time. There will be a follow-up CL that will add support for context values that specify transaction levels and modes that a driver can use. Fixes #15123 Change-Id: Ia99f3957aa3f177b23044dd99d4ec217491a30a7 Reviewed-on: https://go-review.googlesource.com/29381Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Luigi Riefolo authored
IsPredeclared allows simplifying src/golang.org/x/tools/godoc/linkify.go Change-Id: I56b3223896f844630bc2e940255572d1682f0d06 Reviewed-on: https://go-review.googlesource.com/29870Reviewed-by:
Robert Griesemer <gri@golang.org>
-
Ian Lance Taylor authored
Change the two calls to signalstack(nil) to inline the code instead (it's two lines). Change-Id: Ie92a05494f924f279e40ac159f1b677fda18f281 Reviewed-on: https://go-review.googlesource.com/29854 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Elias Naur authored
The SetFinalizer documentation states that "The argument obj must be a pointer to an object allocated by calling new or by taking the address of a composite literal." which precludes pointers to local variables. According to a comment on #6591, this case is expected to work. This CL updates the documentation for SetFinalizer accordingly. Fixes #6591 Change-Id: Id861b3436bc1c9521361ea2d51c1ce74a121c1af Reviewed-on: https://go-review.googlesource.com/29592 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Austin Clements <austin@google.com>
-