| 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 747e701a26112abc500069caa1f4cd3e3ea04f28..d07d5190ab480754da3971396e74e6d0b89a72d5 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/redundant_join.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
|
| @@ -64,20 +64,6 @@ class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
|
| }
|
| }
|
|
|
| - /// Removes [movedNode] from its current position and inserts it
|
| - /// before [target].
|
| - void moveToBefore(Expression target, LetCont movedNode) {
|
| - if (movedNode.parent != null) {
|
| - movedNode.parent.body = movedNode.body;
|
| - movedNode.body.parent = movedNode.parent;
|
| - }
|
| - InteriorNode parent = target.parent;
|
| - parent.body = movedNode;
|
| - movedNode.body = target;
|
| - target.parent = movedNode;
|
| - movedNode.parent = parent;
|
| - }
|
| -
|
| void rewriteBranch(Branch branch) {
|
| InteriorNode parent = getEffectiveParent(branch);
|
| if (parent is! Continuation) return;
|
| @@ -161,7 +147,8 @@ class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
|
| }
|
| }
|
| }
|
| - moveToBefore(outerLetCont, innerLetCont);
|
| + innerLetCont.remove();
|
| + innerLetCont.insertAbove(outerLetCont);
|
| }
|
|
|
| assert(branchCont.body == branch);
|
| @@ -196,9 +183,7 @@ class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
|
| branch.falseContinuation.unlink();
|
| outerLetCont.continuations.remove(branchCont);
|
| if (outerLetCont.continuations.isEmpty) {
|
| - InteriorNode parent = outerLetCont.parent;
|
| - parent.body = outerLetCont.body;
|
| - outerLetCont.body.parent = parent;
|
| + outerLetCont.remove();
|
| }
|
|
|
| // We may have created new redundant join points in the two branches.
|
|
|