Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: pkg/compiler/lib/src/cps_ir/mutable_ssa.dart

Issue 1240263002: dart2js cps: Streamline expressions and primitives. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rename Get/SetMutableVariable -> Get/SetMutable Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart ('k') | pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698