Chromium Code Reviews| Index: lib/compiler/implementation/ssa/optimize.dart |
| =================================================================== |
| --- lib/compiler/implementation/ssa/optimize.dart (revision 14453) |
| +++ lib/compiler/implementation/ssa/optimize.dart (working copy) |
| @@ -142,12 +142,14 @@ |
| } |
| block.rewrite(instruction, replacement); |
| block.remove(instruction); |
| - // If the replacement instruction does not know its type or |
| - // source element yet, use the type and source element of the |
| + |
| + // If we can replace [instruction] with [replacement], then |
| + // [replacement]'s type can be narrowed. |
| + types[replacement] = |
| + types[replacement].intersection(types[instruction], compiler); |
| + // If the replacement instruction does not know its |
|
kasperl
2012/11/02 11:09:41
Add newline before the comment here.
ngeoffray
2012/11/02 11:15:31
Done.
|
| + // source element, use the source element of the |
| // instruction. |
| - if (!types[replacement].isUseful()) { |
| - types[replacement] = types[instruction]; |
| - } |
| if (replacement.sourceElement == null) { |
| replacement.sourceElement = instruction.sourceElement; |
| } |