Chromium Code Reviews| 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 543 names.ownName[instruction] = name; | 543 names.ownName[instruction] = name; |
| 544 return name; | 544 return name; |
| 545 } | 545 } |
| 546 | 546 |
| 547 /** | 547 /** |
| 548 * Frees [instruction]'s name so it can be used for other instructions. | 548 * Frees [instruction]'s name so it can be used for other instructions. |
| 549 */ | 549 */ |
| 550 void freeName(HInstruction instruction) { | 550 void freeName(HInstruction instruction) { |
| 551 String ownName = names.ownName[instruction]; | 551 String ownName = names.ownName[instruction]; |
| 552 if (ownName != null) { | 552 if (ownName != null) { |
| 553 RegExp regexp = const RegExp('t[0-9]+'); | 553 RegExp regexp = new RegExp('t[0-9]+'); |
|
ahe
2012/11/12 13:35:03
Top-level final field?
Anders Johnsen
2012/11/12 13:45:38
Done, +static.
| |
| 554 // We check if we have already looked for temporary names | 554 // We check if we have already looked for temporary names |
| 555 // because if we haven't, chances are the temporary we allocate | 555 // because if we haven't, chances are the temporary we allocate |
| 556 // in this block can match a phi with the same name in the | 556 // in this block can match a phi with the same name in the |
| 557 // successor block. | 557 // successor block. |
| 558 if (temporaryIndex != 0 && regexp.hasMatch(ownName)) { | 558 if (temporaryIndex != 0 && regexp.hasMatch(ownName)) { |
| 559 freeTemporaryNames.addLast(ownName); | 559 freeTemporaryNames.addLast(ownName); |
| 560 } | 560 } |
| 561 usedNames.remove(ownName); | 561 usedNames.remove(ownName); |
| 562 } | 562 } |
| 563 } | 563 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 if (!needsName(input)) { | 675 if (!needsName(input)) { |
| 676 names.addAssignment(predecessor, input, phi); | 676 names.addAssignment(predecessor, input, phi); |
| 677 } else { | 677 } else { |
| 678 names.addCopy(predecessor, input, phi); | 678 names.addCopy(predecessor, input, phi); |
| 679 } | 679 } |
| 680 } | 680 } |
| 681 | 681 |
| 682 namer.allocateName(phi); | 682 namer.allocateName(phi); |
| 683 } | 683 } |
| 684 } | 684 } |
| OLD | NEW |