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

Issue 2989563002: Preserve type variables in closure conversion. (Closed)

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

Description

Preserve type variables in closure conversion. Summary: Previously, we filled in all occurrences of captured type variables with either "dynamic" or their bound, if they had one. Now, we add extra type parameters to the top-level function corresponding to the closure, and pass in the corresponding arguments as type arguments to the "MakeClosure" operation. Test Plan: Updated [type_variables.dart] and added a new test case to it. R=dmitryas@google.com Committed: https://github.com/dart-lang/sdk/commit/4d7490c60959036b28ddd2b151a8247795261f97

Patch Set 1 #

Patch Set 2 : Update binary.md. #

Total comments: 34

Patch Set 3 : Fix closure function types. #

Patch Set 4 : Visit more children, review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+191 lines, -150 lines) Patch
M pkg/kernel/binary.md View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M pkg/kernel/lib/ast.dart View 1 2 3 3 chunks +10 lines, -5 lines 0 comments Download
M pkg/kernel/lib/binary/ast_from_binary.dart View 1 chunk +2 lines, -1 line 0 comments Download
M pkg/kernel/lib/binary/ast_to_binary.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M pkg/kernel/lib/clone.dart View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M pkg/kernel/lib/text/ast_to_text.dart View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/converter.dart View 1 2 6 chunks +34 lines, -41 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/info.dart View 1 2 3 chunks +6 lines, -2 lines 0 comments Download
M pkg/kernel/test/closures/suite.dart View 2 chunks +3 lines, -3 lines 0 comments Download
A pkg/kernel/test/closures_type_vars/closures_type_vars.status View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
A pkg/kernel/test/closures_type_vars/suite.dart View 1 chunk +19 lines, -0 lines 0 comments Download
A pkg/kernel/test/closures_type_vars/testing.json View 1 chunk +28 lines, -0 lines 0 comments Download
M pkg/kernel/testcases/closures/field.dart.expect View 2 chunks +3 lines, -3 lines 0 comments Download
M pkg/kernel/testcases/closures/instance_tear_off.dart.expect View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
D pkg/kernel/testcases/closures/type_variables.dart View 1 chunk +0 lines, -40 lines 0 comments Download
D pkg/kernel/testcases/closures/type_variables.dart.expect View 1 chunk +0 lines, -50 lines 0 comments Download
A + pkg/kernel/testcases/closures_type_vars/type_variables.dart View 2 chunks +10 lines, -0 lines 0 comments Download
A pkg/kernel/testcases/closures_type_vars/type_variables.dart.expect View 1 2 1 chunk +60 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
sjindel
3 years, 5 months ago (2017-07-24 14:44:58 UTC) #2
Dmitry Stefantsov
+Karl Karl, PTAL. I'll also leave my comments.
3 years, 5 months ago (2017-07-25 08:32:24 UTC) #5
Dmitry Stefantsov
I have some comments. Please, find them below. https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/lib/transformations/closure/converter.dart File pkg/kernel/lib/transformations/closure/converter.dart (right): https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/lib/transformations/closure/converter.dart#newcode267 pkg/kernel/lib/transformations/closure/converter.dart:267: /**** ...
3 years, 5 months ago (2017-07-25 09:13:34 UTC) #6
karlklose
https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/binary.md File pkg/kernel/binary.md (right): https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/binary.md#newcode744 pkg/kernel/binary.md:744: List<DartType> typeArgs; Please avoid abbreviations in variable names, rename ...
3 years, 5 months ago (2017-07-25 09:38:23 UTC) #7
sjindel
All prior comment threads should be resolved, except for the one started by Karl about ...
3 years, 5 months ago (2017-07-25 13:11:48 UTC) #8
Dmitry Stefantsov
LGTM if the question with visiting the reference is resolved. I also have one question ...
3 years, 4 months ago (2017-07-26 09:12:10 UTC) #9
karlklose
https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/lib/transformations/closure/info.dart File pkg/kernel/lib/transformations/closure/info.dart (right): https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/lib/transformations/closure/info.dart#newcode172 pkg/kernel/lib/transformations/closure/info.dart:172: capturedTypeVariables.where((t) => t.parent != currentFunction)); On 2017/07/26 09:12:09, Dmitry ...
3 years, 4 months ago (2017-07-26 10:36:30 UTC) #10
sjindel
https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/test/closures_type_vars/suite.dart File pkg/kernel/test/closures_type_vars/suite.dart (right): https://codereview.chromium.org/2989563002/diff/20001/pkg/kernel/test/closures_type_vars/suite.dart#newcode11 pkg/kernel/test/closures_type_vars/suite.dart:11: Future<ClosureConversionContext> createContext( On 2017/07/26 09:12:09, Dmitry Stefantsov wrote: > ...
3 years, 4 months ago (2017-07-26 10:37:45 UTC) #11
sjindel
Committed patchset #4 (id:60001) manually as 4d7490c60959036b28ddd2b151a8247795261f97 (presubmit successful).
3 years, 4 months ago (2017-07-26 10:43:11 UTC) #13
sjindel
3 years, 4 months ago (2017-07-26 11:28:58 UTC) #14
Message was sent while issue was closed.
I had to add several RuntimeError lines to the status files.

Powered by Google App Engine
This is Rietveld 408576698