Index: pkg/compiler/lib/src/cps_ir/insert_refinements.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart |
index 327cd805d1fe448bf52b07a0decccb2c7631a128..149a4b360922f430b6ead15f366d4d0ec8cb61cc 100644 |
--- a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart |
+++ b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart |
@@ -4,11 +4,6 @@ |
library cps_ir.optimization.insert_refinements; |
-import 'optimizers.dart' show Pass; |
-import 'shrinking_reductions.dart' show ParentVisitor; |
-import 'cps_ir_nodes.dart'; |
-import '../types/constants.dart'; |
-import '../constants/values.dart'; |
import '../common/names.dart'; |
import '../types/types.dart' show |
TypeMask; |
@@ -28,7 +23,7 @@ import 'type_mask_system.dart'; |
/// |
/// Refinement nodes are inserted after a method invocation to refine the |
/// receiver to the types that can respond to the given selector. |
-class InsertRefinements extends TrampolineRecursiveVisitor implements Pass { |
+class InsertRefinements extends RecursiveVisitor implements Pass { |
String get passName => 'Insert refinement nodes'; |
final TypeMaskSystem types; |
@@ -39,6 +34,7 @@ class InsertRefinements extends TrampolineRecursiveVisitor implements Pass { |
InsertRefinements(this.types); |
void rewrite(FunctionDefinition node) { |
+ new ParentVisitor().visit(node); |
visit(node.body); |
} |
@@ -125,8 +121,7 @@ class InsertRefinements extends TrampolineRecursiveVisitor implements Pass { |
} else { |
// Filter away receivers that throw on this selector. |
TypeMask type = types.receiverTypeFor(node.selector, node.mask); |
- Refinement refinement = new Refinement(receiver, type); |
- pushRefinement(cont, refinement); |
+ pushRefinement(cont, new Refinement(receiver, type)); |
} |
} |