| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 instruction.instructionType, compiler.world); | 160 instruction.instructionType, compiler.world); |
| 161 replacement.instructionType = newType; | 161 replacement.instructionType = newType; |
| 162 } | 162 } |
| 163 | 163 |
| 164 // If the replacement instruction does not know its | 164 // If the replacement instruction does not know its |
| 165 // source element, use the source element of the | 165 // source element, use the source element of the |
| 166 // instruction. | 166 // instruction. |
| 167 if (replacement.sourceElement == null) { | 167 if (replacement.sourceElement == null) { |
| 168 replacement.sourceElement = instruction.sourceElement; | 168 replacement.sourceElement = instruction.sourceElement; |
| 169 } | 169 } |
| 170 if (replacement.sourcePosition == null) { | 170 if (replacement.sourceInformation == null) { |
| 171 replacement.sourcePosition = instruction.sourcePosition; | 171 replacement.sourceInformation = instruction.sourceInformation; |
| 172 } | 172 } |
| 173 if (!replacement.isInBasicBlock()) { | 173 if (!replacement.isInBasicBlock()) { |
| 174 // The constant folding can return an instruction that is already | 174 // The constant folding can return an instruction that is already |
| 175 // part of the graph (like an input), so we only add the replacement | 175 // part of the graph (like an input), so we only add the replacement |
| 176 // if necessary. | 176 // if necessary. |
| 177 block.addAfter(instruction, replacement); | 177 block.addAfter(instruction, replacement); |
| 178 // Visit the replacement as the next instruction in case it | 178 // Visit the replacement as the next instruction in case it |
| 179 // can also be constant folded away. | 179 // can also be constant folded away. |
| 180 next = replacement; | 180 next = replacement; |
| 181 } | 181 } |
| (...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 | 2189 |
| 2190 keyedValues.forEach((receiver, values) { | 2190 keyedValues.forEach((receiver, values) { |
| 2191 result.keyedValues[receiver] = | 2191 result.keyedValues[receiver] = |
| 2192 new Map<HInstruction, HInstruction>.from(values); | 2192 new Map<HInstruction, HInstruction>.from(values); |
| 2193 }); | 2193 }); |
| 2194 | 2194 |
| 2195 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2195 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 2196 return result; | 2196 return result; |
| 2197 } | 2197 } |
| 2198 } | 2198 } |
| OLD | NEW |