| 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 /** | 7 /** |
| 8 * The [LiveRange] class covers a range where an instruction is live. | 8 * The [LiveRange] class covers a range where an instruction is live. |
| 9 */ | 9 */ |
| 10 class LiveRange { | 10 class LiveRange { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 /** | 202 /** |
| 203 * The live intervals of instructions. | 203 * The live intervals of instructions. |
| 204 */ | 204 */ |
| 205 final Map<HInstruction, LiveInterval> liveIntervals; | 205 final Map<HInstruction, LiveInterval> liveIntervals; |
| 206 | 206 |
| 207 SsaLiveIntervalBuilder( | 207 SsaLiveIntervalBuilder( |
| 208 this.compiler, this.generateAtUseSite, this.controlFlowOperators) | 208 this.compiler, this.generateAtUseSite, this.controlFlowOperators) |
| 209 : liveInstructions = new Map<HBasicBlock, LiveEnvironment>(), | 209 : liveInstructions = new Map<HBasicBlock, LiveEnvironment>(), |
| 210 liveIntervals = new Map<HInstruction, LiveInterval>(); | 210 liveIntervals = new Map<HInstruction, LiveInterval>(); |
| 211 | 211 |
| 212 DiagnosticReporter get reporter => compiler.reporter; |
| 213 |
| 212 void visitGraph(HGraph graph) { | 214 void visitGraph(HGraph graph) { |
| 213 visitPostDominatorTree(graph); | 215 visitPostDominatorTree(graph); |
| 214 if (!liveInstructions[graph.entry].isEmpty) { | 216 if (!liveInstructions[graph.entry].isEmpty) { |
| 215 compiler.internalError(CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.'); | 217 reporter.internalError(CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.'); |
| 216 } | 218 } |
| 217 } | 219 } |
| 218 | 220 |
| 219 void markInputsAsLiveInEnvironment(HInstruction instruction, | 221 void markInputsAsLiveInEnvironment(HInstruction instruction, |
| 220 LiveEnvironment environment) { | 222 LiveEnvironment environment) { |
| 221 for (int i = 0, len = instruction.inputs.length; i < len; i++) { | 223 for (int i = 0, len = instruction.inputs.length; i < len; i++) { |
| 222 markAsLiveInEnvironment(instruction.inputs[i], environment); | 224 markAsLiveInEnvironment(instruction.inputs[i], environment); |
| 223 } | 225 } |
| 224 } | 226 } |
| 225 | 227 |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 if (!needsName(input)) { | 709 if (!needsName(input)) { |
| 708 names.addAssignment(predecessor, input, phi); | 710 names.addAssignment(predecessor, input, phi); |
| 709 } else { | 711 } else { |
| 710 names.addCopy(predecessor, input, phi); | 712 names.addCopy(predecessor, input, phi); |
| 711 } | 713 } |
| 712 } | 714 } |
| 713 | 715 |
| 714 namer.allocateName(phi); | 716 namer.allocateName(phi); |
| 715 } | 717 } |
| 716 } | 718 } |
| OLD | NEW |