An error occurred fetching the project authors.
- 01 Apr, 2015 2 commits
-
-
Josh Bleecher Snyder authored
Nodes dominate gc's memory usage, but many fields are only used for a subset of kinds of nodes. This change pulls out fields used only for func-like Nodes. This reduces the size of the Node struct on a 64-bit machine from 504 bytes to 416 bytes (-17%). Compiling the runtime, 1.5% of nodes have a non-nil Func. In html/template, 2.7% of nodes have a non-nil Func. This change introduces an extra alloc and associated GC overhead when Func is non-nil. However, when Func is nil, as it almost always is, it spares the garbage collector scanning some Node fields. Empirically, this change appears to be roughly neutral with regard to GC. To keep the diff readable, this CL uses an embedded Func field. A subsequent CL will unembed the field. Passes toolstash -cmp. Change-Id: Ide86aa954b097fb8e6154f0811d3691497477004 Reviewed-on: https://go-review.googlesource.com/7360Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
The c2go translation left a lot of case expressions on separate lines. Merge expressions onto single lines subject to these constraints: * Max 4 clauses, all literals or names * Don't move expressions with comments The change was created by running http://play.golang.org/p/yHajs72h-g: $ mergecase cmd/internal/{ld,gc,obj}/*.go cmd/internal/obj/*/*.go Passes toolstash -cmp. Change-Id: Iba41b390d302e5486e5dc6ba7599a92270676556 Reviewed-on: https://go-review.googlesource.com/7593Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
- 19 Mar, 2015 3 commits
-
-
Russ Cox authored
This reverts commit 42fcc6fe. Change-Id: If860b7cbff5b5d288c1df1405c1765275dfba7cb Reviewed-on: https://go-review.googlesource.com/7860Reviewed-by:
Russ Cox <rsc@golang.org>
-
Josh Bleecher Snyder authored
This is a follow-up to review comments on CL 7696. I believe that this includes the first regular Go test in the compiler. No functional changes. Passes toolstash -cmp. Change-Id: Id45f51aa664c5d52ece2a61cd7d8417159ce3cf0 Reviewed-on: https://go-review.googlesource.com/7820Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
This is preliminary cleanup for another change. No functional changes. Passes toolstash -cmp. Change-Id: I11d562fbd6cba5c48d9636f3149e210e5f5308ad Reviewed-on: https://go-review.googlesource.com/7696Reviewed-by:
Keith Randall <khr@golang.org> Reviewed-by:
Minux Ma <minux@golang.org>
-
- 17 Mar, 2015 3 commits
-
-
Russ Cox authored
Change-Id: Iaf5a7d25e6308b32c17a38afbbd46befa17aa3a4 Reviewed-on: https://go-review.googlesource.com/7629Reviewed-by:
Rob Pike <r@golang.org>
-
Russ Cox authored
These were introduced during C -> Go translation when the loop increment contained multiple statements. Change-Id: Ic8abd8dcb3308851a1f7024de00711f0f984e684 Reviewed-on: https://go-review.googlesource.com/7627Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
Rob Pike <r@golang.org>
-
Russ Cox authored
Substituting in multiple passes meant walking the type multiple times, and worse, if a complex type was substituted in an early pass, later passes would follow it, possibly recursively, until hitting the depth 10 limit. Change-Id: Ie61d6ec08438e297baabe932afe33d08f358e55f Reviewed-on: https://go-review.googlesource.com/7625Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by:
Rob Pike <r@golang.org>
-
- 13 Mar, 2015 1 commit
-
-
Matthew Dempsky authored
namebuf was a global char buffer in the C version of gc, which was useful for providing common storage for constructing symbol and file names. However, now that it's just a global Go string and the string data is dynamically allocated anyway, it doesn't serve any purpose except to force extra write barriers everytime it's assigned to. Also, introduce Lookupf(fmt, args...) as shorthand for Lookup(fmt.Sprintf(fmt, args...)), which was a very common pattern for using namebuf. Passes "go build -toolexec 'toolstash -cmp' -a std". Notably, this CL shrinks 6g's text section by ~15kB: $ size toolstash/6g tool/linux_amd64/6g text data bss dec hex filename 4600805 605968 342988 5549761 54aec1 toolstash/6g 4585547 605968 342956 5534471 547307 tool/linux_amd64/6g Change-Id: I98abb44fc7f43a2e2e48425cc9f215cd0be37442 Reviewed-on: https://go-review.googlesource.com/7080Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 11 Mar, 2015 1 commit
-
-
Dave Cheney authored
More cleanups to gc.Node - make Node.Local a boolean - make Type.Local a boolean - reduce the size of Node.Esc to a uint8 Reducing the size of Node.Esc shaves ~45mb off the RSS compiling cmd/internal/gc on amd64 before: Maximum resident set size (kbytes): 659496 after: Maximum resident set size (kbytes): 612196 - declare gc.Funcdepth as int32 - declare Node.Funcdepth as int32 In both cases, these were previously machine specific int types. This doesn't result in any memory saving at the moment due to struct padding. Change-Id: Iabef8da15e962fe8b79d7fd3d402fb26ce7ec31c Reviewed-on: https://go-review.googlesource.com/7261Reviewed-by:
Keith Randall <khr@golang.org> Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 09 Mar, 2015 2 commits
-
-
Dave Cheney authored
Convert Node.Isddd to a boolean and simplify usage. - Node.Isddd converted to bool - Type.Isddd converted to bool - mkinlcall converted to take isddd as a bool - typecheckaste converted to take isddd as a bool - ascompatte converted to take isddd as a bool Change-Id: I52586145619c44182bb0c2c5d80a0a3fe3e50a07 Reviewed-on: https://go-review.googlesource.com/7172Reviewed-by:
Keith Randall <khr@golang.org>
-
Dave Cheney authored
More Node cleanups, these ones touch go.y. - convert Node.Implicit to bool - convert Node.Used to bool Change-Id: I85c7ff9e66cee7122b560adedc995166c874f2f2 Reviewed-on: https://go-review.googlesource.com/7124Reviewed-by:
Keith Randall <khr@golang.org>
-
- 06 Mar, 2015 2 commits
-
-
Dave Cheney authored
- make paramoutheap return a bool - convert Node.Assigned to a bool - convert Node.Captured to a bool - convert Node.Byval to a bool - convert Node.Dupok to a bool - convert Node.Wrapper to a bool - convert Node.Reslice to a bool Change-Id: I5b57c019f936c31d53db4db14459fb2b0aa72305 Reviewed-on: https://go-review.googlesource.com/7030Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Dave Cheney <dave@cheney.net>
-
Dave Cheney authored
Node.Addrtaken is treated as a bool, so make it a bool. I'll start to batch these changes if they are simple. Change-Id: I02a3d1131efc4e12b78b83372c1b50f8b160c194 Reviewed-on: https://go-review.googlesource.com/6911Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 05 Mar, 2015 2 commits
-
-
Matthew Dempsky authored
Note: for simplicity, this CL changes the identifiers assigned to gclocals.* objects; e.g., on amd64, gclocals.ABCDEFGHIJKLMNOP is now gclocals.HGFEDCBAPONMLKJI. However, since Go requires all packages to be built with the same toolchain version anyway, this should be a non-issue. Similarly, type hashes change somewhat, but don't seem to be exposed to users in any detectable manner. Change-Id: Iadb3bce472af9b022b88d52b3c4c5e4113cda330 Reviewed-on: https://go-review.googlesource.com/6232Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Keith Randall <khr@golang.org>
-
Russ Cox authored
Minor comments added. More to come. Change-Id: I97511db54d59e1009ef934da38f306a2dc83a6e9 Reviewed-on: https://go-review.googlesource.com/6898Reviewed-by:
Rob Pike <r@golang.org>
-
- 03 Mar, 2015 4 commits
-
-
Russ Cox authored
The C version of the compiler had just one hash table, indexed by a (name string, pkg *Pkg) pair. Because we always know the pkg during a lookup, replace the one table with a per-Pkg map[string]*Sym. This also lets us do non-allocating []byte key lookups. This CL *does* change the generated object files. In the old code, export data and init calls were emitted in "hash table order". Now they are emitted in the order in which they were added to the table. Change-Id: I5a48d5c9add996dc43ad04a905641d901522de0b Reviewed-on: https://go-review.googlesource.com/6600Reviewed-by:
Rob Pike <r@golang.org>
-
Russ Cox authored
Strlit was just a poor excuse for a Go string. Use a Go string. In the one case where it was a string-or-nil (Type.Note), use a *string. Zconv was a poor excuse for %q. Use %q. The only important part about Zconv's implementation was that the compiler and linker agreed on the quoting rules. Now they both use %q instead of having two Zconvs. This CL *does* change the generated object files, because the quoted strings end up in symbol names. For example the string "\r\n" used to be named go.string."\r\n" and is now go.string."\x0d\n". Change-Id: I5c0d38e1570ffc495f0db1a20273c9564104a7e8 Reviewed-on: https://go-review.googlesource.com/6519Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Rob Pike <r@golang.org>
-
Russ Cox authored
Run rsc.io/grind rev 796d0f2 on C->Go conversions. This replaces various awkward := initializations with plain var declarations. Checked bit-for-bit compatibility with toolstash + buildall. Change-Id: I601101d8177894adb9b0e3fb55dfe0ed4f544716 Reviewed-on: https://go-review.googlesource.com/6517Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
No functional changes. This diff was generated as follows: * Manually edit cmd/internal/gc/go.go to update types and group variables. * Manually edit initialization in cmd/internal/gc/align.go--localized s/1/true. * Manually fix the handling of sign in cmd/internal/gc/walk.go in func bounded (near line 4000). * Manually update go.y and regenerate y.go. * Run gofmt -r many times to do the rest, using https://gist.github.com/josharian/0f61dbb2dff81f938e70. toolstash -cmp on the stdlib comes back green. Change-Id: I19766ed551714e51b325133e7138818d117b3a9a Reviewed-on: https://go-review.googlesource.com/6530Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 02 Mar, 2015 1 commit
-
-
Russ Cox authored
Run rsc.io/grind rev a26569f on C->Go conversions. The new change in grind is the inlining of goto targets. If code says 'goto x' and the block starting at label x is unreachable except through that goto and the code can be moved to where the goto is without changing the meaning of its variable names, grind does that move. Simlarly, a goto to a plain return statement turns into that return statement (even if there are other paths to the return statement). Combined, these remove many long-distance gotos, which in turn makes it possible to reduce the scope of more variable declarations. (Because gotos can't jump across declarations, the gotos were keeping the declarations from moving.) Checked bit-for-bit compatibility with toolstash + buildall. Reduces compiler runtime in html/template by about 12%. Change-Id: Id727c0bd7763a61aa22f3daa00aeb8fccbc057a3 Reviewed-on: https://go-review.googlesource.com/6472Reviewed-by:
Aram Hăvărneanu <aram@mgk.ro> Reviewed-by:
Dmitry Vyukov <dvyukov@google.com>
-
- 28 Feb, 2015 1 commit
-
-
Josh Bleecher Snyder authored
This is a follow-up to CL 6265. No behavior changes. The diff was generated with eg, using template: package p import "fmt" func before(a string) string { return fmt.Sprintf(a) } func after(a string) string { return a } Change-Id: I7b3bebf31be5cd1ae2233da06cb4502a3d73f092 Reviewed-on: https://go-review.googlesource.com/6269Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 26 Feb, 2015 2 commits
-
-
Russ Cox authored
Change-Id: Ifc4b25fa57d0c9242968246d2193aa29f6b87700 Reviewed-on: https://go-review.googlesource.com/5950Reviewed-by:
Austin Clements <austin@google.com>
-
Josh Bleecher Snyder authored
The first call is pointless. It appears to simply be a mistake. benchmark old ns/op new ns/op delta BenchmarkComplexAlgMap 90.7 76.1 -16.10% Change-Id: Id0194c9f09cea8b68f17b2ac751a8e3240e47f19 Reviewed-on: https://go-review.googlesource.com/5284Reviewed-by:
Keith Randall <khr@golang.org>
-
- 25 Feb, 2015 1 commit
-
-
Chris Manghane authored
Fixes #9017. Change-Id: I26cb1e7d6e137ff145773169cfe2d8bd4e1b339c Reviewed-on: https://go-review.googlesource.com/1252Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Chris Manghane <cmang@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 23 Feb, 2015 2 commits
-
-
Russ Cox authored
Ran rsc.io/grind rev 6f0e601 on the source files. The cleanups move var declarations as close to the use as possible, splitting disjoint uses of the var into separate variables. They also remove dead code (especially in func sudoaddable), which helps with the var moving. There's more cleanup to come, but this alone cuts the time spent compiling html/template on my 2013 MacBook Pro from 3.1 seconds to 2.3 seconds. Change-Id: I4de499f47b1dd47a560c310bbcde6b08d425cfd6 Reviewed-on: https://go-review.googlesource.com/5637Reviewed-by:
Rob Pike <r@golang.org>
-
Russ Cox authored
Convert using rsc.io/c2go rev a97ff47. Notable changes: - %% in format string now correctly preserved - reintroduce "signal handler" to hide internal faults after errors have been printed Change-Id: Ic5a94f1c3a8015a9054e21c8969b52d964a36c45 Reviewed-on: https://go-review.googlesource.com/5633Reviewed-by:
Rob Pike <r@golang.org>
-
- 20 Feb, 2015 1 commit
-
-
Russ Cox authored
Reconvert using rsc.io/c2go rev 27b3f59. Changes to converter: - fatal does not return, so no fallthrough after fatal in switch - many more function results and variables identified as bool - simplification of negated boolean expressions Change-Id: I3bc67da5e46cb7ee613e230cf7e9533036cc870b Reviewed-on: https://go-review.googlesource.com/5171Reviewed-by:
Josh Bleecher Snyder <josharian@gmail.com>
-
- 17 Feb, 2015 1 commit
-
-
Russ Cox authored
First draft of converted Go compiler, using rsc.io/c2go rev 83d795a. Change-Id: I29f4c7010de07d2ff1947bbca9865879d83c32c3 Reviewed-on: https://go-review.googlesource.com/4851Reviewed-by:
Rob Pike <r@golang.org>
-