| 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 8c37b3ac201a5800178f8ce0a506e976b0d70912..9253ce68c0fbb75899904d78f955de4db1d9d9bd 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| @@ -358,9 +358,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
|
| @@ -405,7 +402,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;
|
| @@ -512,7 +509,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);
|
| }
|
|
|
| @@ -557,7 +554,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;
|
| @@ -1499,8 +1495,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;
|
| }
|
| }
|
| @@ -2626,7 +2621,7 @@ class OriginalLengthEntity extends Entity {
|
| String get name => 'length';
|
| }
|
|
|
| -class ResetAnalysisInfo extends RecursiveVisitor {
|
| +class ResetAnalysisInfo extends TrampolineRecursiveVisitor {
|
| Set<Continuation> reachableContinuations;
|
| Map<Variable, ConstantValue> values;
|
|
|
|
|