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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 // If the block is a loop header, we can remove the loop marker, | 288 // If the block is a loop header, we can remove the loop marker, |
289 // because it will just recompute the loop phis. | 289 // because it will just recompute the loop phis. |
290 if (block.isLoopHeader()) { | 290 if (block.isLoopHeader()) { |
291 updateLoopMarker(block); | 291 updateLoopMarker(block); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 void updateLoopMarker(HBasicBlock header) { | 295 void updateLoopMarker(HBasicBlock header) { |
296 LiveEnvironment env = liveInstructions[header]; | 296 LiveEnvironment env = liveInstructions[header]; |
297 int lastId = env.loopMarkers[header]; | 297 int lastId = env.loopMarkers[header]; |
298 if (lastId == null) { | |
299 assert(header.predecessors.length == 1); | |
floitsch
2012/11/05 17:36:09
add comment what happened.
ngeoffray
2012/11/06 08:55:27
I changed the code to not enter updateLoopMarker i
| |
300 return; | |
301 } | |
302 | |
298 // Update all instructions that are liveIns in [header] to have a | 303 // Update all instructions that are liveIns in [header] to have a |
299 // range that covers the loop. | 304 // range that covers the loop. |
300 env.liveInstructions.forEach((HInstruction instruction, int id) { | 305 env.liveInstructions.forEach((HInstruction instruction, int id) { |
301 LiveInterval range = env.liveIntervals.putIfAbsent( | 306 LiveInterval range = env.liveIntervals.putIfAbsent( |
302 instruction, () => new LiveInterval()); | 307 instruction, () => new LiveInterval()); |
303 range.loopUpdate(env.startId, lastId); | 308 range.loopUpdate(env.startId, lastId); |
304 env.liveInstructions[instruction] = lastId; | 309 env.liveInstructions[instruction] = lastId; |
305 }); | 310 }); |
306 | 311 |
307 env.removeLoopMarker(header); | 312 env.removeLoopMarker(header); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 if (!needsName(input)) { | 676 if (!needsName(input)) { |
672 names.addAssignment(predecessor, input, phi); | 677 names.addAssignment(predecessor, input, phi); |
673 } else { | 678 } else { |
674 names.addCopy(predecessor, input, phi); | 679 names.addCopy(predecessor, input, phi); |
675 } | 680 } |
676 } | 681 } |
677 | 682 |
678 namer.allocateName(phi); | 683 namer.allocateName(phi); |
679 } | 684 } |
680 } | 685 } |
OLD | NEW |