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 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
9 * methods. We need to override [Element.computeType] because our | 9 * methods. We need to override [Element.computeType] because our |
10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 }); | 642 }); |
643 } | 643 } |
644 if (thisValue != null) { | 644 if (thisValue != null) { |
645 // If there was a "this" for the scope, add it to the new locals. | 645 // If there was a "this" for the scope, add it to the new locals. |
646 joinedLocals[closureData.thisElement] = thisValue; | 646 joinedLocals[closureData.thisElement] = thisValue; |
647 } | 647 } |
648 | 648 |
649 // Remove locals that are not in all handlers. | 649 // Remove locals that are not in all handlers. |
650 directLocals = new Map<Element, HInstruction>(); | 650 directLocals = new Map<Element, HInstruction>(); |
651 joinedLocals.forEach((element, instruction) { | 651 joinedLocals.forEach((element, instruction) { |
652 if (instruction is HPhi | 652 if (element != closureData.thisElement |
653 && instruction.inputs.length != localsHandlers.length) { | 653 && instruction.inputs.length != localsHandlers.length) { |
654 joinBlock.removePhi(instruction); | 654 joinBlock.removePhi(instruction); |
655 } else { | 655 } else { |
656 directLocals[element] = instruction; | 656 directLocals[element] = instruction; |
657 } | 657 } |
658 }); | 658 }); |
659 return this; | 659 return this; |
660 } | 660 } |
661 } | 661 } |
662 | 662 |
(...skipping 5326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5989 DartType unaliased = type.unalias(builder.compiler); | 5989 DartType unaliased = type.unalias(builder.compiler); |
5990 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 5990 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
5991 unaliased.accept(this, builder); | 5991 unaliased.accept(this, builder); |
5992 } | 5992 } |
5993 | 5993 |
5994 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 5994 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
5995 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); | 5995 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); |
5996 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); | 5996 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); |
5997 } | 5997 } |
5998 } | 5998 } |
OLD | NEW |