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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 // Special case this instruction to use the name of its | 504 // Special case this instruction to use the name of its |
505 // input if it has one. | 505 // input if it has one. |
506 var temp = instruction; | 506 var temp = instruction; |
507 do { | 507 do { |
508 temp = temp.checkedInput; | 508 temp = temp.checkedInput; |
509 name = names.ownName[temp]; | 509 name = names.ownName[temp]; |
510 } while (name == null && temp is HCheck); | 510 } while (name == null && temp is HCheck); |
511 if (name != null) return addAllocatedName(instruction, name); | 511 if (name != null) return addAllocatedName(instruction, name); |
512 } | 512 } |
513 | 513 |
514 if (instruction.sourceElement != null) { | 514 // The dom/html libraries have inline JS code that reference» |
floitsch
2012/11/07 16:44:30
remove tab.
| |
515 // parameter names directly. Long-term such code will be rejected. | |
516 // Now, just don't mangle the parameter name. | |
517 if (instruction is HParameterValue | |
518 && instruction.sourceElement.enclosingElement.isNative()) { | |
519 name = instruction.sourceElement.name.slowToString(); | |
520 } else if (instruction.sourceElement != null) { | |
515 name = allocateWithHint(instruction.sourceElement.name.slowToString()); | 521 name = allocateWithHint(instruction.sourceElement.name.slowToString()); |
516 } else { | 522 } else { |
517 // We could not find an element for the instruction. If the | 523 // We could not find an element for the instruction. If the |
518 // instruction is used by a phi, try to use the name of the phi. | 524 // instruction is used by a phi, try to use the name of the phi. |
519 // Otherwise, just allocate a temporary name. | 525 // Otherwise, just allocate a temporary name. |
520 HPhi phi = firstPhiUserWithElement(instruction); | 526 HPhi phi = firstPhiUserWithElement(instruction); |
521 if (phi != null) { | 527 if (phi != null) { |
522 name = allocateWithHint(phi.sourceElement.name.slowToString()); | 528 name = allocateWithHint(phi.sourceElement.name.slowToString()); |
523 } else { | 529 } else { |
524 name = allocateTemporary(); | 530 name = allocateTemporary(); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 if (!needsName(input)) { | 675 if (!needsName(input)) { |
670 names.addAssignment(predecessor, input, phi); | 676 names.addAssignment(predecessor, input, phi); |
671 } else { | 677 } else { |
672 names.addCopy(predecessor, input, phi); | 678 names.addCopy(predecessor, input, phi); |
673 } | 679 } |
674 } | 680 } |
675 | 681 |
676 namer.allocateName(phi); | 682 namer.allocateName(phi); |
677 } | 683 } |
678 } | 684 } |
OLD | NEW |