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

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

Issue 1458703007: dart2js cps: Refactor CallExpressions into Primitives. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 1 month 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
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 a6017cbb0454226ec6fa6f9e4aa07b6abc4c049f..422db14ac1ace1f90c0a3d38c4695e691e328a81 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -138,8 +138,7 @@ class ShrinkingReducer extends Pass {
// Substitute the invocation argument for the continuation parameter.
for (int i = 0; i < invoke.arguments.length; i++) {
- Reference argRef = invoke.arguments[i];
- argRef.definition.substituteFor(cont.parameters[i]);
+ cont.parameters[i].replaceUsesWith(invoke.arguments[i].definition);
}
// Perform bookkeeping on substituted body and scan for new redexes.
@@ -168,7 +167,7 @@ class ShrinkingReducer extends Pass {
Continuation wrappedCont = invoke.continuation.definition;
// Replace all occurrences with the wrapped continuation.
- wrappedCont.substituteFor(cont);
+ cont.replaceUsesWith(wrappedCont);
// Perform bookkeeping on removed body and scan for new redexes.
new _RemovalVisitor(_worklist).visit(cont);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/share_interceptors.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698