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

Issue 2981603002: Convert closures in all initializers, and share the context between them. (Closed)

Created:
3 years, 5 months ago by sjindel
Modified:
3 years, 5 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Convert closures in all initializers, and share the context between them. Summary: Previously, we only handled `FieldInitializer` and `LocalInitializer`. Now we handle all initializers. Previously, we would create separate contexts for each initializers, which was incorrect because it changes made to an argument from a closure within one initializer would not be seen by a closure within another. Now, we create the context in a `LocalInitializer` so all initializers will see the same copy of the argument variables. There is still an outstanding issue where variables introduced as local initializers and later captured by closures in subsequent initializers are not placed into the context. However, this will at least trigger an assert in the closure conversion pass. Test Plan: 'closures_initializers/initializers.dart(.expect)' has been updated with very simple test cases for super and redirecting initializers. The second bug mentioned (captured local initializers) has not been reproduced yet. BUG= R=dmitryas@google.com Committed: https://github.com/dart-lang/sdk/commit/a459f73facd32a26514e92e691eb8ab8776e3e75

Patch Set 1 #

Patch Set 2 : Fix unnecessary context bug. #

Total comments: 8

Patch Set 3 : Fix test case, review comments. #

Patch Set 4 : Change name of the argument extraction pass. #

Total comments: 13

Patch Set 5 : Review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -188 lines) Patch
A pkg/kernel/lib/transformations/argument_extraction.dart View 1 2 3 4 1 chunk +64 lines, -0 lines 0 comments Download
M pkg/kernel/lib/transformations/argument_extraction_for_redirecting.dart View 1 2 3 4 1 chunk +0 lines, -66 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/converter.dart View 1 2 4 chunks +21 lines, -73 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/info.dart View 1 2 2 chunks +12 lines, -1 line 0 comments Download
M pkg/kernel/lib/transformations/closure/rewriter.dart View 1 2 3 4 2 chunks +11 lines, -40 lines 0 comments Download
M pkg/kernel/test/closures_initializers/suite.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M pkg/kernel/testcases/closures_initializers/initializers.dart View 1 2 3 4 3 chunks +22 lines, -5 lines 0 comments Download
M pkg/kernel/testcases/closures_initializers/initializers.dart.expect View 1 2 3 chunks +23 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (4 generated)
sjindel
3 years, 5 months ago (2017-07-12 11:16:05 UTC) #2
Dmitry Stefantsov
Great update! I have some small comments that I think should be resolved before landing. ...
3 years, 5 months ago (2017-07-13 07:19:54 UTC) #4
sjindel
https://codereview.chromium.org/2981603002/diff/20001/pkg/kernel/lib/transformations/closure/converter.dart File pkg/kernel/lib/transformations/closure/converter.dart (right): https://codereview.chromium.org/2981603002/diff/20001/pkg/kernel/lib/transformations/closure/converter.dart#newcode30 pkg/kernel/lib/transformations/closure/converter.dart:30: // Let, On 2017/07/13 07:19:53, Dmitry Stefantsov wrote: > ...
3 years, 5 months ago (2017-07-13 11:34:05 UTC) #5
Dmitry Stefantsov
Nice update! LGTM if you respond to some minor comments about naming and code structuring. ...
3 years, 5 months ago (2017-07-14 00:34:18 UTC) #7
sjindel
https://codereview.chromium.org/2981603002/diff/60001/pkg/kernel/lib/transformations/argument_extraction.dart File pkg/kernel/lib/transformations/argument_extraction.dart (right): https://codereview.chromium.org/2981603002/diff/60001/pkg/kernel/lib/transformations/argument_extraction.dart#newcode32 pkg/kernel/lib/transformations/argument_extraction.dart:32: class ArgumentExtractionForRedirecting extends Transformer { On 2017/07/14 00:34:17, Dmitry ...
3 years, 5 months ago (2017-07-14 08:49:45 UTC) #8
sjindel
3 years, 5 months ago (2017-07-14 08:59:25 UTC) #10
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
a459f73facd32a26514e92e691eb8ab8776e3e75 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698