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 import '../common.dart'; | 5 import '../common.dart'; |
6 import '../js_backend/js_backend.dart'; | 6 import '../js_backend/js_backend.dart'; |
7 import 'nodes.dart'; | 7 import 'nodes.dart'; |
8 | 8 |
9 /** | 9 /** |
10 * The [LiveRange] class covers a range where an instruction is live. | 10 * The [LiveRange] class covers a range where an instruction is live. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 */ | 207 */ |
208 final Map<HInstruction, LiveInterval> liveIntervals; | 208 final Map<HInstruction, LiveInterval> liveIntervals; |
209 | 209 |
210 SsaLiveIntervalBuilder(this.generateAtUseSite, this.controlFlowOperators) | 210 SsaLiveIntervalBuilder(this.generateAtUseSite, this.controlFlowOperators) |
211 : liveInstructions = new Map<HBasicBlock, LiveEnvironment>(), | 211 : liveInstructions = new Map<HBasicBlock, LiveEnvironment>(), |
212 liveIntervals = new Map<HInstruction, LiveInterval>(); | 212 liveIntervals = new Map<HInstruction, LiveInterval>(); |
213 | 213 |
214 void visitGraph(HGraph graph) { | 214 void visitGraph(HGraph graph) { |
215 visitPostDominatorTree(graph); | 215 visitPostDominatorTree(graph); |
216 if (!liveInstructions[graph.entry].isEmpty) { | 216 if (!liveInstructions[graph.entry].isEmpty) { |
217 throw new SpannableAssertionFailure( | 217 failedAt(CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.'); |
218 CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.'); | |
219 } | 218 } |
220 } | 219 } |
221 | 220 |
222 void markInputsAsLiveInEnvironment( | 221 void markInputsAsLiveInEnvironment( |
223 HInstruction instruction, LiveEnvironment environment) { | 222 HInstruction instruction, LiveEnvironment environment) { |
224 for (int i = 0, len = instruction.inputs.length; i < len; i++) { | 223 for (int i = 0, len = instruction.inputs.length; i < len; i++) { |
225 markAsLiveInEnvironment(instruction.inputs[i], environment); | 224 markAsLiveInEnvironment(instruction.inputs[i], environment); |
226 } | 225 } |
227 } | 226 } |
228 | 227 |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 if (!needsName(input)) { | 704 if (!needsName(input)) { |
706 names.addAssignment(predecessor, input, phi); | 705 names.addAssignment(predecessor, input, phi); |
707 } else { | 706 } else { |
708 names.addCopy(predecessor, input, phi); | 707 names.addCopy(predecessor, input, phi); |
709 } | 708 } |
710 } | 709 } |
711 | 710 |
712 namer.allocateName(phi); | 711 namer.allocateName(phi); |
713 } | 712 } |
714 } | 713 } |
OLD | NEW |