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

Issue 1976213002: Adjusts dart2js backend to handle method type arguments. (Closed)

Created:
4 years, 7 months ago by eernst
Modified:
4 years, 7 months ago
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Adjusts dart2js backend to handle method type arguments. This CL has the same purpose as 1969753002, stated in the title line, but it works for checked mode execution (where 1969753002 was broken), and for usage of method type arguments in additional situations. Approach: `DartType` and subtypes have been extended with new methods to erase `MethodTypeVariableType` to `DynamicType`. This is done early (after resolution, before SsaBuilder), such that only few parts of the compiler need to deal with anything new. This approach handles method type variables in checked mode, in `new` expressions, and in function typed parameters. Finally, tests are added for the new cases, and status files updated. UPDATE: See message #10 and #12 for an updated description of the approach. R=johnniwinther@google.com Committed: https://github.com/dart-lang/sdk/commit/04e45eb634fe06c293cdb9fbd973ed2614431bed

Patch Set 1 #

Total comments: 4

Patch Set 2 : Replaced TODO(eernst) by GENERIC_METHOD, added short "global" comment on GENERIC_METHODS #

Total comments: 2

Patch Set 3 : Review response; PTAL: significant changes wrt is/as/type_expression. #

Patch Set 4 : Change method type variables to malformed types in several cases #

Patch Set 5 : Made MethodTypeVariableType malformed, eliminated malformMethodTypeVariableType #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+367 lines, -46 lines) Patch
M pkg/compiler/lib/src/commandline_options.dart View 1 1 chunk +11 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/compile_time_constants.dart View 1 2 3 4 1 chunk +9 lines, -3 lines 2 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart View 1 2 3 4 1 chunk +11 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart View 1 4 chunks +8 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/dart_types.dart View 1 2 3 4 11 chunks +106 lines, -9 lines 2 comments Download
M pkg/compiler/lib/src/diagnostics/messages.dart View 1 2 3 4 2 chunks +31 lines, -0 lines 2 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/js_backend/runtime_types.dart View 1 1 chunk +6 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/resolution/constructors.dart View 1 2 3 4 1 chunk +19 lines, -2 lines 2 comments Download
M pkg/compiler/lib/src/resolution/signatures.dart View 1 1 chunk +5 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/resolution/type_resolver.dart View 1 chunk +0 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 2 3 4 5 chunks +41 lines, -15 lines 0 comments Download
M pkg/compiler/lib/src/ssa/optimize.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/language/generic_local_functions_test.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A tests/language/generic_methods_function_type_test.dart View 1 chunk +23 lines, -0 lines 0 comments Download
A + tests/language/generic_methods_function_type_test.options View 0 chunks +-1 lines, --1 lines 0 comments Download
A tests/language/generic_methods_new_test.dart View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
A + tests/language/generic_methods_new_test.options View 0 chunks +-1 lines, --1 lines 0 comments Download
A tests/language/generic_methods_type_expression_test.dart View 1 2 3 4 1 chunk +52 lines, -0 lines 0 comments Download
A + tests/language/generic_methods_type_expression_test.options View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
M tests/language/language.status View 2 chunks +4 lines, -0 lines 0 comments Download
M tests/language/language_analyzer2.status View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (5 generated)
eernst
Johnni and Karl: Both of you gave input to this, so you may wish to ...
4 years, 7 months ago (2016-05-13 16:34:06 UTC) #2
floitsch
DBC high level comment. I wouldn't add `TODO(eernst)` for changes that will be needed when ...
4 years, 7 months ago (2016-05-13 17:59:59 UTC) #4
eernst
Changed 'TODO(eernst)' to 'GENERIC_METHODS' to mark comments about things that need to be done for ...
4 years, 7 months ago (2016-05-17 09:51:30 UTC) #5
Johnni Winther
lgtm https://codereview.chromium.org/1976213002/diff/1/pkg/compiler/lib/src/dart_types.dart File pkg/compiler/lib/src/dart_types.dart (right): https://codereview.chromium.org/1976213002/diff/1/pkg/compiler/lib/src/dart_types.dart#newcode530 pkg/compiler/lib/src/dart_types.dart:530: DartType get eraseMethodTypeVariableType { Move this to GenericType ...
4 years, 7 months ago (2016-05-17 10:27:05 UTC) #6
eernst
PTAL: The updates needed in order to handle `is`, `as`, and type expressions (e.g., `Type ...
4 years, 7 months ago (2016-05-17 14:48:54 UTC) #7
karlklose
DBC https://codereview.chromium.org/1976213002/diff/20001/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart File pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart (right): https://codereview.chromium.org/1976213002/diff/20001/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart#newcode498 pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart:498: // GENERIC_METHODS: In order to support generic methods ...
4 years, 7 months ago (2016-05-18 06:40:59 UTC) #8
floitsch
On 2016/05/18 06:40:59, karlklose wrote: > DBC > > https://codereview.chromium.org/1976213002/diff/20001/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart > File pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart (right): > ...
4 years, 7 months ago (2016-05-18 09:47:27 UTC) #9
eernst
PTAL. This CL makes several changes in order to ensure that method type variables behave ...
4 years, 7 months ago (2016-05-19 08:34:18 UTC) #10
eernst
PTAL, significant changes again. This CL changes `MethodTypeVariableType` to have a true `isMalformed`, and adjusts ...
4 years, 7 months ago (2016-05-20 14:49:28 UTC) #12
Johnni Winther
https://codereview.chromium.org/1976213002/diff/80001/pkg/compiler/lib/src/compile_time_constants.dart File pkg/compiler/lib/src/compile_time_constants.dart (right): https://codereview.chromium.org/1976213002/diff/80001/pkg/compiler/lib/src/compile_time_constants.dart#newcode241 pkg/compiler/lib/src/compile_time_constants.dart:241: if (elementType is MalformedType) { Add a TODO for ...
4 years, 7 months ago (2016-05-23 12:50:41 UTC) #14
Johnni Winther
lgtm
4 years, 7 months ago (2016-05-23 14:16:44 UTC) #15
eernst
Updates in response to review, as discussed IRL already. https://codereview.chromium.org/1976213002/diff/20001/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart File pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart (right): https://codereview.chromium.org/1976213002/diff/20001/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart#newcode498 pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart:498: ...
4 years, 7 months ago (2016-05-23 14:30:24 UTC) #16
eernst
4 years, 7 months ago (2016-05-23 15:17:42 UTC) #18
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
04e45eb634fe06c293cdb9fbd973ed2614431bed (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698