| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 * Frees [instruction]'s name so it can be used for other instructions. | 539 * Frees [instruction]'s name so it can be used for other instructions. |
| 540 */ | 540 */ |
| 541 void freeName(HInstruction instruction) { | 541 void freeName(HInstruction instruction) { |
| 542 String ownName = names.ownName[instruction]; | 542 String ownName = names.ownName[instruction]; |
| 543 if (ownName != null) { | 543 if (ownName != null) { |
| 544 // We check if we have already looked for temporary names | 544 // We check if we have already looked for temporary names |
| 545 // because if we haven't, chances are the temporary we allocate | 545 // because if we haven't, chances are the temporary we allocate |
| 546 // in this block can match a phi with the same name in the | 546 // in this block can match a phi with the same name in the |
| 547 // successor block. | 547 // successor block. |
| 548 if (temporaryIndex != 0 && regexp.hasMatch(ownName)) { | 548 if (temporaryIndex != 0 && regexp.hasMatch(ownName)) { |
| 549 freeTemporaryNames.addLast(ownName); | 549 freeTemporaryNames.add(ownName); |
| 550 } | 550 } |
| 551 usedNames.remove(ownName); | 551 usedNames.remove(ownName); |
| 552 } | 552 } |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 | 555 |
| 556 /** | 556 /** |
| 557 * Visits all blocks in the graph, sets names to instructions, and | 557 * Visits all blocks in the graph, sets names to instructions, and |
| 558 * creates the [CopyHandler] for each block. This class needs to have | 558 * creates the [CopyHandler] for each block. This class needs to have |
| 559 * the liveIns set as well as all the live intervals of instructions. | 559 * the liveIns set as well as all the live intervals of instructions. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 if (!needsName(input)) { | 660 if (!needsName(input)) { |
| 661 names.addAssignment(predecessor, input, phi); | 661 names.addAssignment(predecessor, input, phi); |
| 662 } else { | 662 } else { |
| 663 names.addCopy(predecessor, input, phi); | 663 names.addCopy(predecessor, input, phi); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 | 666 |
| 667 namer.allocateName(phi); | 667 namer.allocateName(phi); |
| 668 } | 668 } |
| 669 } | 669 } |
| OLD | NEW |