- 22 Apr, 2017 2 commits
-
-
Hiroshi Ioka authored
Current implementation use EPIPE as an error for Seek on pipes. According to http://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html, it should use ESPIPE instead. Fixes #20066 Change-Id: I24c3b95be946bc19a287d6b10f447b034a9a1283 Reviewed-on: https://go-review.googlesource.com/41311Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Hiroshi Ioka authored
Change-Id: I9d399db8ac26ad44adeace3bf1e5b11cbfe3e0d3 Reviewed-on: https://go-review.googlesource.com/41313Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 21 Apr, 2017 38 commits
-
-
Mostyn Bramley-Moore authored
Hopefully the last refactoring of TestRespectGroupSticky: * Properly tested (+simplified) FreeBSD fix * Tested on Darwin (10.12.4) * Rename to TestRespectSetgidDir (I believe this is the accepted terminology) Fixes golang/go#19596. Change-Id: I8d689ac3e245846cb3f1338ea13e35be512ccb9c Reviewed-on: https://go-review.googlesource.com/41430Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I0cb2ea9ca7ec2449999af28457270ff7b3324e92 Reviewed-on: https://go-review.googlesource.com/41410 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I4a5c841eb16e05db7d923d4c3c7cd2d7695fa4af Reviewed-on: https://go-review.googlesource.com/41409 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I1a5809f15c84f9d26064a567b45468fa56e6d5e9 Reviewed-on: https://go-review.googlesource.com/41408 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I9940909949da58e780696e6de0c21f95be7a8816 Reviewed-on: https://go-review.googlesource.com/41407 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: Ic235960e85b8faeffe81dac2334c09757578a552 Reviewed-on: https://go-review.googlesource.com/41406 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I00a8200370d56772f604a099654f9d838c4f62e2 Reviewed-on: https://go-review.googlesource.com/41405 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Change a few functions so that instead of accepting a *types.Sym and calling Linksym themselves, they accept an *obj.LSym. Adapt the callsites. Passes toolstash-check. Change-Id: Ic5d3f306f2fdd3913281215a1f54d893a966bb1f Reviewed-on: https://go-review.googlesource.com/41404 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I5309125e0da65a5f240e53472b1c911252f0a472 Reviewed-on: https://go-review.googlesource.com/41403 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I0cc4fe608a50681845a92053cb3888ea127b521a Reviewed-on: https://go-review.googlesource.com/41402 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Automated refactoring using gorename, eg, and gofmt -r. Passes toolstash-check. Change-Id: Ib50f368bf62a07e5ced50b1b92a29c669ba9a158 Reviewed-on: https://go-review.googlesource.com/41401 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash-check. Change-Id: I9398dd0fd9112d907f838ea911a7724dda5bbaee Reviewed-on: https://go-review.googlesource.com/41400 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
This batch from reflect.go. Changes made manually, since they are simple, few, and typechecked by the compiler. Passes toolstash-check. Change-Id: I0030daab2dac8e7c95158678c0f7141fd90441f9 Reviewed-on: https://go-review.googlesource.com/41399 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
The only remaining uses of duintxx are in the implementation of duintNN. I hope to inline those once I figure out why CL 40864 is broken. Note that some uses of duintxx with width Widthint were converted into duintptr. I did that, since #19954 is officially going to move forward. Passes toolstash-check. Change-Id: Id25253b711ea589d0199b51be9a3c18ca1af59ce Reviewed-on: https://go-review.googlesource.com/41398 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Follow-up to previous CL. gorename -from '"cmd/compile/internal/gc".duintxxLSym' -to duintxx gorename -from '"cmd/compile/internal/gc".duint8LSym' -to duint8 gorename -from '"cmd/compile/internal/gc".duint16LSym' -to duint16 gorename -from '"cmd/compile/internal/gc".duint32LSym' -to duint32 gorename -from '"cmd/compile/internal/gc".duintptrLSym' -to duintptr gorename -from '"cmd/compile/internal/gc".dbvecLSym' -to dbvec gorename -from '"cmd/compile/internal/gc".dsnameLSym' -to dsname gorename -from '"cmd/compile/internal/gc".dsymptrLSym' -to dsymptr gorename -from '"cmd/compile/internal/gc".dsymptrOffLSym' -to dsymptrOff gorename -from '"cmd/compile/internal/gc".dsymptrWeakOffLSym' -to dsymptrWeakOff Passes toolstash-check. Change-Id: I007f57340f9e8b1468553242556ae25a71167e8c Reviewed-on: https://go-review.googlesource.com/41397 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
This is an automated refactoring to eliminate all dxxx calls in gc/obj.go that accept types.Sym instead of obj.LSym parameters. The refactoring was of the form: gorename -from '"cmd/compile/internal/gc".duintxx' -to Duintxx gorename -from '"cmd/compile/internal/gc".duintxxLSym' -to DuintxxLSym eg -t t.go -w cmd/compile/internal/gc gofmt -r 'DuintxxLSym -> duintxxLSym' -w cmd/compile/internal/gc where t.go looked like: func before(s *types.Sym, off int, v uint64, wid int) int { return gc.Duintxx(s, off, v, wid) } func after(s *types.Sym, off int, v uint64, wid int) int { return gc.DuintxxLSym(s.Linksym(), off, v, wid) } The rename/gofmt shenanigans were to work around limitations and bugs in eg and gorename. The resulting code in reflect.go looks temporarily ugly, but it makes refactoring and cleanup opportunities much clearer. Next step is to rename all the dxxx methods to rename the -LSym suffix and clean up reflect.go. The renaming is left for a separate CL to make the changes in this CL more obvious, and thus hopefully easier to review. Passes toolstash-check. Change-Id: Ib31a2b6fd146ed03a855d20ecb0433f0f74e2f10 Reviewed-on: https://go-review.googlesource.com/41396 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
- Add new BranchStmt.Target field: It's the destination for break, continue, or goto statements. - When parsing with CheckBranches enabled, set the BranchStmt.Target field. We get the information practically for free from the branch checker, so keep it for further use. - Fix a couple of comments. - This could use a test, but the new Target field is currently not used, and writing a test is tedious w/o a general tree visitor. Do it later. For now, visually verified output from syntax dump. Change-Id: Id691d89efab514ad885e19ac9759506106579520 Reviewed-on: https://go-review.googlesource.com/40988Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Cherry Zhang authored
ARM's udiv function is nosplit and it shouldn't be preemptied (passing args in registers). It is in some sense like DUFFCOPY, which we don't mark as safepoint. Change-Id: I49f7c4e69e787ac364d0b0def0661e79a0ea9e69 Reviewed-on: https://go-review.googlesource.com/41370 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Brad Fitzpatrick authored
This doesn't appear to be present on Windows Server 2012 or 2016: https://build.golang.org/log/6ea21b99c9b8a2be20f9aeaec6c425b84faf1af7 https://build.golang.org/log/2bcf04f1df003577352f4f987a39a59a081094ee Updates golang/go#17513 Updates golang/go#20073 Change-Id: I72820704b4cb16bb1720b7f6a9f2e10028c71334 Reviewed-on: https://go-review.googlesource.com/41395Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
-
Damien Lespiau authored
Currently one needs to refer to the sources to have a list of accepted debug keys. We can copy what 'ssa/help' does and introspect the list of debug keys to print a more detailed help: $ go tool compile -d help usage: -d arg[,arg]* and arg is <key>[=<value>] <key> is one of: append print information about append compilation closure print information about closure compilation disablenil disable nil checks dclstack run internal dclstack check gcprog print dump of GC programs nil print information about nil checks panic do not hide any compiler panic slice print information about slice compilation typeassert print information about type assertion inlining wb print information about write barriers export print export data pctab print named pc-value table ssa/help print help about SSA debugging <value> is key-specific. Key "pctab" supports values: "pctospadj", "pctofile", "pctoline", "pctoinline", "pctopcdata" For '-d help' to be discoverable, a hint is given in the -d flag description. A last thing, today at least one go file needs to be provided to get to the code printing ssa/help. $ go tool compile -d ssa/help foo.go Add a check so one can just do '-d help' or '-d ssa/help' Caught by trybot: I needed to update fmt_test.go as I'm introducing the usage of %-*s in a format string. Fixes #20041 Change-Id: Ib2858b038c1bcbe644aa3b1a371009710c6d957d Reviewed-on: https://go-review.googlesource.com/41091 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Keith Randall authored
The experiment "clobberdead" clobbers all pointer fields that the compiler thinks are dead, just before and after every safepoint. Useful for debugging the generation of live pointer bitmaps. Helped find the following issues: Update #15936 Update #16026 Update #16095 Update #18860 Change-Id: Id1d12f86845e3d93bae903d968b1eac61fc461f9 Reviewed-on: https://go-review.googlesource.com/23924 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
Currently TestSetGCPercent checks that NextGC is within 10 MB of the expected value. For some reason it's much noisier on some of the builders. To get these passing again, raise the threshold to 20 MB. Change-Id: I14e64025660d782d81ff0421c1eb898f416e11fe Reviewed-on: https://go-review.googlesource.com/41374 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
-
Robert Griesemer authored
More steps towards simpler symbol handling: - Pushdcl's incoming pos argument, saved in a newly pushed *Sym, was always immediately overwritten by the Lastlineno value of the saved *Sym. - Markdcl's incoming pos argument, saved in the stack mark *Sym, was not restored when the stack mark was popped. - Popdcl always maintained the most recent Lastlineno for a *Sym given by package and name, making it unnecessary to save Lastlineno in the first place. Removed Lastlineno from the set of fields that need saving, and simplified Popdcl. Change-Id: Ie93da1fbd780dcafc2703044e781c0c6298df569 Reviewed-on: https://go-review.googlesource.com/41390 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Austin Clements authored
Currently SetGCPercent forces a GC in order to recompute GC pacing. Since we can now recompute pacing on the fly using gcSetTriggerRatio, change SetGCPercent (really runtime.setGCPercent) to go through gcSetTriggerRatio and not trigger a GC. Fixes #19076. Change-Id: Ib30d7ab1bb3b55219535b9f238108f3d45a1b522 Reviewed-on: https://go-review.googlesource.com/39835 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
The current SetGCPercent test is, shall we say, minimal. Expand it to check that the GC target is actually computed and updated correctly. For #19076. Change-Id: I6e9b2ee0ef369f22f72e43b58d89e9f1e1b73b1b Reviewed-on: https://go-review.googlesource.com/39834 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
This changes gcSetTriggerRatio so it can be called even during concurrent mark or sweep. In this case, it will adjust the pacing of the current phase, accounting for progress that has already been made. To make this work for concurrent sweep, this introduces a "basis" for the pagesSwept count, much like the basis we just introduced for heap_live. This lets gcSetTriggerRatio shift the basis to the current heap_live and pagesSwept and compute a slope from there to completion. This avoids creating a discontinuity where, if the ratio has increased, there has to be a flurry of sweep activity to catch up. Instead, this creates a continuous, piece-wise linear function as adjustments are made. For #19076. Change-Id: Ibcd76aeeb81ff4814b00be7cbd3530b73bbdbba9 Reviewed-on: https://go-review.googlesource.com/39833 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
Currently, proportional sweep maintains its own count of how many bytes have been allocated since the beginning of the sweep cycle so it can compute how many pages need to be swept for a given allocation. However, this requires a somewhat complex reimbursement scheme since proportional sweep must be done before a span is allocated, but we don't know how many bytes to charge until we've allocated a span. This means that the allocated byte count used by proportional sweep can go up and down, which has led to underflow bugs in the past (#18043) and is going to interfere with adjusting sweep pacing on-the-fly (for #19076). This approach also means we're maintaining a statistic that is very closely related to heap_live, but has a different 0 value. This is particularly confusing because the sweep ratio is computed based on heap_live, so you have to understand that these two statistics are very closely related. Replace all of this and compute the sweep debt directly from the current value of heap_live. To make this work, we simply save the value of heap_live when the sweep ratio is computed to use as a "basis" for later computing the sweep debt. This eliminates the need for reimbursement as well as the code for maintaining the sweeper's version of the live heap size. For #19076. Coincidentally fixes #18043, since this eliminates sweep reimbursement entirely. Change-Id: I1f931ddd6e90c901a3972c7506874c899251dc2a Reviewed-on: https://go-review.googlesource.com/39832 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
Currently, the computations that derive controls from the GC trigger are spread across several parts of the mark termination code. Consolidate computing the absolute trigger, the heap goal, and sweep pacing into a single function called at the end of mark termination. Unlike the code being consolidated, this has to be more careful about negative gcpercent. Many of the consolidated code paths simply didn't execute if GC was off. This is a step toward being able to change the GC trigger ratio in the middle of concurrent sweeping and marking. For this commit, we try to stick close to the original structure of the code that's being consolidated, so it doesn't yet support mid-cycle adjustments. For #19076. Change-Id: Ic5335be04b96ad20e70d53d67913a86bd6b31456 Reviewed-on: https://go-review.googlesource.com/39831 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
gcController.triggerRatio is the only field in gcController that persists across cycles. As global mutable state, the places where it written and read are spread out, making it difficult to see that updates and downstream calculations are done correctly. Improve this situation by doing two things: 1) Move triggerRatio to memstats so it lives with the other trigger-related fields and makes gcController entirely transient state. 2) Commit the new trigger ratio during mark termination when we compute other next-cycle controls, including the absolute trigger. This forces us to explicitly thread the new trigger ratio from gcController.endCycle to mark termination, so we're not just pulling it out of global state. Change-Id: I6669932f8039a8c0ef46a3f2a8c537db72e578aa Reviewed-on: https://go-review.googlesource.com/39830 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Austin Clements authored
heap_live is updated atomically without locking, so we should also use atomic loads to read it. Fix the reads of heap_live that happen outside of STW to be atomic. Change-Id: Idca9451c348168c2a792a9499af349833a3c333f Reviewed-on: https://go-review.googlesource.com/41371 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Hiroshi Ioka authored
Change-Id: I0f8c695146b39cff72ca2374f861f3e9f72b0f77 Reviewed-on: https://go-review.googlesource.com/41314Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
The inliner's ishairy passes a budget and a reason down through the walk. Lift these into a visitor object and turn ishairy and its helpers into methods. This will make it easy to add more state. Change-Id: Ic6ae246e1affd67ed283c3205f9595ae33e22215 Reviewed-on: https://go-review.googlesource.com/41151 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Response to code review feedback on CL 40693. It is now only accessible by types.TypePkgLookup. Passes toolstash-check. Change-Id: I0c422c1a271f97467ae38de53af9dc33f4b31bdb Reviewed-on: https://go-review.googlesource.com/41304 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Josh Bleecher Snyder authored
Response to code review feedback on CL 40693. Remove the final reference to it from package gc, and manually unexport. Passes toolstash-check. Change-Id: I7fc48edd43263d8f7c56b47aeb7573408463dc22 Reviewed-on: https://go-review.googlesource.com/41303 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Josh Bleecher Snyder authored
Response to code review feedback on CL 40693. This CL was prepared by: (1) manually adding new implementations and the Ctxt var to package types (2) running eg with template: func before(s *types.Sym) *obj.LSym { return gc.Linksym(s) } func after(s *types.Sym) *obj.LSym { return s.Linksym() } (3) running gofmt -r: gofmt -r 'isblanksym(a) -> a.IsBlank()' (4) manually removing old implementations from package gc Passes toolstash-check. Change-Id: I39c35def7cae5bcbcc7c77253e5d2b066b981dea Reviewed-on: https://go-review.googlesource.com/41302 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Josh Bleecher Snyder authored
Per code review feedback on CL 40693. Change-Id: I38c522022a3c2f3e61ea90181391edb5c178916e Reviewed-on: https://go-review.googlesource.com/41300 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Robert Griesemer <gri@golang.org>
-
David Lazar authored
Previously, helpers were identified by entry PC, but this breaks if the helper is inlined (as in notHelperCallingHelper). Instead, identify helpers by function name (with package path). Now TestTBHelper and TestTBHelperParallel pass with -l=4. To keep the code unified, this change makes it so that the runner is also identified by function name instead of entry PC. Change-Id: I1b1987fc49d114e69d075fab56aeeacd5294982b Reviewed-on: https://go-review.googlesource.com/41257 Run-TryBot: David Lazar <lazard@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Austin Clements <austin@google.com>
-
David Lazar authored
runtime.getcaller{pc,sp} expect their argument to be a pointer to the caller's first function argument. This assumption breaks when the caller is inlined. For example, with -l=4, calls to runtime.entersyscall (which calls getcallerpc) are inlined and that breaks multiple cgo tests. This change modifies the compiler to refuse to inline functions that call runtime.getcaller{pc,sp}. Alternatively, we could mark these functions //go:noinline but that limits optimization opportunities if the calls to getcaller{pc,sp} are eliminated as dead code. Previously TestCgoPprofPIE, TestCgoPprof, and TestCgoCallbackGC failed with -l=4. Now all of the runtime tests pass with -l=4. Change-Id: I258bca9025e20fc451e673a18f862b5da1e07ae7 Reviewed-on: https://go-review.googlesource.com/40998 Run-TryBot: David Lazar <lazard@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Austin Clements <austin@google.com>
-