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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 980853002: dart2dart: Bugfix in copy propagator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 9 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/tree_ir/optimization/statement_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 90d58308ca44f2e3528249a7ee1e668fc30d2c6a..6751ae9ae725132b50480e690b2b42a1e5f91ae9 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -183,7 +183,7 @@ class StatementRewriter extends Visitor<Statement, Expression> with PassMixin {
environment.last.variable == node.variable &&
node.variable.readCount == 1) {
--node.variable.readCount;
- return visitExpression(environment.removeLast().definition);
+ return visitExpression(environment.removeLast().value);
}
// If the definition could not be propagated, leave the variable use.
@@ -203,14 +203,14 @@ class StatementRewriter extends Visitor<Statement, Expression> with PassMixin {
}
Statement visitAssign(Assign node) {
- if (isEffectivelyConstant(node.definition) &&
+ if (isEffectivelyConstant(node.value) &&
node.variable.writeCount == 1) {
// Handle constant assignments specially.
// They are always safe to propagate (though we should avoid duplication).
// Moreover, they should not prevent other expressions from propagating.
if (node.variable.readCount <= 1) {
// A single-use constant should always be propagted to its use site.
- constantEnvironment[node.variable] = visitExpression(node.definition);
+ constantEnvironment[node.variable] = visitExpression(node.value);
--node.variable.writeCount;
return visitStatement(node.next);
} else {
@@ -218,7 +218,7 @@ class StatementRewriter extends Visitor<Statement, Expression> with PassMixin {
// Visit the following statement without polluting [environment] so
// that any preceding non-constant assignments might still propagate.
node.next = visitStatement(node.next);
- node.definition = visitExpression(node.definition);
+ node.value = visitExpression(node.value);
return node;
}
} else {
@@ -230,7 +230,7 @@ class StatementRewriter extends Visitor<Statement, Expression> with PassMixin {
// The definition could not be propagated. Residualize the let binding.
node.next = next;
environment.removeLast();
- node.definition = visitExpression(node.definition);
+ node.value = visitExpression(node.value);
return node;
}
assert(!environment.contains(node));
@@ -538,7 +538,7 @@ class StatementRewriter extends Visitor<Statement, Expression> with PassMixin {
--t.variable.writeCount;
// The Assign constructor will increment the reference count again.
return new Assign(s.variable,
- combine(s.definition, t.definition),
+ combine(s.value, t.value),
next);
}
}
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698