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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 807573003: Fix some bugs that blocked optimizations in the new IRs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/tree_ir_builder.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
index 4cc853c878f59dacfbea17a951d959d343450d67..f4e1617083d7f9727b2a9322be518ce7ad26d8f7 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
@@ -198,7 +198,7 @@ class Builder extends cps_ir.Visitor<Node> {
List<Variable> translatePhiArguments(List<cps_ir.Reference> args) {
return new List<Variable>.generate(args.length,
- (int index) => getVariableReference(args[index]));
+ (int index) => getVariable(args[index].definition));
asgerf 2015/01/15 12:08:00 getVariableReference() increases readCount. getVar
sigurdm 2015/01/15 12:21:03 Maybe put this explanation in a comment in the cod
asgerf 2015/01/15 13:05:37 Done.
}
Statement buildContinuationAssignment(
@@ -247,6 +247,8 @@ class Builder extends cps_ir.Visitor<Node> {
Statement first, current;
void addAssignment(Variable dst, Variable src) {
+ ++src.readCount;
+ // `dst.writeCount` will be updated by the Assign constructor.
if (first == null) {
first = current = new Assign(dst, src, null);
} else {

Powered by Google App Engine
This is Rietveld 408576698