| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.resolution_strategy; | 5 library dart2js.resolution_strategy; |
| 6 | 6 |
| 7 import 'package:front_end/src/fasta/scanner.dart' show Token; | 7 import 'package:front_end/src/fasta/scanner.dart' show Token; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common_elements.dart'; | 10 import '../common_elements.dart'; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 import '../js_backend/backend_usage.dart'; | 27 import '../js_backend/backend_usage.dart'; |
| 28 import '../js_backend/interceptor_data.dart'; | 28 import '../js_backend/interceptor_data.dart'; |
| 29 import '../js_backend/mirrors_analysis.dart'; | 29 import '../js_backend/mirrors_analysis.dart'; |
| 30 import '../js_backend/mirrors_data.dart'; | 30 import '../js_backend/mirrors_data.dart'; |
| 31 import '../js_backend/native_data.dart'; | 31 import '../js_backend/native_data.dart'; |
| 32 import '../js_backend/no_such_method_registry.dart'; | 32 import '../js_backend/no_such_method_registry.dart'; |
| 33 import '../js_backend/runtime_types.dart'; | 33 import '../js_backend/runtime_types.dart'; |
| 34 import '../library_loader.dart'; | 34 import '../library_loader.dart'; |
| 35 import '../native/enqueue.dart' show NativeResolutionEnqueuer; | 35 import '../native/enqueue.dart' show NativeResolutionEnqueuer; |
| 36 import '../native/resolver.dart'; | 36 import '../native/resolver.dart'; |
| 37 import '../options.dart'; |
| 37 import '../tree/tree.dart' show Node; | 38 import '../tree/tree.dart' show Node; |
| 38 import '../serialization/task.dart'; | 39 import '../serialization/task.dart'; |
| 39 import '../patch_parser.dart'; | 40 import '../patch_parser.dart'; |
| 40 import '../resolved_uri_translator.dart'; | 41 import '../resolved_uri_translator.dart'; |
| 41 import '../universe/call_structure.dart'; | 42 import '../universe/call_structure.dart'; |
| 42 import '../universe/use.dart'; | 43 import '../universe/use.dart'; |
| 43 import '../universe/world_builder.dart'; | 44 import '../universe/world_builder.dart'; |
| 44 import '../universe/world_impact.dart'; | 45 import '../universe/world_impact.dart'; |
| 45 import 'no_such_method_resolver.dart'; | 46 import 'no_such_method_resolver.dart'; |
| 46 | 47 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 _compiler.reporter, | 102 _compiler.reporter, |
| 102 elementEnvironment, | 103 elementEnvironment, |
| 103 commonElements, | 104 commonElements, |
| 104 nativeBasicData); | 105 nativeBasicData); |
| 105 } | 106 } |
| 106 | 107 |
| 107 NoSuchMethodResolver createNoSuchMethodResolver() => | 108 NoSuchMethodResolver createNoSuchMethodResolver() => |
| 108 new ResolutionNoSuchMethodResolver(); | 109 new ResolutionNoSuchMethodResolver(); |
| 109 | 110 |
| 110 MirrorsDataBuilder createMirrorsDataBuilder() { | 111 MirrorsDataBuilder createMirrorsDataBuilder() { |
| 111 return new MirrorsDataImpl( | 112 return new ResolutionMirrorsData( |
| 112 _compiler, _compiler.options, elementEnvironment, commonElements); | 113 _compiler, _compiler.options, elementEnvironment, commonElements); |
| 113 } | 114 } |
| 114 | 115 |
| 115 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( | 116 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( |
| 116 JavaScriptBackend backend) => | 117 JavaScriptBackend backend) => |
| 117 new MirrorsResolutionAnalysisImpl(backend, _compiler.resolution); | 118 new MirrorsResolutionAnalysisImpl(backend, _compiler.resolution); |
| 118 | 119 |
| 119 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { | 120 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { |
| 120 return new ResolutionRuntimeTypesNeedBuilderImpl( | 121 return new ResolutionRuntimeTypesNeedBuilderImpl( |
| 121 elementEnvironment, dartTypes); | 122 elementEnvironment, dartTypes); |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 @override | 930 @override |
| 930 WorkItem createWorkItem(MemberElement element) { | 931 WorkItem createWorkItem(MemberElement element) { |
| 931 assert(element.isDeclaration, failedAt(element)); | 932 assert(element.isDeclaration, failedAt(element)); |
| 932 if (element.isMalformed) return null; | 933 if (element.isMalformed) return null; |
| 933 | 934 |
| 934 assert(element is AnalyzableElement, | 935 assert(element is AnalyzableElement, |
| 935 failedAt(element, 'Element $element is not analyzable.')); | 936 failedAt(element, 'Element $element is not analyzable.')); |
| 936 return _resolution.createWorkItem(element); | 937 return _resolution.createWorkItem(element); |
| 937 } | 938 } |
| 938 } | 939 } |
| 940 |
| 941 class ResolutionMirrorsData extends MirrorsDataImpl { |
| 942 ResolutionMirrorsData(Compiler compiler, CompilerOptions options, |
| 943 ElementEnvironment elementEnvironment, CommonElements commonElements) |
| 944 : super(compiler, options, elementEnvironment, commonElements); |
| 945 |
| 946 @override |
| 947 bool isClassInjected(covariant ClassElement cls) => cls.isInjected; |
| 948 |
| 949 @override |
| 950 bool isClassResolved(covariant ClassElement cls) => cls.isResolved; |
| 951 |
| 952 @override |
| 953 void forEachConstructor( |
| 954 covariant ClassElement cls, void f(ConstructorEntity constructor)) { |
| 955 cls.constructors.forEach((Element _constructor) { |
| 956 ConstructorElement constructor = _constructor; |
| 957 f(constructor); |
| 958 }); |
| 959 } |
| 960 } |
| OLD | NEW |