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

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

Issue 10824371: Add an optional parameter to the dominatedUsers function in case we want to analyze the whole block, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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: lib/compiler/implementation/ssa/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 10938)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -682,7 +682,7 @@
HIntegerCheck insertIntegerCheck(HInstruction node, HInstruction value) {
HIntegerCheck check = new HIntegerCheck(value);
node.block.addBefore(node, check);
- Set<HInstruction> dominatedUsers = value.dominatedUsers(check);
+ Set<HInstruction> dominatedUsers = value.dominatedUsers(node);
for (HInstruction user in dominatedUsers) {
user.changeUse(value, check);
}
@@ -1135,13 +1135,12 @@
void changeUsesDominatedBy(HBasicBlock dominator,
HInstruction input,
HType convertedType) {
- HTypeConversion newInput;
Set<HInstruction> dominatedUsers = input.dominatedUsers(dominator.first);
+ if (dominatedUsers.isEmpty()) return;
+
+ HTypeConversion newInput = new HTypeConversion(convertedType, input);
+ dominator.addBefore(dominator.first, newInput);
for (HInstruction user in dominatedUsers) {
kasperl 2012/08/20 12:58:35 Use dominatedUsers.forEach?
ngeoffray 2012/08/20 13:01:32 Sure. Personal preference?
- if (newInput === null) {
- newInput = new HTypeConversion(convertedType, input);
- dominator.addBefore(dominator.first, newInput);
- }
user.changeUse(input, newInput);
}
}

Powered by Google App Engine
This is Rietveld 408576698