tools/go
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
..
callgraph go/callgraph: fix asymptote trap in DeleteSyntheticNodes. 2014-05-08 14:03:06 -04:00
exact go.tools/go/types, exact: fix build for 1.2 2014-06-12 12:46:21 -07:00
gccgoimporter go.tools/go: separate interface construction from method set construction 2014-07-09 20:00:49 -07:00
gcimporter go.tools/go: separate interface construction from method set construction 2014-07-09 20:00:49 -07:00
importer go.tools/go: separate interface construction from method set construction 2014-07-09 20:00:49 -07:00
loader go.tools/go/loader: use new types.TypeAndValue mode predicates. 2014-07-11 10:50:09 +01:00
pointer go.tools/go: separate interface construction from method set construction 2014-07-09 20:00:49 -07:00
ssa go.tools/go/ssa: improve generated code for addressable expressions. 2014-07-17 15:06:09 -04:00
types go/types: permit "for range x" 2014-07-15 08:54:09 -07:00
vcs go.tools: fix various minor issues found by go vet 2014-05-19 08:47:28 -07:00