| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 void visitGraph(HGraph graph) { | 212 void visitGraph(HGraph graph) { |
| 213 visitPostDominatorTree(graph); | 213 visitPostDominatorTree(graph); |
| 214 if (!liveInstructions[graph.entry].isEmpty) { | 214 if (!liveInstructions[graph.entry].isEmpty) { |
| 215 compiler.internalError('LiveIntervalBuilder', | 215 compiler.internalError(CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.'); |
| 216 node: compiler.currentElement.parseNode(compiler)); | |
| 217 } | 216 } |
| 218 } | 217 } |
| 219 | 218 |
| 220 void markInputsAsLiveInEnvironment(HInstruction instruction, | 219 void markInputsAsLiveInEnvironment(HInstruction instruction, |
| 221 LiveEnvironment environment) { | 220 LiveEnvironment environment) { |
| 222 for (int i = 0, len = instruction.inputs.length; i < len; i++) { | 221 for (int i = 0, len = instruction.inputs.length; i < len; i++) { |
| 223 markAsLiveInEnvironment(instruction.inputs[i], environment); | 222 markAsLiveInEnvironment(instruction.inputs[i], environment); |
| 224 } | 223 } |
| 225 } | 224 } |
| 226 | 225 |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 if (!needsName(input)) { | 693 if (!needsName(input)) { |
| 695 names.addAssignment(predecessor, input, phi); | 694 names.addAssignment(predecessor, input, phi); |
| 696 } else { | 695 } else { |
| 697 names.addCopy(predecessor, input, phi); | 696 names.addCopy(predecessor, input, phi); |
| 698 } | 697 } |
| 699 } | 698 } |
| 700 | 699 |
| 701 namer.allocateName(phi); | 700 namer.allocateName(phi); |
| 702 } | 701 } |
| 703 } | 702 } |
| OLD | NEW |