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

Unified Diff: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart

Issue 1582643002: dart2js cps: Preserve parameter hints during eta and beta reductions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index 0e93623c5fb2ed92aec0b1e231ebeed56e4d7aa1..16a1d15f3665c4198bfe996ea8ea1b05e8b4c694 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -141,6 +141,7 @@ class ShrinkingReducer extends Pass {
// Substitute the invocation argument for the continuation parameter.
for (int i = 0; i < invoke.arguments.length; i++) {
cont.parameters[i].replaceUsesWith(invoke.arguments[i].definition);
+ invoke.arguments[i].definition.useElementAsHint(cont.parameters[i].hint);
Kevin Millikin (Google) 2016/01/12 20:10:05 This would be clearer if the name useElementAsHint
asgerf 2016/01/12 20:21:31 Now that we have the ??= operator maybe we should
}
// Perform bookkeeping on substituted body and scan for new redexes.
@@ -168,6 +169,10 @@ class ShrinkingReducer extends Pass {
InvokeContinuation invoke = cont.body;
Continuation wrappedCont = invoke.continuation.definition;
+ for (int i = 0; i < cont.parameters.length; ++i) {
+ wrappedCont.parameters[i].useElementAsHint(cont.parameters[i].hint);
+ }
+
// If the invocation of wrappedCont is escaping, then all invocations of
// cont will be as well, after the reduction.
if (invoke.isEscapingTry) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698