| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 markAsLiveInEnvironment(instruction.inputs[i], environment); | 222 markAsLiveInEnvironment(instruction.inputs[i], environment); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 // Returns the non-HCheck instruction, or the last [HCheck] in the | 226 // Returns the non-HCheck instruction, or the last [HCheck] in the |
| 227 // check chain that is not generate at use site. | 227 // check chain that is not generate at use site. |
| 228 HInstruction checkedInstructionOrNonGenerateAtUseSite(HCheck check) { | 228 HInstruction checkedInstructionOrNonGenerateAtUseSite(HCheck check) { |
| 229 var checked = check.checkedInput; | 229 var checked = check.checkedInput; |
| 230 while (checked is HCheck) { | 230 while (checked is HCheck) { |
| 231 HInstruction next = checked.checkedInput; | 231 HInstruction next = checked.checkedInput; |
| 232 if (generateAtUseSite.contains(next)) break; |
| 232 checked = next; | 233 checked = next; |
| 233 if (!generateAtUseSite.contains(next)) break; | |
| 234 } | 234 } |
| 235 return checked; | 235 return checked; |
| 236 } | 236 } |
| 237 | 237 |
| 238 void markAsLiveInEnvironment(HInstruction instruction, | 238 void markAsLiveInEnvironment(HInstruction instruction, |
| 239 LiveEnvironment environment) { | 239 LiveEnvironment environment) { |
| 240 if (generateAtUseSite.contains(instruction)) { | 240 if (generateAtUseSite.contains(instruction)) { |
| 241 markInputsAsLiveInEnvironment(instruction, environment); | 241 markInputsAsLiveInEnvironment(instruction, environment); |
| 242 } else { | 242 } else { |
| 243 environment.add(instruction, instructionId); | 243 environment.add(instruction, instructionId); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 if (!needsName(input)) { | 693 if (!needsName(input)) { |
| 694 names.addAssignment(predecessor, input, phi); | 694 names.addAssignment(predecessor, input, phi); |
| 695 } else { | 695 } else { |
| 696 names.addCopy(predecessor, input, phi); | 696 names.addCopy(predecessor, input, phi); |
| 697 } | 697 } |
| 698 } | 698 } |
| 699 | 699 |
| 700 namer.allocateName(phi); | 700 namer.allocateName(phi); |
| 701 } | 701 } |
| 702 } | 702 } |
| OLD | NEW |