| Index: pkg/compiler/lib/src/cps_ir/redundant_phi.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
|
| index ae57325dff142de9c48634b8f72fb5ecd28aa61c..e678a968efcf9fee1f8ba667aa715a210a08d24f 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
|
| @@ -187,9 +187,19 @@ bool _isInScopeOf(LetCont letCont, Definition definition) {
|
| void _moveIntoScopeOf(LetCont letCont, Definition definition) {
|
| if (_isInScopeOf(letCont, definition)) return;
|
|
|
| + // Remove the continuation binding from its current spot.
|
| + InteriorNode parent = letCont.parent;
|
| + parent.body = letCont.body;
|
| + letCont.body.parent = parent;
|
| +
|
| + // Insert it just below the binding of definition.
|
| InteriorNode binding = definition.parent;
|
| - letCont.remove();
|
| - letCont.insertBelow(binding);
|
| +
|
| + letCont.body = binding.body;
|
| + binding.body.parent = letCont;
|
| +
|
| + binding.body = letCont;
|
| + letCont.parent = binding;
|
| }
|
|
|
| /// Ensures [continuation] has its own LetCont binding by creating
|
| @@ -201,7 +211,9 @@ LetCont _makeUniqueBinding(Continuation continuation) {
|
| if (letCont.continuations.length == 1) return letCont;
|
| letCont.continuations.remove(continuation);
|
| LetCont newBinding = new LetCont(continuation, letCont.body);
|
| + newBinding.body.parent = newBinding;
|
| + newBinding.parent = letCont;
|
| + letCont.body = newBinding;
|
| continuation.parent = newBinding;
|
| - newBinding.insertBelow(letCont);
|
| return newBinding;
|
| }
|
|
|