Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2644533002: Mostly use entities in use.dart (Closed)
Patch Set: Fixes Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« pkg/compiler/lib/src/universe/use.dart ('K') | « pkg/compiler/lib/src/universe/use.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698