- 07 Apr, 2015 8 commits
-
-
Mikio Hara authored
This change tries to stop various tester goroutines at the end of each scope for avoiding interference between test cases including benchmarks. Not yet finished completely but enough to land upcoming changes to Dial functions. The rest will be fixed later. Change-Id: Ic38b8681a3a2ddbcd69ba3696f24a61d418a0346 Reviewed-on: https://go-review.googlesource.com/8398Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Josh Bleecher Snyder authored
Convert Embedded, Method, and Colas to bools. I believe that this is the last of the Node fields that can be trivially converted to bools. No functional changes. Passes toolstash -cmp. Change-Id: I81962ee47866596341fc60d24d6959c20cd7fc1c Reviewed-on: https://go-review.googlesource.com/8440Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Mikio Hara authored
Change-Id: I1f2d4e3b0351a7a47c3a6073833a17dbc0c7b05c Reviewed-on: https://go-review.googlesource.com/8520Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
This change adds testHookLookIP to enable to inject DNS name to IP address mappings for Happ{y,yish,ier} Eyeballs dial testing. Change-Id: I8ac04a594e1e2bd77909528df0552889914a7790 Reviewed-on: https://go-review.googlesource.com/8399Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Hudson-Doyle authored
Ian complained about these in a review and then submitted the change before I could fix them. Change-Id: I23d890db2f3648ed1003ed3d13e7247435b913e5 Reviewed-on: https://go-review.googlesource.com/8480Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Josh Bleecher Snyder authored
The tests in doc/progs appear to have been originally written for use with the old test driver. At some later point, they acquired their own test driver. Both ran tests in serial. This CL rewrites the current test driver in Go, runs tests concurrently, and cleans up historical artifacts from the old drivers. The primary motivation is to speed up all.bash. On my laptop, using tip, this CL reduces doc/progs test wall time from 26s to 7s. The savings will remain even when the compiler gets faster. Using Go 1.4, this CL reduces test wall time from 15s to 4s. Change-Id: Iae945a8490222beee76e8a2118a0d7956092f543 Reviewed-on: https://go-review.googlesource.com/8410Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Hudson-Doyle authored
A quick pass through link.go, mostly removing fields that are not used on the "creating a single object file" side of the fence. Change-Id: I35ba41378c2c418f7df2f2f88dce65bc64a1a45d Reviewed-on: https://go-review.googlesource.com/7672 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
Bison includes suggestions about what tokens are expected in the current state when there's only four or fewer of them. For example: syntax error: unexpected literal 2.01, expecting semicolon or newline or } This CL adds the same functionality to cmd/yacc, which fully restores the previous error message behavior from Go 1.4. Updates #9968. Change-Id: I2c1a1677c6d829a829d812c05e8813aa8829d09c Reviewed-on: https://go-review.googlesource.com/8494 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
- 06 Apr, 2015 12 commits
-
-
Josh Bleecher Snyder authored
Change-Id: Idd42e0f5c6ed55be2e153ac83022439e5272c1a7 Reviewed-on: https://go-review.googlesource.com/8444Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
David Crawshaw authored
At the moment this function does nothing, runtime initialization is still done in android.c:init_go_runtime. Fixes #10358 Change-Id: I1d762383ba61efcbcf0bbc7c77895f5c1dbf8968 Reviewed-on: https://go-review.googlesource.com/8510Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
-
Rob Pike authored
decBuffer.Drop is called using data provided by the user, don't panic if it's bogus. Fixes #10272. Change-Id: I913ae9c3c45cef509f2b8eb02d1efa87fbd52afa Reviewed-on: https://go-review.googlesource.com/8496Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Austin Clements authored
When the gctrace GODEBUG option is enabled, it will now report three heap sizes: the heap size at the beginning of the GC cycle, the heap size at the end of the GC cycle before sweeping, and marked heap size, which is the amount of heap that will be retained until the next GC cycle. Change-Id: Ie13f8a6d5c609bc9cc47c7555960ab55b37b5f1c Reviewed-on: https://go-review.googlesource.com/8430Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
In the STW collector, next_gc was both the heap size to trigger GC at as well as the goal heap size. Early in the concurrent collector's development, next_gc was the goal heap size, but was also used as the heap size to trigger GC at. This meant we always overshot the goal because of allocation during concurrent GC. Currently, next_gc is still the goal heap size, but we trigger concurrent GC at 7/8*GOGC heap growth. This complicates shouldtriggergc, but was necessary because of the incremental maintenance of next_gc. Now we simply compute next_gc for the next cycle during mark termination. Hence, it's now easy to take the simpler route and redefine next_gc as the heap size at which the next GC triggers. We can directly compute this with the 7/8 backoff during mark termination and shouldtriggergc can simply test if the live heap size has grown over the next_gc trigger. This will also simplify later changes once we start setting next_gc in more sophisticated ways. Change-Id: I872be4ae06b4f7a0d7f7967360a054bd36b90eea Reviewed-on: https://go-review.googlesource.com/8420Reviewed-by: Russ Cox <rsc@golang.org>
-
Austin Clements authored
Currently there are two main consumers of memstats.heap_alloc: updatememstats (aka ReadMemStats) and shouldtriggergc. updatememstats recomputes heap_alloc from the ground up, so we don't need to keep heap_alloc up to date for it. shouldtriggergc wants to know how many bytes were marked by the previous GC plus how many bytes have been allocated since then, but this *isn't* what heap_alloc tracks. heap_alloc also includes objects that are not marked and haven't yet been swept. Introduce a new memstat called heap_live that actually tracks what shouldtriggergc wants to know and stop keeping heap_alloc up to date. Unlike heap_alloc, heap_live follows a simple sawtooth that drops during each mark termination and increases monotonically between GCs. heap_alloc, on the other hand, has much more complicated behavior: it may drop during sweep termination, slowly decreases from background sweeping between GCs, is roughly unaffected by allocation as long as there are unswept spans (because we sweep and allocate at the same rate), and may go up after background sweeping is done depending on the GC trigger. heap_live simplifies computing next_gc and using it to figure out when to trigger garbage collection. Currently, we guess next_gc at the end of a cycle and update it as we sweep and get a better idea of how much heap was marked. Now, since we're directly tracking how much heap is marked, we can directly compute next_gc. This also corrects bugs that could cause us to trigger GC early. Currently, in any case where sweep termination actually finds spans to sweep, heap_alloc is an overestimation of live heap, so we'll trigger GC too early. heap_live, on the other hand, is unaffected by sweeping. Change-Id: I1f96807b6ed60d4156e8173a8e68745ffc742388 Reviewed-on: https://go-review.googlesource.com/8389Reviewed-by: Russ Cox <rsc@golang.org>
-
Austin Clements authored
This tracks the number of heap bytes marked by a GC cycle. We'll use this information to precisely trigger the next GC cycle. Currently this aggregates the work counter in gcWork and dispose atomically aggregates this into a global work counter. dispose happens relatively infrequently, so the contention on the global counter should be low. If this turns out to be an issue, we can reduce the number of disposes, and if it's still a problem, we can switch to per-P counters. Change-Id: I1bc377cb2e802ef61c2968602b63146d52e7f5db Reviewed-on: https://go-review.googlesource.com/8388Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
It referred to the wrong architecture. Fixes #10355. Change-Id: I5b9d31c9f04f3106b93f94fa68c848b2518b128e Reviewed-on: https://go-review.googlesource.com/8495Reviewed-by: Dave Cheney <dave@cheney.net>
-
Robert Griesemer authored
This fixes the formerly extremely slow conversion of floating-point constants with large exponents (e.g., "const c = 1e1000000000" could stall the machine). Change-Id: I36e02158e3334d32b18743ec0c259fec77baa74f Reviewed-on: https://go-review.googlesource.com/8466Reviewed-by: Alan Donovan <adonovan@google.com>
-
Igor Dolzhikov authored
net/http, math/big, cmd/internal/gc/big: replaced errors.New(fmt.Sprintf(...)) in favour fmt.Errorf() Change-Id: I38fc0ab84a374cb9be0234e40665d7cea0e76fc1 Reviewed-on: https://go-review.googlesource.com/8402Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
As noted on recently on golang-nuts, there's currently no way to know the total size of a strings.Reader or bytes.Reader when using ReadAt on them. Most callers resort to wrapping it in an io.SectionReader to retain that information. The SizeReaderAt abstraction (an io.ReaderAt with a Size() int64 method) has proven useful as a way of expressing a concurrency-safe read-only number of bytes. As one example, see http://talks.golang.org/2013/oscon-dl.slide#49 and the rest of that presentation for its use in dl.google.com. SizeReaderAt is also used in the open source google-api-go-client, and within Google's internal codebase, where it exists in a public package created in 2013 with the package comment: "These may migrate to the standard library after we have enough experience with their feel." I'm still as happy with the SizeReaderAt abstraction and its composabilty as I was in 2013, so I'd like to make these two Readers also be SizeReaderAts. Fixes #9667 Change-Id: Ie6f145ada419dd116280472d8c029f046d5edf70 Reviewed-on: https://go-review.googlesource.com/3199Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Paul Marks authored
Now, only a zero deadline is interpreted as noDeadline. Any other time in the past yields an immediate timeout. TestConnectDeadlineInThePast already covers this case. We just need to un-skip it for plan9, where dialChannel is used. Change-Id: I995fd1a632c31f8004dac772c3d7c43a2a5853b0 Reviewed-on: https://go-review.googlesource.com/8435Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
-
- 04 Apr, 2015 5 commits
-
-
Josh Bleecher Snyder authored
The the has been deleted. Change-Id: I4290105435d4f1fd10c7014f913a3147ddeb3c2b Reviewed-on: https://go-review.googlesource.com/8469Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
Previously, a production rule like A: B C D would cause yacc to check that A and B have the same declared types, but then it would generate an implicit action of { $$ = $3 } (i.e., copy the value from D), even if A and D have different types. Fixes #10192. Change-Id: I51cfd7baa0011557141dca33b7af1d892cc6f49e Reviewed-on: https://go-review.googlesource.com/7780Reviewed-by: Russ Cox <rsc@golang.org>
-
Adam Langley authored
This is a follow on to 28f33b4a which removes one of the boolean flags and adds a test for the key-driven cipher selection. Change-Id: If2a400de807eb19110352912a9f467491cc8986c Reviewed-on: https://go-review.googlesource.com/8428Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Adam Langley <agl@golang.org> Reviewed-by: Jacob Haven <jacob@cloudflare.com>
-
Michael Hudson-Doyle authored
I wrote some code that added a function in gentext() by sticking it after Ctxt.Etextp and was very confused when this wasn't written out sometimes. It turned out that Etextp was not updated by deadcode() so if the last function is not reachable, my new function was never seen. This changes deadcode() to update Etextp to the last reachable funtion. Change-Id: Ib6a3e7c67ccfb8a15826ce9e0ef046732b5e25d2 Reviewed-on: https://go-review.googlesource.com/8233Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Robert Griesemer authored
Change-Id: Ic2d9fdae43d18255c198ae62376212bdc89b75da Reviewed-on: https://go-review.googlesource.com/8464Reviewed-by: Alan Donovan <adonovan@google.com>
-
- 03 Apr, 2015 15 commits
-
-
Rob Pike authored
Change-Id: I8e2177ffdb4b75e7f3687109311306fc02fcc8e3 Reviewed-on: https://go-review.googlesource.com/8468Reviewed-by: Rob Pike <r@golang.org>
-
Cristian Staretu authored
Obtaining the actual size of the underlying storage of the buffer can be very useful in various scenarios. Long running programs which write and read large amounts of data to buffers might have to recycle buffers in order to avoid holding onto potentially huge buffers. For example, a piece of code which buffers a lot of data in a buffer might need to release the big buffer and start again with a smaller buffer after it finished processing the huge amount of data. In cases where pools of bytes.Buffer are used, being able to check the size of the allocated data can be very useful. Instead of forking bytes.Buffer or writing new code, we can export the Cap() method. Change-Id: I79d4f0a3cff53b9419d82c8122964761e9e38566 Reviewed-on: https://go-review.googlesource.com/8342Reviewed-by: Rob Pike <r@golang.org>
-
Shenghou Ma authored
benchmark old ns/op new ns/op delta BenchmarkSqrt 474 16.5 -96.52% BenchmarkSqrtIndirect 476 38.1 -92.00% BenchmarkSqrtGo 484 483 -0.21% Change-Id: I5ad0132feda0d3275a884523b9e79d83db4fc726 Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/8465Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Shenghou Ma authored
Change-Id: Iab3f5538c135a21e071789e2c7b445b0a04a2ad0 Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/8461 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Rob Pike authored
Add one option, which is the motivating example, a way to control what happens when a map is indexed with a key that is not in the map. Rather than do something specific for that case, we provide a simple general option mechanism to avoid adding API if something else comes up. This general approach also makes it easy for html/template to track (and adapt, should that become important). New method: Option(option string...). The option strings are key=value pairs or just simple strings (no =). New option: missingkey: Control the behavior during execution if a map is indexed with a key that is not present in the map. "missingkey=default" or "missingkey=invalid" The default behavior: Do nothing and continue execution. If printed, the result of the index operation is the string "<no value>". "missingkey=zero" The operation returns the zero value for the map type's element. "missingkey=error" Execution stops immediately with an error. Fixes #6288. Change-Id: Id811e2b99dc05aff324d517faac113ef3c25293a Reviewed-on: https://go-review.googlesource.com/8462Reviewed-by: Robert Griesemer <gri@golang.org>
-
Matthew Dempsky authored
This CL extends cmd/yacc to expose a yyErrorVerbose variable that changes the error messages from just "syntax error" to "syntax error: unexpected ${tokname}". It also moves the yyToknames table generation to after rules have been processed so that entries can be generated for tokens that aren't mentioned in the preamble (e.g., '.' in the case of go.y). Lastly, it restores gc's old code for applying yytfix to yyToknames, except that substituting "LLITERAL" with litbuf happens in Yyerror. Fixes #9968. Change-Id: Icec188d11fdabc1dae31b8a471c35b5c7f6deec7 Reviewed-on: https://go-review.googlesource.com/8432Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Aside from removing the superfluous comment near syms, this diff is entirely mechanically generated via Emacs's query-replace-regexp to replace "^\tstruct {\n[^}]*}" with "\t". Change-Id: Ide7e4b5995f6a121b3f57415e033933ac5c7431a Reviewed-on: https://go-review.googlesource.com/8427Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Russ Cox <rsc@golang.org>
-
Josh Bleecher Snyder authored
Fixes #10334 Change-Id: I468230870ca2afc691ce879707dac34e513e1b9e Reviewed-on: https://go-review.googlesource.com/8442Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
David Crawshaw authored
These registers are not available for programs to use. Prior to this change, the compiler would crash attempting to use ZR as a general purpose register. Other programs would compile but on execution would overwrite the G register and cause havoc. Fixes linux/arm64 build. Fixes #10304 Fixes #10320 Change-Id: I5cf51d3b77cfe3db7dd6377324950cafb02f8d8b Reviewed-on: https://go-review.googlesource.com/8456Reviewed-by: Minux Ma <minux@golang.org>
-
Robert Griesemer authored
The original implementation used 16 int "words" but only 29 bits per word for a total of 16*29 = 464 bits, with a space consumption of 16*64 = 1024 bits on a 64 bit machine. Switching to 512 bits increases precision while still using (in the worst case) half the amount of memory per mp value on a 64 bit machine. Also: Decreased permitted number of least-significant mantissa bits which may be incorrect when considering if a precise floating-point constant is an integer from 29 to 16 bits. Change-Id: Iee9287056f0e9aa4f06ceac0724ff4674f710c53 Reviewed-on: https://go-review.googlesource.com/8429Reviewed-by: Russ Cox <rsc@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I035e6f1cd159644db5eeef83056b9c34c401e60f Reviewed-on: https://go-review.googlesource.com/8441Reviewed-by: Robert Griesemer <gri@golang.org>
-
Russ Cox authored
I first prototyped this change in Sept 2011, and I discarded it because it made no difference in the obvious benchmark loop. It still makes no difference in the obvious benchmark loop, but in a less obvious one, doing some extra computation around the calls to Sqrt, not making the call does have a significant effect. benchmark old ns/op new ns/op delta BenchmarkSqrt 4.56 4.57 +0.22% BenchmarkSqrtIndirect 4.56 4.56 +0.00% BenchmarkSqrtGo 69.4 69.4 +0.00% BenchmarkSqrtPrime 4417 3647 -17.43% This is a warmup for using hardware expansions for some calls to 1-line assembly routines in the runtime (for example getg). Change-Id: Ie66be23f8c09d0f7dc4ddd7ca8a93cfce28f55a4 Reviewed-on: https://go-review.googlesource.com/8356Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Followup to CL 7728. Change-Id: Ibb0fed7816aab459a94720b139a7737fad65bea2 Reviewed-on: https://go-review.googlesource.com/8425Reviewed-by: Austin Clements <austin@google.com>
-
Shenghou Ma authored
No test cases yet, but I found this while double checking the proginfo table. Change-Id: Ib59675c117c676c1298bcab8765ca6a8fd234de8 Reviewed-on: https://go-review.googlesource.com/8431Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
-
Ian Lance Taylor authored
I guess we need more builders. Change-Id: I309e3df7608b9eef9339196fdc50dedf5f9422e4 Reviewed-on: https://go-review.googlesource.com/8434Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-