Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2915)

Issue 216380043: code review 216380043: compiler: Stack-allocate non-escaping variables. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 1 month ago by cmang
Modified:
9 years ago
Reviewers:
iant
CC:
iant, gofrontend-dev_googlegroups.com
Visibility:
Public.

Description

compiler: Stack-allocate non-escaping variables. This change allows variables initialized through make or new to be allocated on the stack via a temporary variable if they do not escape their function. It also improves the analysis to consider situations where variables escape in the standard library and go testsuite such as: *nested composite literals and composite literal arguments *method receivers always escaping *escape via statements in closures referring to enclosing variables *escape via calls with multiple return results

Patch Set 1 #

Patch Set 2 : diff -r 0def388e2919 https://code.google.com/p/gofrontend #

Patch Set 3 : diff -r 0def388e2919 https://code.google.com/p/gofrontend #

Patch Set 4 : diff -r 0def388e2919 https://code.google.com/p/gofrontend #

Total comments: 6

Patch Set 5 : diff -r 0def388e2919 https://code.google.com/p/gofrontend #

Total comments: 4

Patch Set 6 : diff -r 0def388e2919 https://code.google.com/p/gofrontend #

Unified diffs Side-by-side diffs Delta from patch set Stats (+452 lines, -191 lines) Patch
M go/escape.cc View 13 chunks +303 lines, -100 lines 0 comments Download
M go/expressions.h View 6 chunks +66 lines, -1 line 0 comments Download
M go/expressions.cc View 3 chunks +25 lines, -48 lines 0 comments Download
M go/gogo.h View 2 chunks +2 lines, -3 lines 0 comments Download
M go/gogo.cc View 1 chunk +1 line, -4 lines 0 comments Download
M go/statements.h View 4 chunks +54 lines, -0 lines 0 comments Download
M go/statements.cc View 1 chunk +1 line, -35 lines 0 comments Download

Messages

Total messages: 8
cmang
Hello iant@golang.org (cc: gofrontend-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/gofrontend
9 years, 1 month ago (2015-03-26 21:30:53 UTC) #1
cmang
On 2015/03/26 21:30:53, cmang wrote: > Hello mailto:iant@golang.org (cc: mailto:gofrontend-dev@googlegroups.com), > > I'd like you ...
9 years, 1 month ago (2015-03-26 21:32:33 UTC) #2
iant
https://codereview.appspot.com/216380043/diff/50001/go/escape.cc File go/escape.cc (right): https://codereview.appspot.com/216380043/diff/50001/go/escape.cc#newcode592 go/escape.cc:592: if (ce->fn()->var_expression() != NULL Just below you have if ...
9 years, 1 month ago (2015-03-26 23:42:39 UTC) #3
cmang
https://codereview.appspot.com/216380043/diff/50001/go/escape.cc File go/escape.cc (right): https://codereview.appspot.com/216380043/diff/50001/go/escape.cc#newcode592 go/escape.cc:592: if (ce->fn()->var_expression() != NULL On 2015/03/26 23:42:39, iant wrote: ...
9 years, 1 month ago (2015-03-26 23:48:55 UTC) #4
iant
Do you think this is basically ready to commit when these issues are addressed? https://codereview.appspot.com/216380043/diff/70001/go/escape.cc ...
9 years, 1 month ago (2015-03-27 21:24:47 UTC) #5
cmang
PTAL; I think this is ready to commit. https://codereview.appspot.com/216380043/diff/70001/go/escape.cc File go/escape.cc (right): https://codereview.appspot.com/216380043/diff/70001/go/escape.cc#newcode795 go/escape.cc:795: if ...
9 years ago (2015-03-31 15:04:59 UTC) #6
iant
LGTM
9 years ago (2015-03-31 17:25:39 UTC) #7
iant
9 years ago (2015-03-31 17:25:55 UTC) #8
*** Submitted as
https://code.google.com/p/gofrontend/source/detail?r=c601118c5169 ***

compiler: Stack-allocate non-escaping variables.

This change allows variables initialized through make or new
to be allocated on the stack via a temporary variable if they
do not escape their function. It also improves the analysis to
consider situations where variables escape in the standard
library and go testsuite such as:

*nested composite literals and composite literal arguments
*method receivers always escaping
*escape via statements in closures referring to enclosing variables
*escape via calls with multiple return results

LGTM=iant
R=iant
CC=gofrontend-dev
https://codereview.appspot.com/216380043

Committer: Ian Lance Taylor <iant@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b