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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // t3 = check(t2) | 236 // t3 = check(t2) |
237 // t4 = use(t3) | 237 // t4 = use(t3) |
238 // t5 = use(t3) | 238 // t5 = use(t3) |
239 // t6 = use(t2) | 239 // t6 = use(t2) |
240 // | 240 // |
241 // The t1 is generate-at-use site, and the live-range must thus be on t2 and | 241 // The t1 is generate-at-use site, and the live-range must thus be on t2 and |
242 // not on the checked instruction t1. | 242 // not on the checked instruction t1. |
243 // When looking for the checkedInstructionOrNonGenerateAtUseSite of t3 we must | 243 // When looking for the checkedInstructionOrNonGenerateAtUseSite of t3 we must |
244 // return t2. | 244 // return t2. |
245 HInstruction checkedInstructionOrNonGenerateAtUseSite(HCheck check) { | 245 HInstruction checkedInstructionOrNonGenerateAtUseSite(HCheck check) { |
246 var checked = check.checkedInput; | 246 dynamic checked = check.checkedInput; |
247 while (checked is HCheck) { | 247 while (checked is HCheck) { |
248 HInstruction next = checked.checkedInput; | 248 HInstruction next = checked.checkedInput; |
249 if (generateAtUseSite.contains(next)) break; | 249 if (generateAtUseSite.contains(next)) break; |
250 checked = next; | 250 checked = next; |
251 } | 251 } |
252 return checked; | 252 return checked; |
253 } | 253 } |
254 | 254 |
255 void markAsLiveInEnvironment( | 255 void markAsLiveInEnvironment( |
256 HInstruction instruction, LiveEnvironment environment) { | 256 HInstruction instruction, LiveEnvironment environment) { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 if (!needsName(input)) { | 705 if (!needsName(input)) { |
706 names.addAssignment(predecessor, input, phi); | 706 names.addAssignment(predecessor, input, phi); |
707 } else { | 707 } else { |
708 names.addCopy(predecessor, input, phi); | 708 names.addCopy(predecessor, input, phi); |
709 } | 709 } |
710 } | 710 } |
711 | 711 |
712 namer.allocateName(phi); | 712 namer.allocateName(phi); |
713 } | 713 } |
714 } | 714 } |
OLD | NEW |