1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07:00
The Go programming language
Go to file
Alan Donovan 514bdfb1b7 go.tools/go/ssa: improve generated code for addressable expressions.
If an expression is addressable, we compute its address then load, rather than
extracting the value of subelements.  For aggregates this avoids large copies.
Example:
        var x [2]struct{y [3]int}
        print(x[1].y[2])

Was:
t0 = local [3]struct{x [5]int} (x)                 *[3]struct{x [5]int}
t1 = *t0                                            [3]struct{x [5]int}
t2 = t1[1:int]                                         struct{x [5]int}
t3 = t2.x [#0]                                                   [5]int
t4 = t3[2:int]                                                      int

Now:
t1 = &t0[1:int]                                       *struct{x [5]int}
t2 = &t1.x [#0]                                                 *[5]int
t3 = &t2[2:int]                                                    *int
t4 = *t3                                                            int

Also:
- make emitFieldSelections responsible for calling emitDebugRef, as
  one of its two calls was forgetting to do it.
- relax the specification of (*Program).VarValue because not all
  subexpressions are materalized as values now.
- fix up the objlookup.go test expectations to match.

go/ssa/interp test runs 10% faster.

Thanks to Peter Collingbourne for pointing this out.

LGTM=pcc
R=pcc, gri
CC=golang-codereviews
https://golang.org/cl/109710043
2014-07-17 15:06:09 -04:00
astutil go.tools/astutil: fix edge case in DeleteImport causing merging of import sections. 2014-05-19 14:04:30 -07:00
blog go.tools/blog: strip prefix when serving static content 2013-11-08 13:28:32 +11:00
cmd go.tools/cmd/present: move jquery ui code into static 2014-07-16 16:33:46 +10:00
container/intsets container/intsets: add benchmark of AppendTo method. 2014-06-19 14:35:37 -04:00
cover go.tools/cover: split parsing code out from cmd/cover 2013-12-03 20:55:21 -08:00
dashboard go.tools/dashboard/builder: android cross compiles 2014-07-09 15:44:17 -04:00
go go.tools/go/ssa: improve generated code for addressable expressions. 2014-07-17 15:06:09 -04:00
godoc go.tools/godoc/static: remove unnecessary mainframe wrapper 2014-07-16 09:39:11 +10:00
imports go.tools/imports: fix case where output not gofmt-compatible 2014-05-20 14:02:16 -07:00
oracle go.tools/go/loader: use new types.TypeAndValue mode predicates. 2014-07-11 10:50:09 +01:00
playground go.tools/playground/socket: fix nacl/arm command line. 2014-07-10 00:46:43 -04:00
present go.tools/present: add support for figure captions 2014-07-15 08:23:16 -07:00
refactor go.tools/go/loader: use new types.TypeAndValue mode predicates. 2014-07-11 10:50:09 +01:00
.hgignore go.tools/.hgignore: don't ignore test-generated files, clean them up. 2014-04-10 13:17:20 -04:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
codereview.cfg codereview: switch defaultcc to golang-codereviews 2013-12-20 10:54:33 -05:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README go.tools/README: minor correction. 2013-10-29 13:20:58 -04:00

This subrepository holds the source for various packages and tools that support
the Go programming language.

Some of the tools, godoc and vet for example, are included in binary Go distributions.
Others, including the Go oracle and the test coverage tool, can be fetched with "go get".

Packages include a type-checker for Go and an implementation of the
Static Single Assignment form (SSA) representation for Go programs.

To submit changes to this repository, see http://golang.org/doc/contribute.html.