| 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 afea3976dee6bb0de887eee47d1d8de6b271ba79..4dded8d127ae2879f6b16268224d4c7815cb0735 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
|
| @@ -5,7 +5,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';
|
| @@ -23,7 +22,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 RecursiveVisitor implements Pass {
|
| +class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
|
| String get passName => 'Insert refinement nodes';
|
|
|
| final TypeMaskSystem types;
|
| @@ -34,7 +33,6 @@ class InsertRefinements extends RecursiveVisitor implements Pass {
|
| InsertRefinements(this.types);
|
|
|
| void rewrite(FunctionDefinition node) {
|
| - new ParentVisitor().visit(node);
|
| visit(node.body);
|
| }
|
|
|
| @@ -80,6 +78,7 @@ class InsertRefinements extends RecursiveVisitor implements Pass {
|
| /// Enqueues [cont] for processing in a context where [refined] is the
|
| /// current refinement for its value.
|
| void pushRefinement(Continuation cont, Refinement refined) {
|
| + refined.value.parent = refined;
|
| Primitive value = refined.effectiveDefinition;
|
| Primitive currentRefinement = refinementFor[value];
|
| pushAction(() {
|
| @@ -121,7 +120,8 @@ class InsertRefinements extends RecursiveVisitor implements Pass {
|
| } else {
|
| // Filter away receivers that throw on this selector.
|
| TypeMask type = types.receiverTypeFor(node.selector, node.mask);
|
| - pushRefinement(cont, new Refinement(receiver, type));
|
| + Refinement refinement = new Refinement(receiver, type);
|
| + pushRefinement(cont, refinement);
|
| }
|
| }
|
|
|
|
|