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 '../common.dart'; | 7 import '../common.dart'; |
8 import '../common_elements.dart'; | 8 import '../common_elements.dart'; |
9 import '../common/backend_api.dart'; | 9 import '../common/backend_api.dart'; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 MirrorsDataBuilder createMirrorsDataBuilder() { | 98 MirrorsDataBuilder createMirrorsDataBuilder() { |
99 return new MirrorsDataImpl( | 99 return new MirrorsDataImpl( |
100 _compiler, _compiler.options, _compiler.commonElements); | 100 _compiler, _compiler.options, _compiler.commonElements); |
101 } | 101 } |
102 | 102 |
103 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( | 103 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( |
104 JavaScriptBackend backend) => | 104 JavaScriptBackend backend) => |
105 new MirrorsResolutionAnalysisImpl(backend, _compiler.resolution); | 105 new MirrorsResolutionAnalysisImpl(backend, _compiler.resolution); |
106 | 106 |
107 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { | 107 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { |
108 return new RuntimeTypesNeedBuilderImpl(); | 108 return new ResolutionRuntimeTypesNeedBuilderImpl( |
| 109 elementEnvironment, _compiler.types); |
109 } | 110 } |
110 | 111 |
111 ResolutionWorldBuilder createResolutionWorldBuilder( | 112 ResolutionWorldBuilder createResolutionWorldBuilder( |
112 NativeBasicData nativeBasicData, | 113 NativeBasicData nativeBasicData, |
113 SelectorConstraintsStrategy selectorConstraintsStrategy) { | 114 SelectorConstraintsStrategy selectorConstraintsStrategy) { |
114 return new ElementResolutionWorldBuilder( | 115 return new ElementResolutionWorldBuilder( |
115 _compiler.backend, _compiler.resolution, selectorConstraintsStrategy); | 116 _compiler.backend, _compiler.resolution, selectorConstraintsStrategy); |
116 } | 117 } |
117 | 118 |
118 WorkItemBuilder createResolutionWorkItemBuilder( | 119 WorkItemBuilder createResolutionWorkItemBuilder( |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 return cls.thisType; | 223 return cls.thisType; |
223 } | 224 } |
224 | 225 |
225 @override | 226 @override |
226 ResolutionInterfaceType getRawType(ClassElement cls) { | 227 ResolutionInterfaceType getRawType(ClassElement cls) { |
227 cls.ensureResolved(_resolution); | 228 cls.ensureResolved(_resolution); |
228 return cls.rawType; | 229 return cls.rawType; |
229 } | 230 } |
230 | 231 |
231 @override | 232 @override |
| 233 bool isGenericClass(ClassEntity cls) { |
| 234 return getThisType(cls).typeArguments.isNotEmpty; |
| 235 } |
| 236 |
| 237 @override |
232 ResolutionDartType getTypeVariableBound(TypeVariableElement typeVariable) { | 238 ResolutionDartType getTypeVariableBound(TypeVariableElement typeVariable) { |
233 return typeVariable.bound; | 239 return typeVariable.bound; |
234 } | 240 } |
235 | 241 |
236 @override | 242 @override |
237 ResolutionInterfaceType createInterfaceType( | 243 ResolutionInterfaceType createInterfaceType( |
238 ClassElement cls, List<ResolutionDartType> typeArguments) { | 244 ClassElement cls, List<ResolutionDartType> typeArguments) { |
239 cls.ensureResolved(_resolution); | 245 cls.ensureResolved(_resolution); |
240 return cls.thisType.createInstantiation(typeArguments); | 246 return cls.thisType.createInstantiation(typeArguments); |
241 } | 247 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 610 } |
605 } | 611 } |
606 }); | 612 }); |
607 }); | 613 }); |
608 } | 614 } |
609 | 615 |
610 _compiler.libraryLoader.libraries | 616 _compiler.libraryLoader.libraries |
611 .forEach(processJsInteropAnnotationsInLibrary); | 617 .forEach(processJsInteropAnnotationsInLibrary); |
612 } | 618 } |
613 } | 619 } |
OLD | NEW |