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

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10808050: Don't create new nodes if we don't need to. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index 3245032367aa2fd1a21e06778c3b72451ab91be8..24eb3ae1c46c1ba34c4c43e3f44aa0663adf09ee 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -679,10 +679,7 @@ class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
index = insertIntegerCheck(node, index);
}
index = insertBoundsCheck(node, node.receiver, index);
- HIndex newInstruction = new HIndex(node.target, node.receiver, index);
- node.block.addBefore(node, newInstruction);
- node.block.rewrite(node, newInstruction);
- node.block.remove(node);
+ node.changeUse(node.index, index);
}
void visitIndexAssign(HIndexAssign node) {
@@ -693,11 +690,7 @@ class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase {
index = insertIntegerCheck(node, index);
}
index = insertBoundsCheck(node, node.receiver, index);
- HIndexAssign newInstruction =
- new HIndexAssign(node.target, node.receiver, index, node.value);
- node.block.addBefore(node, newInstruction);
- node.block.rewrite(node, newInstruction);
- node.block.remove(node);
+ node.changeUse(node.index, index);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698