Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Issue 1308163006: Reduce the number of captured variables in async code, by only capturing local (Closed)

Created:
5 years, 3 months ago by regis
Modified:
5 years, 3 months ago
Reviewers:
srdjan, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Reduce the number of captured variables in async code, by only capturing local variables that are in scope at each await location. R=hausner@google.com Committed: https://github.com/dart-lang/sdk/commit/1abc4ce8e91def90e642fe7bf6ffa4668acd3c83

Patch Set 1 #

Total comments: 10

Patch Set 2 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -100 lines) Patch
M runtime/vm/ast.h View 4 chunks +18 lines, -6 lines 0 comments Download
M runtime/vm/ast_printer.cc View 1 chunk +8 lines, -3 lines 0 comments Download
M runtime/vm/ast_transformer.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/ast_transformer.cc View 1 4 chunks +10 lines, -12 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M runtime/vm/parser.cc View 1 16 chunks +20 lines, -60 lines 0 comments Download
M runtime/vm/scopes.h View 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/scopes.cc View 1 1 chunk +15 lines, -11 lines 0 comments Download
M runtime/vm/symbols.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
regis
5 years, 3 months ago (2015-09-02 20:58:04 UTC) #2
hausner
LGTM with comments. https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc#newcode49 runtime/vm/ast_transformer.cc:49: LocalScope* function_top) Rename function_top_ to async_temp_scope_ ...
5 years, 3 months ago (2015-09-02 22:07:55 UTC) #3
regis
Thanks! https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc#newcode49 runtime/vm/ast_transformer.cc:49: LocalScope* function_top) On 2015/09/02 22:07:55, hausner wrote: > ...
5 years, 3 months ago (2015-09-03 01:28:04 UTC) #4
regis
Committed patchset #2 (id:20001) manually as 1abc4ce8e91def90e642fe7bf6ffa4668acd3c83 (presubmit successful).
5 years, 3 months ago (2015-09-03 01:29:37 UTC) #5
srdjan
DBC https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc#newcode65 runtime/vm/ast_transformer.cc:65: const char* await_temp_prefix = Symbols::AwaitTempVarPrefix().ToCString(); On 2015/09/02 22:07:55, ...
5 years, 3 months ago (2015-09-03 01:50:47 UTC) #7
regis
https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc File runtime/vm/ast_transformer.cc (right): https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc#newcode65 runtime/vm/ast_transformer.cc:65: const char* await_temp_prefix = Symbols::AwaitTempVarPrefix().ToCString(); On 2015/09/03 01:50:47, srdjan ...
5 years, 3 months ago (2015-09-03 16:48:38 UTC) #8
srdjan
On 2015/09/03 16:48:38, regis wrote: > https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc > File runtime/vm/ast_transformer.cc (right): > > https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc#newcode65 > ...
5 years, 3 months ago (2015-09-03 17:37:12 UTC) #9
regis
5 years, 3 months ago (2015-09-03 17:45:44 UTC) #10
Message was sent while issue was closed.
On 2015/09/03 17:37:12, srdjan wrote:
> On 2015/09/03 16:48:38, regis wrote:
> >
>
https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer.cc
> > File runtime/vm/ast_transformer.cc (right):
> > 
> >
>
https://codereview.chromium.org/1308163006/diff/1/runtime/vm/ast_transformer....
> > runtime/vm/ast_transformer.cc:65: const char* await_temp_prefix =
> > Symbols::AwaitTempVarPrefix().ToCString();
> > On 2015/09/03 01:50:47, srdjan wrote:
> > > On 2015/09/02 22:07:55, hausner wrote:
> > > > Does it make sense to define this string constant as a symbol, yet the
> only
> > > way
> > > > we use it is to convert it to a C string to make another symbol?
> > > > 
> > > > You could do this instead:
> > > > 
> > > > symbol = String::ZoneHandle(String::NewFormatted("%d", temp_cnt_));
> > > > symbol = Symbol::FromConcat(Symbols::AwaitTempVarPrefix(), symbol);
> > > 
> > > This is problematic as it allocates a String in the new space.
> > 
> > The previous version also allocates a new string, but does not hold onto it
> > either. Shouldn't the methods of Symbols copy the input from new space to
old
> > space before returning a new Symbol?
> > Or maybe I do not understand the problem you are mentioning.
> 
> String::NewFormatted creates a String object in new space, which is a problem
> for background compilation.
> I will take care of it.

I see. You will find uses of String::NewFormatted in parser.cc as well.
Thanks for taking care of it.

Powered by Google App Engine
This is Rietveld 408576698