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

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

Issue 1251083002: dart2js cps: Avoid deep recursion using trampolines and basic blocks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 5 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 | « pkg/compiler/lib/src/cps_ir/mutable_ssa.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/redundant_join.dart
diff --git a/pkg/compiler/lib/src/cps_ir/redundant_join.dart b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
index 92bd51b07bfd6c0aad3476909d6b0f6a51188850..2a1a584c99417c824a70033fd911bdd285fb6eac 100644
--- a/pkg/compiler/lib/src/cps_ir/redundant_join.dart
+++ b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
@@ -234,7 +234,7 @@ class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
class AlphaRenamer extends RecursiveVisitor {
Map<Parameter, Parameter> renaming = <Parameter, Parameter>{};
- visitContinuation(Continuation cont) {
+ processContinuation(Continuation cont) {
if (cont.isReturnContinuation) return;
List<Parameter> shadowedKeys = <Parameter>[];
@@ -255,16 +255,15 @@ class AlphaRenamer extends RecursiveVisitor {
}
}
- // Visit the body with the updated environment.
- visit(cont.body);
-
- // Restore the original environment.
- for (int i = 0; i < cont.parameters.length; ++i) {
- renaming.remove(cont.parameters[i]);
- if (shadowedValues[i] != null) {
- renaming[shadowedKeys[i]] = shadowedValues[i];
+ pushAction(() {
+ // Restore the original environment.
+ for (int i = 0; i < cont.parameters.length; ++i) {
+ renaming.remove(cont.parameters[i]);
+ if (shadowedValues[i] != null) {
+ renaming[shadowedKeys[i]] = shadowedValues[i];
+ }
}
- }
+ });
}
processReference(Reference ref) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/mutable_ssa.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