Index: pkg/compiler/lib/src/cps_ir/mutable_ssa.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart b/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart |
index abf85cd611c1bec8c1aaf9436bd15871af01e08a..c561e818f7495c11ae7dab409237b4640a42ae17 100644 |
--- a/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart |
+++ b/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart |
@@ -37,7 +37,7 @@ class MutableVariablePreanalysis extends RecursiveVisitor { |
variableDepth[node.variable] = currentDepth; |
} |
- void processSetMutableVariable(SetMutableVariable node) { |
+ void processSetMutable(SetMutable node) { |
MutableVariable variable = node.variable.definition; |
if (currentDepth > variableDepth[variable]) { |
hasAssignmentInTry.add(variable); |
@@ -155,17 +155,19 @@ class MutableVariableEliminator implements Pass { |
// Remove the mutable variable binding. |
node.value.unlink(); |
removeNode(node); |
- } else if (node is SetMutableVariable && |
- shouldRewrite(node.variable.definition)) { |
- // As above, update the environment, preserve variables and remove |
- // the mutable variable assignment. |
- MutableVariable variable = node.variable.definition; |
- environment[variable] = node.value.definition; |
- mergeHints(variable, node.value.definition); |
- node.value.unlink(); |
- removeNode(node); |
- } else if (node is LetPrim && node.primitive is GetMutableVariable) { |
- GetMutableVariable getter = node.primitive; |
+ } else if (node is LetPrim && node.primitive is SetMutable) { |
+ SetMutable setter = node.primitive; |
+ MutableVariable variable = setter.variable.definition; |
+ if (shouldRewrite(variable)) { |
+ // As above, update the environment, preserve variables and remove |
+ // the mutable variable assignment. |
+ environment[variable] = setter.value.definition; |
+ mergeHints(variable, setter.value.definition); |
+ setter.value.unlink(); |
+ removeNode(node); |
+ } |
+ } else if (node is LetPrim && node.primitive is GetMutable) { |
+ GetMutable getter = node.primitive; |
MutableVariable variable = getter.variable.definition; |
if (shouldRewrite(variable)) { |
// Replace with the reaching definition from the environment. |