summaryrefslogtreecommitdiff
path: root/src/cmd/compile
Commit message (Collapse)AuthorAgeFilesLines
* [dev.inline] cmd/compile: parse source files concurrentlydev.inlineMatthew Dempsky2017-01-133-69/+85
| | | | | | | | | | Conversion to Nodes still happens sequentially at the moment. Change-Id: I3407ba0711b8b92e22ece0a06fefaff863c3ccc9 Reviewed-on: https://go-review.googlesource.com/35126 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/compile: reorganize file parsing logicMatthew Dempsky2017-01-132-16/+22
| | | | | | | | | | Preparation for concurrent parsing. No behavior change. Change-Id: Ic1ec45fc3cb316778c29065cf055c82e92ffa874 Reviewed-on: https://go-review.googlesource.com/35125 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/compile: split mkpackage into separate functionsMatthew Dempsky2017-01-133-47/+49
| | | | | | | | | | | | Previously, mkpackage jumbled together three unrelated tasks: handling package declarations, clearing imports from processing previous source files, and assigning a default value to outfile. Change-Id: I1e124335768aeabfd1a6d9cc2499fbb980d951cf Reviewed-on: https://go-review.googlesource.com/35124 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/internal/obj: remove vestiges of LineHist - not used anymoreRobert Griesemer2017-01-092-12/+5
| | | | | | | | | Change-Id: I9d3fcdd5b002953fa9d2f001bf7a834073443794 Reviewed-on: https://go-review.googlesource.com/34722 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* [dev.inline] cmd/internal/src: introduce compact source position representationRobert Griesemer2017-01-0933-156/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XPos is a compact (8 instead of 16 bytes on a 64bit machine) source position representation. There is a 1:1 correspondence between each XPos and each regular Pos, translated via a global table. In some sense this brings back the LineHist, though positions can track line and column information; there is a O(1) translation between the representations (no binary search), and the translation is factored out. The size increase with the prior change is brought down again and the compiler speed is in line with the master repo (measured on the same "quiet" machine as for prior change): name old time/op new time/op delta Template 256ms ± 1% 262ms ± 2% ~ (p=0.063 n=5+4) Unicode 132ms ± 1% 135ms ± 2% ~ (p=0.063 n=5+4) GoTypes 891ms ± 1% 871ms ± 1% -2.28% (p=0.016 n=5+4) Compiler 3.84s ± 2% 3.89s ± 2% ~ (p=0.413 n=5+4) MakeBash 47.1s ± 1% 46.2s ± 2% ~ (p=0.095 n=5+5) name old user-ns/op new user-ns/op delta Template 309M ± 1% 314M ± 2% ~ (p=0.111 n=5+4) Unicode 165M ± 1% 172M ± 9% ~ (p=0.151 n=5+5) GoTypes 1.14G ± 2% 1.12G ± 1% ~ (p=0.063 n=5+4) Compiler 5.00G ± 1% 4.96G ± 1% ~ (p=0.286 n=5+4) Change-Id: Icc570cc60ab014d8d9af6976f1f961ab8828cc47 Reviewed-on: https://go-review.googlesource.com/34506 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/internal/src: replace src.Pos with syntax.PosRobert Griesemer2017-01-0920-486/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the src.Pos LineHist-based position tracking with the syntax.Pos implementation and updates all uses. The LineHist table is not used anymore - the respective code is still there but should be removed eventually. CL forthcoming. Passes toolstash -cmp when comparing to the master repo (with the exception of a couple of swapped assembly instructions, likely due to different instruction scheduling because the line-based sorting has changed; though this is won't affect correctness). The sizes of various important compiler data structures have increased significantly (see the various sizes_test.go files); this is probably the reason for an increase of compilation times (to be addressed). Here are the results of compilebench -count 5, run on a "quiet" machine (no apps running besides a terminal): name old time/op new time/op delta Template 256ms ± 1% 280ms ±15% +9.54% (p=0.008 n=5+5) Unicode 132ms ± 1% 132ms ± 1% ~ (p=0.690 n=5+5) GoTypes 891ms ± 1% 917ms ± 2% +2.88% (p=0.008 n=5+5) Compiler 3.84s ± 2% 3.99s ± 2% +3.95% (p=0.016 n=5+5) MakeBash 47.1s ± 1% 47.2s ± 2% ~ (p=0.841 n=5+5) name old user-ns/op new user-ns/op delta Template 309M ± 1% 326M ± 2% +5.18% (p=0.008 n=5+5) Unicode 165M ± 1% 168M ± 4% ~ (p=0.421 n=5+5) GoTypes 1.14G ± 2% 1.18G ± 1% +3.47% (p=0.008 n=5+5) Compiler 5.00G ± 1% 5.16G ± 1% +3.12% (p=0.008 n=5+5) Change-Id: I241c4246cdff627d7ecb95cac23060b38f9775ec Reviewed-on: https://go-review.googlesource.com/34273 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/compile/internal/syntax: add predicates to syntax.PosRobert Griesemer2016-12-102-4/+68
| | | | | | | | | | | This moves syntax.Pos closer to cmd/internal/src.Pos so that we can more easily replace src.Pos with syntax.Pos going forward. Change-Id: I9f93a65fecb4c22591edca4b9d6cda39cf0e872e Reviewed-on: https://go-review.googlesource.com/34270 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/compile/internal/syntax: add tests for //line directivesRobert Griesemer2016-12-093-11/+46
| | | | | | | | Change-Id: I77dc73bfe79e43bbadf85d7eb3c5f8990ec72023 Reviewed-on: https://go-review.googlesource.com/34248 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/compile/internal/syntax: report byte offset rather then ↵Robert Griesemer2016-12-094-72/+81
| | | | | | | | | | | | | | | rune count for column value This will only become user-visible if error messages show column information. Per the discussion in #10324. For #10324. Change-Id: I5959c1655aba74bb1a22fdc261cd728ffcfa6912 Reviewed-on: https://go-review.googlesource.com/34244 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/internal/obj: rename Prog.Lineno to Prog.PosDavid Lazar2016-12-092-5/+5
| | | | | | | | Change-Id: I7585d85907869f5a286b36936dfd035f1e8e9906 Reviewed-on: https://go-review.googlesource.com/34197 Run-TryBot: David Lazar <lazard@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
* [dev.inline] cmd/internal/obj: use src.Pos in obj.ProgDavid Lazar2016-12-092-4/+3
| | | | | | | | | | | | This will let us use the src.Pos struct to thread inlining information through to obj. Change-Id: I96a16d3531167396988df66ae70f0b729049cc82 Reviewed-on: https://go-review.googlesource.com/34195 Run-TryBot: David Lazar <lazard@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Austin Clements <austin@google.com>
* [dev.inline] cmd/compile/internal/syntax: remove gcCompat uses in scannerRobert Griesemer2016-12-093-32/+25
| | | | | | | | | | | | | - make the scanner unconditionally gc compatible - consistently use "invalid" instead "illegal" in errors Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33896/. Change-Id: I4c4253e7392f3311b0d838bbe503576c9469b203 Reviewed-on: https://go-review.googlesource.com/34237 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/compile/internal/syntax: use syntax.Pos for all external ↵Robert Griesemer2016-12-098-64/+93
| | | | | | | | | | | | | | | | | | | positions - use syntax.Pos in syntax.Error (rather than line, col) - use syntax.Pos in syntax.PragmaHandler (rather than just line) - update uses - better documentation in various places Also: - make Pos methods use Pos receiver (rather than *Pos) Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33891/. With minor adjustments to noder.go to make merge compile. Change-Id: I5507cea6c2be46a7677087c1aeb69382d31033eb Reviewed-on: https://go-review.googlesource.com/34236 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/compile/internal/syntax: clean up error and pragma handlingRobert Griesemer2016-12-094-102/+128
| | | | | | | | | | | | | | | | | | | | | | | | | Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33873/. - simplify error handling in source.go (move handling of first error into parser, where it belongs) - clean up error handling in scanner.go - move pragma and position base handling from scanner to parser where it belongs - have separate error methods in parser to avoid confusion with handlers from scanner.go and source.go - (source.go) and (scanner.go, source.go, tokens.go) may be stand-alone packages if so desired, which means these files are now less entangled and easier to maintain Change-Id: I81510fc7ef943b78eaa49092c0eab2075a05878c Reviewed-on: https://go-review.googlesource.com/34235 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/compile/internal/syntax: simplified position codeRobert Griesemer2016-12-094-66/+53
| | | | | | | | | | Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33805/. Change-Id: I859d9bd5f2256ca78f7b24b330290f7ae600854d Reviewed-on: https://go-review.googlesource.com/34234 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/compile/internal/syntax: process //line pragmas in scannerRobert Griesemer2016-12-098-43/+78
| | | | | | | | | | | | Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33764/. Minor adjustment in noder.go to make merge compile again. Change-Id: Ib5029b52b59944f207b0f2438c8a5aa576eb25b8 Reviewed-on: https://go-review.googlesource.com/34233 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* [dev.inline] cmd/compile/internal/syntax: introduce general position info ↵Robert Griesemer2016-12-0911-114/+383
| | | | | | | | | | | for nodes Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33758/. Minor adjustments in noder.go to fix merge. Change-Id: Ibe429e327c7f8554f8ac205c61ce3738013aed98 Reviewed-on: https://go-review.googlesource.com/34231 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/internal/src: introduce NoPos and use it instead Pos{}Robert Griesemer2016-12-0910-21/+21
| | | | | | | | | | | | | Using a variable instead of a composite literal makes the code independent of implementation changes of Pos. Per David Lazar's suggestion. Change-Id: I336967ac12a027c51a728a58ac6207cb5119af4a Reviewed-on: https://go-review.googlesource.com/34148 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* [dev.inline] cmd/compile/internal/ssa: another round of renames from line -> ↵Robert Griesemer2016-12-084-121/+119
| | | | | | | | | | | | pos (cleanup) Mostly mechanical renames. Make variable names consistent with use. Change-Id: Iaa89d31deab11eca6e784595b58e779ad525c8a3 Reviewed-on: https://go-review.googlesource.com/34146 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
* [dev.inline] cmd/compile/internal/ssa: rename various fields from Line to PosRobert Griesemer2016-12-0841-4383/+4383
| | | | | | | | This is a mostly mechanical rename followed by manual fixes where necessary. Change-Id: Ie5c670b133db978f15dc03e50dc2da0c80fc8842 Reviewed-on: https://go-review.googlesource.com/34137 Reviewed-by: David Lazar <lazard@golang.org>
* [dev.inline] cmd/compile: rename various fields from Lineno to PosRobert Griesemer2016-12-0828-155/+155
| | | | | | | | Various minor adjustments. Change-Id: Iedfb97989f7bedaa3e9e8993b167e05f162434a7 Reviewed-on: https://go-review.googlesource.com/34136 Reviewed-by: David Lazar <lazard@golang.org>
* [dev.inline] cmd/internal/src: make Pos implementation abstractRobert Griesemer2016-12-0835-90/+102
| | | | | | | | | | Adjust cmd/compile accordingly. This will make it easier to replace the underlying implementation. Change-Id: I33645850bb18c839b24785b6222a9e028617addb Reviewed-on: https://go-review.googlesource.com/34133 Reviewed-by: David Lazar <lazard@golang.org>
* [dev.inline] cmd/compile: introduce cmd/internal/src.Pos type for line numbersRobert Griesemer2016-12-0825-132/+169
| | | | | | | | | | | | | | This is a step toward chosing a different position representation. By introducing an explicit type, it will be easier to make the transition step-wise while ensuring everything keeps running. This has been reviewed via https://go-review.googlesource.com/#/c/34025/. Change-Id: Ibceddcd62d8f346321ac3250e3940e9c436ed684 Reviewed-on: https://go-review.googlesource.com/34132 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Lazar <lazard@golang.org>
* cmd/compile: fix static-initialization compilation failureMatthew Dempsky2016-12-061-1/+3
| | | | | | | | | | | Fixes #13263. Change-Id: Ie1cafc62b6bfe6c5381c35d9a95563267b4cc9b0 Reviewed-on: https://go-review.googlesource.com/33970 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: find last StoreWB explicitlyCherry Zhang2016-12-054-16/+82
| | | | | | | | | | | | | | | | In writebarrier phase, a chain of StoreWBs is rewritten to branchy code to invoke write barriers, and the last store in the chain is spliced into a Phi op to join the memory of the two branches. We must find the last store explicitly, since the values are not scheduled and they may not come in dependency order. Fixes #18169. Change-Id: If547e3c562ef0669bc5622c1bb711904dc36314d Reviewed-on: https://go-review.googlesource.com/33915 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
* cmd/compile/internal/syntax: remove dead type declarationRobert Griesemer2016-12-021-2/+0
| | | | | | | | Change-Id: I8a3ce0fa513ff943009c5669531132cd23ecf155 Reviewed-on: https://go-review.googlesource.com/33870 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: correctly parse //line filename:line where filename contains ':'Robert Griesemer2016-12-011-2/+3
| | | | | | | | | | | | This was a regression from 1.7. See the issue for details. Fixes #18149. Change-Id: Ic8f5a35d14edf9254b1275400316cff7aff32a27 Reviewed-on: https://go-review.googlesource.com/33799 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: generate frame pointers for otherwise frameless functionsKeith Randall2016-12-013-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | func f() { g() } We mistakenly don't add a frame pointer for f. This means f isn't seen when walking the frame pointer linked list. That matters for kernel-gathered profiles, and is an impediment for issues like #16638. To fix, allocate a stack frame even for otherwise frameless functions like f. It is a bit tricky because we need to avoid some runtime internals that really, really don't want one. No test at the moment, as only kernel CPU profiles would catch it. Tests will come with the implementation of #16638. Fixes #18103 Change-Id: I411206cc9de4c8fdd265bee2e4fa61d161ad1847 Reviewed-on: https://go-review.googlesource.com/33754 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
* cmd/compile: do not inline functions marked cgo_unsafe_argsDavid Lazar2016-12-011-0/+6
| | | | | | | | | | Now the net tests pass with -gcflags '-l=4'. Fixes #18125. Change-Id: I4e3a46eb0cb3a93b203e74f5bc99c5822331f535 Reviewed-on: https://go-review.googlesource.com/33722 Reviewed-by: Keith Randall <khr@golang.org>
* cmd/compile: generate code that type checks when inlining variadic functionsDavid Lazar2016-11-301-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug in -l=3 or higher. To inline a variadic function, the compiler generates code that constructs a slice of arguments for the variadic parameter. Consider the function func Foo(xs ...string) and the call Foo("hello", "world"). To inline the call to Foo, the compiler used to generate xs := [2]string{"hello", "world"}[:] which doesn't type check: invalid operation [2]string literal[:] (slice of unaddressable value). Now, the compiler generates xs := []string{"hello", "world"} which does type check. Fixes #18116. Change-Id: I0ee531ef2e6cc276db6fb12602b25a46d6d5db21 Reviewed-on: https://go-review.googlesource.com/33671 Reviewed-by: Keith Randall <khr@golang.org>
* cmd/compile/internal/gc: document variables and functionsKevin Burke2016-11-303-0/+10
| | | | | | Change-Id: I01b2278eb50585331b8ff7ff5e3c1f9c5ba52b63 Reviewed-on: https://go-review.googlesource.com/33156 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile/internal/syntax: remove unused node fieldRobert Griesemer2016-11-291-1/+2
| | | | | | | | | | | | The doc field is not yet used - remove it for now (we may end up with a different solution for 1.9). This reduces memory consumption for parsing all of std lib by about 40MB and makes parsing slightly faster. Change-Id: Iafb00b9c7f1be9c66fdfb29096d3da5049b2fcf5 Reviewed-on: https://go-review.googlesource.com/33661 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile: don't panic on syntax error in select statementRobert Griesemer2016-11-291-17/+12
| | | | | | | | | | Fixes #18092. Change-Id: I54e2da2e0f168c068f5e4a1b22ba508d78259168 Reviewed-on: https://go-review.googlesource.com/33658 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile, cmd/link: weak relocation for ptrToDavid Crawshaw2016-11-222-3/+16
| | | | | | | | | | | | | | | | | | | | | | | Introduce R_WEAKADDROFF, a "weak" variation of the R_ADDROFF relocation that will only reference the type described if it is in some other way reachable. Use this for the ptrToThis field in reflect type information where it is safe to do so (that is, types that don't need to be included for interface satisfaction, and types that won't cause the compiler to recursively generate an endless series of ptr-to-ptr-to-ptr-to... types). Also fix a small bug in reflect, where StructOf was not clearing the ptrToThis field of new types. Fixes #17931 Change-Id: I4d3b53cb9c916c97b3b16e367794eee142247281 Reviewed-on: https://go-review.googlesource.com/33427 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/compile: in cse, allow for new ssa valuesPhilip Hofer2016-11-181-1/+4
| | | | | | | | | | | | | | The table of rewrites in ssa/cse is not sized appropriately for ssa IDs that are created during copying of selects into new blocks. Fixes #17918 Change-Id: I65fe86c6aab5efa679aa473aadc4ee6ea882cd41 Reviewed-on: https://go-review.googlesource.com/33240 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: make a copy of Phi input if it is still liveCherry Zhang2016-11-181-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register of Phi input is allocated to the Phi. So if the Phi input is still live after Phi, we may need to use a spill. In this case, copy the Phi input to a spare register to avoid a spill. Originally targeted the code in issue #16187, and this CL indeed removes the spill, but doesn't seem to help on benchmark result. It may help in general, though. On AMD64: name old time/op new time/op delta BinaryTree17-12 2.79s ± 1% 2.76s ± 0% -1.33% (p=0.000 n=10+10) Fannkuch11-12 3.02s ± 0% 3.14s ± 0% +3.99% (p=0.000 n=10+10) FmtFprintfEmpty-12 51.2ns ± 0% 51.4ns ± 3% ~ (p=0.368 n=8+10) FmtFprintfString-12 145ns ± 0% 144ns ± 0% -0.69% (p=0.000 n=6+9) FmtFprintfInt-12 127ns ± 1% 124ns ± 1% -2.79% (p=0.000 n=10+9) FmtFprintfIntInt-12 186ns ± 0% 184ns ± 0% -1.34% (p=0.000 n=10+9) FmtFprintfPrefixedInt-12 196ns ± 0% 194ns ± 0% -0.97% (p=0.000 n=9+9) FmtFprintfFloat-12 293ns ± 2% 287ns ± 0% -2.00% (p=0.000 n=10+9) FmtManyArgs-12 847ns ± 1% 829ns ± 0% -2.17% (p=0.000 n=10+7) GobDecode-12 7.17ms ± 0% 7.18ms ± 0% ~ (p=0.123 n=10+10) GobEncode-12 6.08ms ± 1% 6.08ms ± 0% ~ (p=0.497 n=10+9) Gzip-12 277ms ± 1% 275ms ± 1% -0.47% (p=0.028 n=10+9) Gunzip-12 39.1ms ± 2% 38.2ms ± 1% -2.20% (p=0.000 n=10+9) HTTPClientServer-12 90.9µs ± 4% 87.7µs ± 2% -3.51% (p=0.001 n=9+10) JSONEncode-12 17.3ms ± 1% 16.5ms ± 0% -5.02% (p=0.000 n=9+9) JSONDecode-12 54.6ms ± 1% 54.1ms ± 0% -0.99% (p=0.000 n=9+9) Mandelbrot200-12 4.45ms ± 0% 4.45ms ± 0% -0.02% (p=0.006 n=8+9) GoParse-12 3.44ms ± 0% 3.48ms ± 1% +0.95% (p=0.000 n=10+10) RegexpMatchEasy0_32-12 84.9ns ± 0% 85.0ns ± 0% ~ (p=0.241 n=8+8) RegexpMatchEasy0_1K-12 867ns ± 3% 915ns ±11% +5.55% (p=0.037 n=10+10) RegexpMatchEasy1_32-12 82.7ns ± 5% 83.9ns ± 4% ~ (p=0.161 n=9+10) RegexpMatchEasy1_1K-12 361ns ± 1% 363ns ± 0% ~ (p=0.098 n=10+8) RegexpMatchMedium_32-12 126ns ± 0% 126ns ± 1% ~ (p=0.549 n=8+10) RegexpMatchMedium_1K-12 38.8µs ± 0% 39.1µs ± 0% +0.67% (p=0.000 n=9+8) RegexpMatchHard_32-12 1.95µs ± 0% 1.96µs ± 0% +0.43% (p=0.000 n=9+9) RegexpMatchHard_1K-12 59.0µs ± 0% 59.1µs ± 0% +0.27% (p=0.000 n=10+9) Revcomp-12 436ms ± 1% 431ms ± 1% -1.19% (p=0.005 n=10+10) Template-12 56.7ms ± 1% 57.1ms ± 1% +0.71% (p=0.001 n=10+9) TimeParse-12 312ns ± 0% 310ns ± 0% -0.80% (p=0.000 n=10+9) TimeFormat-12 336ns ± 0% 332ns ± 0% -1.19% (p=0.000 n=8+7) [Geo mean] 59.2µs 58.9µs -0.42% On PPC64: name old time/op new time/op delta BinaryTree17-2 4.67s ± 2% 4.71s ± 1% ~ (p=0.421 n=5+5) Fannkuch11-2 3.92s ± 1% 3.94s ± 0% +0.46% (p=0.032 n=5+5) FmtFprintfEmpty-2 122ns ± 0% 120ns ± 2% -1.80% (p=0.016 n=4+5) FmtFprintfString-2 305ns ± 1% 299ns ± 1% -1.84% (p=0.008 n=5+5) FmtFprintfInt-2 243ns ± 0% 241ns ± 1% -0.66% (p=0.016 n=4+5) FmtFprintfIntInt-2 361ns ± 1% 356ns ± 1% -1.49% (p=0.016 n=5+5) FmtFprintfPrefixedInt-2 355ns ± 1% 357ns ± 1% ~ (p=0.333 n=5+5) FmtFprintfFloat-2 502ns ± 2% 498ns ± 1% ~ (p=0.151 n=5+5) FmtManyArgs-2 1.55µs ± 2% 1.59µs ± 1% +2.52% (p=0.008 n=5+5) GobDecode-2 13.0ms ± 1% 13.0ms ± 1% ~ (p=0.841 n=5+5) GobEncode-2 11.8ms ± 1% 11.8ms ± 1% ~ (p=0.690 n=5+5) Gzip-2 499ms ± 1% 503ms ± 0% ~ (p=0.421 n=5+5) Gunzip-2 86.5ms ± 0% 86.4ms ± 1% ~ (p=0.841 n=5+5) HTTPClientServer-2 68.2µs ± 2% 69.6µs ± 3% ~ (p=0.151 n=5+5) JSONEncode-2 39.0ms ± 1% 37.2ms ± 1% -4.65% (p=0.008 n=5+5) JSONDecode-2 122ms ± 1% 126ms ± 1% +2.63% (p=0.008 n=5+5) Mandelbrot200-2 6.08ms ± 1% 5.89ms ± 1% -3.06% (p=0.008 n=5+5) GoParse-2 5.95ms ± 2% 5.98ms ± 1% ~ (p=0.421 n=5+5) RegexpMatchEasy0_32-2 331ns ± 1% 328ns ± 1% ~ (p=0.056 n=5+5) RegexpMatchEasy0_1K-2 1.45µs ± 0% 1.47µs ± 0% +1.13% (p=0.008 n=5+5) RegexpMatchEasy1_32-2 359ns ± 0% 353ns ± 0% -1.84% (p=0.008 n=5+5) RegexpMatchEasy1_1K-2 1.79µs ± 0% 1.81µs ± 1% +1.16% (p=0.008 n=5+5) RegexpMatchMedium_32-2 420ns ± 2% 413ns ± 0% -1.72% (p=0.008 n=5+5) RegexpMatchMedium_1K-2 70.2µs ± 1% 69.5µs ± 1% -1.09% (p=0.032 n=5+5) RegexpMatchHard_32-2 3.87µs ± 1% 3.65µs ± 0% -5.86% (p=0.008 n=5+5) RegexpMatchHard_1K-2 111µs ± 0% 105µs ± 0% -5.49% (p=0.016 n=5+4) Revcomp-2 1.00s ± 1% 1.01s ± 2% ~ (p=0.151 n=5+5) Template-2 113ms ± 1% 113ms ± 2% ~ (p=0.841 n=5+5) TimeParse-2 555ns ± 0% 550ns ± 1% -0.87% (p=0.032 n=5+5) TimeFormat-2 736ns ± 1% 704ns ± 1% -4.35% (p=0.008 n=5+5) [Geo mean] 120µs 119µs -0.77% Reduce "spilled value remains" by 0.6% in cmd/go on AMD64. Change-Id: If655df343b0f30d1a49ab1ab644f10c698b96f3e Reviewed-on: https://go-review.googlesource.com/32442 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
* cmd/compile, reflect: use field pkgPath if neededIan Lance Taylor2016-11-171-7/+12
| | | | | | | | | | | | | | | It's possible for the pkgPath of a field to be different than that of the struct type as a whole. In that case, store the field's pkgPath in the name field. Use the field's pkgPath when setting PkgPath and when checking for type identity. Fixes #17952. Change-Id: Iebaf92f0054b11427c8f6e4158c3bebcfff06f45 Reviewed-on: https://go-review.googlesource.com/33333 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
* cmd/compile: ensure necessary types appear in .debug_infoDavid Chase2016-11-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | Autotmp filtering was too aggressive and excluded types necessary to make debuggers work properly. Restore the "late filter" in dwarf.go based on names to exclude autotmps, and remove the "early filter" in pgen.go based on how the name was introduced. However, the updated naming scheme with a dot prefix is retained to prevent accidental clashes with legal Go identifier names. Includes test (grouped with runtime gdb tests), verified to fail without the fix. Updates #17644. Fixes #17830. Change-Id: I7ec3f7230083889660236e5f6bc77ba5fe434e93 Reviewed-on: https://go-review.googlesource.com/33233 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile: remove some unused codeDaniel Martí2016-11-162-40/+0
| | | | | | | | | | The use of these has been removed in recent commits. Change-Id: Iff36a3ee4dcdfe39c40e93e2601f44d3c59f7024 Reviewed-on: https://go-review.googlesource.com/33274 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/dist: add support for GOARCH=mips{,le}Vladimir Stefanovic2016-11-121-0/+3
| | | | | | | Change-Id: I6e24d22eada190e9aa2adc161be7a753c8e5054b Reviewed-on: https://go-review.googlesource.com/31514 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* all: fix vet nitsJosh Bleecher Snyder2016-11-112-4/+4
| | | | | | | | | | | | | | | | Fixes these complaints from vet: cmd/compile/internal/gc/noder.go:32: cmd/compile/internal/syntax.Error composite literal uses unkeyed fields cmd/compile/internal/gc/noder.go:1035: cmd/compile/internal/syntax.Error composite literal uses unkeyed fields cmd/compile/internal/gc/noder.go:1051: cmd/compile/internal/syntax.Error composite literal uses unkeyed fields cmd/compile/internal/syntax/parser_test.go:182: possible formatting directive in Error call net/http/client_test.go:1334: possible formatting directive in Fatal call Change-Id: I5f90ec30f3c106c7e66c92e2b6f8d3b4874fec66 Reviewed-on: https://go-review.googlesource.com/33133 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/compile/internal/syntax: fix error handling for Read/Parse callsRobert Griesemer2016-11-098-85/+126
| | | | | | | | | | | | | | | - define syntax.Error for cleaner error reporting - abort parsing after first error if no error handler is installed - make sure to always report the first error, if any - document behavior of API calls - while at it: rename ReadXXX -> ParseXXX (clearer) - adjust cmd/compile noder.go accordingly Fixes #17774. Change-Id: I7893eedea454a64acd753e32f7a8bf811ddbb03c Reviewed-on: https://go-review.googlesource.com/32950 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile: ensure that knownFormats is up to dateJosh Bleecher Snyder2016-11-091-17/+26
| | | | | | | | Change-Id: I4febdddfe5be569a8bba0a4cddf52dec7f1be1bf Reviewed-on: https://go-review.googlesource.com/32930 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: add support for GOARCH=mips{,le}Vladimir Stefanovic2016-11-084-0/+1191
| | | | | | | | Change-Id: Ib489dc847787aaab7ba1be96792f885469e346ae Reviewed-on: https://go-review.googlesource.com/31479 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* cmd/compile/internal/ssa: add support for GOARCH=mips{,le}Vladimir Stefanovic2016-11-0810-20/+12717
| | | | | | | | Change-Id: I632d4aef7295778ba5018d98bcb06a68bcf07ce1 Reviewed-on: https://go-review.googlesource.com/31478 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* cmd/go/internal/syntax: reintroduce reverted commentsRobert Griesemer2016-11-051-0/+16
| | | | | | | | | | | | These comments were originally introduced together with the changes for alias declarations, and then reverted when we backed out alias support. Reintroduce them. Change-Id: I3ef2c4f4672d6af8a900f5d73df273edf28d1a14 Reviewed-on: https://go-review.googlesource.com/32826 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* Revert "cmd/compile/internal/syntax: support for alias declarations"Robert Griesemer2016-11-056-129/+38
| | | | | | | | | | | | This reverts commit 32db3f2756324616b7c856ac9501deccc2491239. Reason: Decision to back out current alias implementation. For #16339. Change-Id: Ib05e3d96041d8347e49cae292f66bec791a1fdc8 Reviewed-on: https://go-review.googlesource.com/32825 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile: revert user-visible changes related to aliasesRobert Griesemer2016-11-041-97/+0
| | | | | | | | | | | | | | Reason: Decision to back out current alias implementation. Leaving import/export related code in place for now. For #16339. TBR=mdempsky Change-Id: Ib0897cab2c1c3dc8a541f2efb9893271b0b0efe2 Reviewed-on: https://go-review.googlesource.com/32757 Reviewed-by: Robert Griesemer <gri@golang.org>
* cmd/compile/internal/gc: add support for GOARCH=mips{,le}Vladimir Stefanovic2016-11-043-43/+164
| | | | | | | | Change-Id: Ida4cd647525abce3441bfcb9fdee059344fe717f Reviewed-on: https://go-review.googlesource.com/31477 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* cmd/compile: prevent Noalg from breaking user typesMatthew Dempsky2016-11-042-2/+8
| | | | | | | | | | | | Use a separate symbol for reflect metadata for types with Noalg set. Fixes #17752. Change-Id: Icb6cade7e3004fc4108f67df61105dc4085cd7e2 Reviewed-on: https://go-review.googlesource.com/32679 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>