| Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| index fa48c8436cf40d289e944a71142155bc5d0e31e4..bb458ce02ab0db24f7498360fc3c2b94d6521847 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| @@ -581,9 +581,6 @@ class TypePropagator extends Pass {
|
|
|
| @override
|
| void rewrite(FunctionDefinition root) {
|
| - // Set all parent pointers.
|
| - new ParentVisitor().visit(root);
|
| -
|
| Map<Expression, ConstantValue> replacements = <Expression, ConstantValue>{};
|
|
|
| // Analyze. In this phase, the entire term is analyzed for reachability
|
| @@ -629,7 +626,7 @@ final Map<String, BuiltinOperator> NumBinaryBuiltins =
|
| * Uses the information from a preceding analysis pass in order to perform the
|
| * actual transformations on the CPS graph.
|
| */
|
| -class TransformingVisitor extends LeafVisitor {
|
| +class TransformingVisitor extends DeepRecursiveVisitor {
|
| final TypePropagationVisitor analyzer;
|
| final Map<Expression, ConstantValue> replacements;
|
| final ConstantPropagationLattice lattice;
|
| @@ -736,7 +733,7 @@ class TransformingVisitor extends LeafVisitor {
|
|
|
| /// Sets parent pointers and computes types for the given subtree.
|
| void reanalyze(Node node) {
|
| - new ParentVisitor().visit(node);
|
| + ParentVisitor.setParents(node);
|
| analyzer.reanalyzeSubtree(node);
|
| }
|
|
|
| @@ -781,7 +778,6 @@ class TransformingVisitor extends LeafVisitor {
|
| // traversing the entire subtree of [node]. Temporarily close the
|
| // term with a dummy node while recomputing types.
|
| context.body = new Unreachable();
|
| - new ParentVisitor().visit(insertedCode.root);
|
| reanalyze(insertedCode.root);
|
|
|
| context.body = node;
|
| @@ -1764,8 +1760,7 @@ class TransformingVisitor extends LeafVisitor {
|
| // target definitely does not use it.
|
| Constant dummy = makeConstantPrimitive(new IntConstantValue(0));
|
| insertLetPrim(node, dummy);
|
| - node.arguments[0].unlink();
|
| - node.arguments[0] = new Reference<Primitive>(dummy);
|
| + node.arguments[0].changeTo(dummy);
|
| node.receiverIsIntercepted = false;
|
| }
|
| }
|
| @@ -3024,7 +3019,7 @@ class OriginalLengthEntity extends Entity {
|
| String get name => 'length';
|
| }
|
|
|
| -class ResetAnalysisInfo extends RecursiveVisitor {
|
| +class ResetAnalysisInfo extends TrampolineRecursiveVisitor {
|
| Set<Continuation> reachableContinuations;
|
| Map<Variable, ConstantValue> values;
|
|
|
|
|