| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 abstract class OptimizationPhase { | 7 abstract class OptimizationPhase { |
| 8 String get name; | 8 String get name; |
| 9 void visitGraph(HGraph graph); | 9 void visitGraph(HGraph graph); |
| 10 } | 10 } |
| (...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 if (existing != null) { | 1642 if (existing != null) { |
| 1643 instruction.block.rewriteWithBetterUser(instruction, existing); | 1643 instruction.block.rewriteWithBetterUser(instruction, existing); |
| 1644 instruction.block.remove(instruction); | 1644 instruction.block.remove(instruction); |
| 1645 } else { | 1645 } else { |
| 1646 memorySet.registerKeyedValue(receiver, instruction.index, instruction); | 1646 memorySet.registerKeyedValue(receiver, instruction.index, instruction); |
| 1647 } | 1647 } |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 void visitIndexAssign(HIndexAssign instruction) { | 1650 void visitIndexAssign(HIndexAssign instruction) { |
| 1651 HInstruction receiver = instruction.receiver.nonCheck(); | 1651 HInstruction receiver = instruction.receiver.nonCheck(); |
| 1652 JavaScriptBackend backend = compiler.backend; |
| 1653 // Typed arrays may narrow incoming values. |
| 1654 if (backend.couldBeTypedArray(receiver.instructionType)) return; |
| 1652 memorySet.registerKeyedValueUpdate( | 1655 memorySet.registerKeyedValueUpdate( |
| 1653 receiver, instruction.index, instruction.value); | 1656 receiver, instruction.index, instruction.value); |
| 1654 } | 1657 } |
| 1655 } | 1658 } |
| 1656 | 1659 |
| 1657 /** | 1660 /** |
| 1658 * Holds values of memory places. | 1661 * Holds values of memory places. |
| 1659 */ | 1662 */ |
| 1660 class MemorySet { | 1663 class MemorySet { |
| 1661 final Compiler compiler; | 1664 final Compiler compiler; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 | 1883 |
| 1881 keyedValues.forEach((receiver, values) { | 1884 keyedValues.forEach((receiver, values) { |
| 1882 result.keyedValues[receiver] = | 1885 result.keyedValues[receiver] = |
| 1883 new Map<HInstruction, HInstruction>.from(values); | 1886 new Map<HInstruction, HInstruction>.from(values); |
| 1884 }); | 1887 }); |
| 1885 | 1888 |
| 1886 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 1889 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 1887 return result; | 1890 return result; |
| 1888 } | 1891 } |
| 1889 } | 1892 } |
| OLD | NEW |