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

Issue 2812393003: dart2js: Capture typedef arguments once (Closed)

Created:
3 years, 8 months ago by sra1
Modified:
3 years, 8 months ago
Reviewers:
Emily Fortuna
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js: Capture typedef arguments once The type Map<T, Foo<Set<T>>> contains one type variable referenced twice, so there are two inputs into the HTypeInfoExpression instruction. If Foo is a typedef, T can be reused, e.g. typedef E Foo<E>(E a, E b); As the typedef is expanded (to Function(Set<T>, Set<T>) => Set<T>) it should not consume additional types from the to-level input. We prevent this by capturing the types and using the captured type expressions inside the typedef expansion. TODO: We should make the type subexpression Foo<...> be a second HTypeInfoExpression, with Set<T> as its input (a third HTypeInfoExpression). This would share all the Set<T> subexpressions instead of duplicating them. This would require HTypeInfoExpression inputs to correspond to type variables AND typedefs. BUG= https://github.com/dart-lang/sdk/issues/28749 R=efortuna@google.com Committed: https://github.com/dart-lang/sdk/commit/d15da7d9000381ed74520995d32168db389eaa9c

Patch Set 1 #

Patch Set 2 : test #

Total comments: 2

Patch Set 3 : comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -2 lines) Patch
M pkg/compiler/lib/src/js_backend/runtime_types.dart View 1 2 5 chunks +45 lines, -2 lines 0 comments Download
M pkg/js_ast/lib/src/nodes.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/js_ast/lib/src/printer.dart View 1 chunk +9 lines, -0 lines 0 comments Download
A tests/compiler/dart2js_extra/28749_test.dart View 1 1 chunk +57 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
sra1
3 years, 8 months ago (2017-04-13 03:06:50 UTC) #2
Emily Fortuna
lgtm https://codereview.chromium.org/2812393003/diff/20001/pkg/compiler/lib/src/js_backend/runtime_types.dart File pkg/compiler/lib/src/js_backend/runtime_types.dart (right): https://codereview.chromium.org/2812393003/diff/20001/pkg/compiler/lib/src/js_backend/runtime_types.dart#newcode1014 pkg/compiler/lib/src/js_backend/runtime_types.dart:1014: // First level typedef - capture arguments for ...
3 years, 8 months ago (2017-04-13 18:23:30 UTC) #3
sra1
https://codereview.chromium.org/2812393003/diff/20001/pkg/compiler/lib/src/js_backend/runtime_types.dart File pkg/compiler/lib/src/js_backend/runtime_types.dart (right): https://codereview.chromium.org/2812393003/diff/20001/pkg/compiler/lib/src/js_backend/runtime_types.dart#newcode1014 pkg/compiler/lib/src/js_backend/runtime_types.dart:1014: // First level typedef - capture arguments for re-use ...
3 years, 8 months ago (2017-04-13 19:35:40 UTC) #4
sra1
3 years, 8 months ago (2017-04-13 19:45:43 UTC) #6
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
d15da7d9000381ed74520995d32168db389eaa9c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698