Chromium Code Reviews| 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); |
| } |
| } |