| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import '../compiler.dart' show Compiler; | 5 import '../compiler.dart' show Compiler; |
| 6 import '../constants/values.dart'; | 6 import '../constants/values.dart'; |
| 7 import '../elements/resolution_types.dart'; | 7 import '../elements/resolution_types.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../universe/use.dart' show StaticUse; | 9 import '../universe/use.dart' show StaticUse; |
| 10 import '../universe/world_impact.dart' | 10 import '../universe/world_impact.dart' |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 resolutionJoin.allClassesSelected = true; | 69 resolutionJoin.allClassesSelected = true; |
| 70 codegenJoin.allClassesSelected = true; | 70 codegenJoin.allClassesSelected = true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 CustomElementsAnalysisJoin joinFor({bool forResolution}) => | 73 CustomElementsAnalysisJoin joinFor({bool forResolution}) => |
| 74 forResolution ? resolutionJoin : codegenJoin; | 74 forResolution ? resolutionJoin : codegenJoin; |
| 75 | 75 |
| 76 void registerInstantiatedClass(ClassElement classElement, | 76 void registerInstantiatedClass(ClassElement classElement, |
| 77 {bool forResolution}) { | 77 {bool forResolution}) { |
| 78 classElement.ensureResolved(compiler.resolution); | 78 classElement.ensureResolved(compiler.resolution); |
| 79 if (!backend.isNativeOrExtendsNative(classElement)) return; | 79 if (!backend.nativeData.isNativeOrExtendsNative(classElement)) return; |
| 80 if (classElement.isMixinApplication) return; | 80 if (classElement.isMixinApplication) return; |
| 81 if (classElement.isAbstract) return; | 81 if (classElement.isAbstract) return; |
| 82 // JsInterop classes are opaque interfaces without a concrete | 82 // JsInterop classes are opaque interfaces without a concrete |
| 83 // implementation. | 83 // implementation. |
| 84 if (backend.isJsInterop(classElement)) return; | 84 if (backend.isJsInterop(classElement)) return; |
| 85 joinFor(forResolution: forResolution).instantiatedClasses.add(classElement); | 85 joinFor(forResolution: forResolution).instantiatedClasses.add(classElement); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void registerTypeLiteral(ResolutionDartType type) { | 88 void registerTypeLiteral(ResolutionDartType type) { |
| 89 if (type.isInterfaceType) { | 89 if (type.isInterfaceType) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 final activeClasses = new Set<ClassElement>(); | 152 final activeClasses = new Set<ClassElement>(); |
| 153 | 153 |
| 154 CustomElementsAnalysisJoin(this.backend); | 154 CustomElementsAnalysisJoin(this.backend); |
| 155 | 155 |
| 156 WorldImpact flush() { | 156 WorldImpact flush() { |
| 157 if (!demanded) return const WorldImpact(); | 157 if (!demanded) return const WorldImpact(); |
| 158 var newActiveClasses = new Set<ClassElement>(); | 158 var newActiveClasses = new Set<ClassElement>(); |
| 159 for (ClassElement classElement in instantiatedClasses) { | 159 for (ClassElement classElement in instantiatedClasses) { |
| 160 bool isNative = backend.isNative(classElement); | 160 bool isNative = backend.isNative(classElement); |
| 161 bool isExtension = | 161 bool isExtension = |
| 162 !isNative && backend.isNativeOrExtendsNative(classElement); | 162 !isNative && backend.nativeData.isNativeOrExtendsNative(classElement); |
| 163 // Generate table entries for native classes that are explicitly named and | 163 // Generate table entries for native classes that are explicitly named and |
| 164 // extensions that fix our criteria. | 164 // extensions that fix our criteria. |
| 165 if ((isNative && selectedClasses.contains(classElement)) || | 165 if ((isNative && selectedClasses.contains(classElement)) || |
| 166 (isExtension && | 166 (isExtension && |
| 167 (allClassesSelected || selectedClasses.contains(classElement)))) { | 167 (allClassesSelected || selectedClasses.contains(classElement)))) { |
| 168 newActiveClasses.add(classElement); | 168 newActiveClasses.add(classElement); |
| 169 Iterable<ConstructorElement> escapingConstructors = | 169 Iterable<ConstructorElement> escapingConstructors = |
| 170 computeEscapingConstructors(classElement); | 170 computeEscapingConstructors(classElement); |
| 171 for (ConstructorElement constructor in escapingConstructors) { | 171 for (ConstructorElement constructor in escapingConstructors) { |
| 172 impactBuilder | 172 impactBuilder |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 result.add(member); | 210 result.add(member); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 classElement.forEachMember(selectGenerativeConstructors, | 215 classElement.forEachMember(selectGenerativeConstructors, |
| 216 includeBackendMembers: false, includeSuperAndInjectedMembers: false); | 216 includeBackendMembers: false, includeSuperAndInjectedMembers: false); |
| 217 return result; | 217 return result; |
| 218 } | 218 } |
| 219 } | 219 } |
| OLD | NEW |