| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.kernel.impact_test; | 5 library dart2js.kernel.impact_test; |
| 6 | 6 |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'package:compiler/src/commandline_options.dart'; | 8 import 'package:compiler/src/commandline_options.dart'; |
| 9 import 'package:compiler/src/common.dart'; | 9 import 'package:compiler/src/common.dart'; |
| 10 import 'package:compiler/src/common/names.dart'; | 10 import 'package:compiler/src/common/names.dart'; |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 ResolutionWorldImpactBuilder builder = | 702 ResolutionWorldImpactBuilder builder = |
| 703 new ResolutionWorldImpactBuilder('Lax impact of ${element}'); | 703 new ResolutionWorldImpactBuilder('Lax impact of ${element}'); |
| 704 for (StaticUse staticUse in impact.staticUses) { | 704 for (StaticUse staticUse in impact.staticUses) { |
| 705 switch (staticUse.kind) { | 705 switch (staticUse.kind) { |
| 706 case StaticUseKind.CONSTRUCTOR_INVOKE: | 706 case StaticUseKind.CONSTRUCTOR_INVOKE: |
| 707 case StaticUseKind.CONST_CONSTRUCTOR_INVOKE: | 707 case StaticUseKind.CONST_CONSTRUCTOR_INVOKE: |
| 708 ConstructorElement constructor = staticUse.element; | 708 ConstructorElement constructor = staticUse.element; |
| 709 ConstructorElement effectiveTarget = constructor.effectiveTarget; | 709 ConstructorElement effectiveTarget = constructor.effectiveTarget; |
| 710 ResolutionDartType effectiveTargetType = | 710 ResolutionDartType effectiveTargetType = |
| 711 constructor.computeEffectiveTargetType(staticUse.type); | 711 constructor.computeEffectiveTargetType(staticUse.type); |
| 712 ConstructorElement effectiveTargetDeclaration = |
| 713 effectiveTarget.declaration; |
| 712 builder.registerStaticUse( | 714 builder.registerStaticUse( |
| 713 staticUse.kind == StaticUseKind.CONST_CONSTRUCTOR_INVOKE | 715 staticUse.kind == StaticUseKind.CONST_CONSTRUCTOR_INVOKE |
| 714 ? new StaticUse.constConstructorInvoke( | 716 ? new StaticUse.constConstructorInvoke( |
| 715 effectiveTarget.declaration, null, effectiveTargetType) | 717 effectiveTargetDeclaration, null, effectiveTargetType) |
| 716 : new StaticUse.typedConstructorInvoke( | 718 : new StaticUse.typedConstructorInvoke( |
| 717 effectiveTarget.declaration, null, effectiveTargetType)); | 719 effectiveTargetDeclaration, null, effectiveTargetType)); |
| 718 break; | 720 break; |
| 719 default: | 721 default: |
| 720 builder.registerStaticUse(staticUse); | 722 builder.registerStaticUse(staticUse); |
| 721 break; | 723 break; |
| 722 } | 724 } |
| 723 } | 725 } |
| 724 impact.dynamicUses.forEach(builder.registerDynamicUse); | 726 impact.dynamicUses.forEach(builder.registerDynamicUse); |
| 725 for (TypeUse typeUse in impact.typeUses) { | 727 for (TypeUse typeUse in impact.typeUses) { |
| 726 builder.registerTypeUse( | 728 builder.registerTypeUse( |
| 727 new TypeUse.internal(unalias(typeUse.type), typeUse.kind)); | 729 new TypeUse.internal(unalias(typeUse.type), typeUse.kind)); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 visitList(type.optionalParameterTypes), | 825 visitList(type.optionalParameterTypes), |
| 824 type.namedParameters, | 826 type.namedParameters, |
| 825 visitList(type.namedParameterTypes)); | 827 visitList(type.namedParameterTypes)); |
| 826 } | 828 } |
| 827 } | 829 } |
| 828 | 830 |
| 829 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. | 831 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. |
| 830 ResolutionDartType unalias(ResolutionDartType type) { | 832 ResolutionDartType unalias(ResolutionDartType type) { |
| 831 return const Unaliaser().visit(type); | 833 return const Unaliaser().visit(type); |
| 832 } | 834 } |
| OLD | NEW |