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

Side by Side Diff: pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart

Issue 2603263002: Prefix resolution_types with Resolution. (Closed)
Patch Set: Rebased 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) 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 '../enqueue.dart' show Enqueuer; 9 import '../enqueue.dart' show Enqueuer;
10 import '../universe/use.dart' show StaticUse; 10 import '../universe/use.dart' show StaticUse;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 classElement.ensureResolved(compiler.resolution); 79 classElement.ensureResolved(compiler.resolution);
80 if (!backend.isNativeOrExtendsNative(classElement)) return; 80 if (!backend.isNativeOrExtendsNative(classElement)) return;
81 if (classElement.isMixinApplication) return; 81 if (classElement.isMixinApplication) return;
82 if (classElement.isAbstract) return; 82 if (classElement.isAbstract) return;
83 // JsInterop classes are opaque interfaces without a concrete 83 // JsInterop classes are opaque interfaces without a concrete
84 // implementation. 84 // implementation.
85 if (backend.isJsInterop(classElement)) return; 85 if (backend.isJsInterop(classElement)) return;
86 joinFor(forResolution: forResolution).instantiatedClasses.add(classElement); 86 joinFor(forResolution: forResolution).instantiatedClasses.add(classElement);
87 } 87 }
88 88
89 void registerTypeLiteral(DartType type) { 89 void registerTypeLiteral(ResolutionDartType type) {
90 if (type.isInterfaceType) { 90 if (type.isInterfaceType) {
91 // TODO(sra): If we had a flow query from the type literal expression to 91 // TODO(sra): If we had a flow query from the type literal expression to
92 // the Type argument of the metadata lookup, we could tell if this type 92 // the Type argument of the metadata lookup, we could tell if this type
93 // literal is really a demand for the metadata. 93 // literal is really a demand for the metadata.
94 resolutionJoin.selectedClasses.add(type.element); 94 resolutionJoin.selectedClasses.add(type.element);
95 } else if (type.isTypeVariable) { 95 } else if (type.isTypeVariable) {
96 // This is a type parameter of a parameterized class. 96 // This is a type parameter of a parameterized class.
97 // TODO(sra): Is there a way to determine which types are bound to the 97 // TODO(sra): Is there a way to determine which types are bound to the
98 // parameter? 98 // parameter?
99 resolutionJoin.allClassesSelected = true; 99 resolutionJoin.allClassesSelected = true;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 constant, impactBuilder, false); 182 constant, impactBuilder, false);
183 backend.addCompileTimeConstantForEmission(constant); 183 backend.addCompileTimeConstantForEmission(constant);
184 } 184 }
185 } 185 }
186 activeClasses.addAll(newActiveClasses); 186 activeClasses.addAll(newActiveClasses);
187 instantiatedClasses.removeAll(newActiveClasses); 187 instantiatedClasses.removeAll(newActiveClasses);
188 return impactBuilder.flush(); 188 return impactBuilder.flush();
189 } 189 }
190 190
191 TypeConstantValue makeTypeConstant(ClassElement element) { 191 TypeConstantValue makeTypeConstant(ClassElement element) {
192 DartType elementType = element.rawType; 192 ResolutionDartType elementType = element.rawType;
193 return backend.constantSystem.createType(compiler, elementType); 193 return backend.constantSystem.createType(compiler, elementType);
194 } 194 }
195 195
196 List<ConstructorElement> computeEscapingConstructors( 196 List<ConstructorElement> computeEscapingConstructors(
197 ClassElement classElement) { 197 ClassElement classElement) {
198 List<ConstructorElement> result = <ConstructorElement>[]; 198 List<ConstructorElement> result = <ConstructorElement>[];
199 // Only classes that extend native classes have constructors in the table. 199 // Only classes that extend native classes have constructors in the table.
200 // We could refine this to classes that extend Element, but that would break 200 // We could refine this to classes that extend Element, but that would break
201 // the tests and there is no sane reason to subclass other native classes. 201 // the tests and there is no sane reason to subclass other native classes.
202 if (backend.isNative(classElement)) return result; 202 if (backend.isNative(classElement)) return result;
203 203
204 void selectGenerativeConstructors(ClassElement enclosing, Element member) { 204 void selectGenerativeConstructors(ClassElement enclosing, Element member) {
205 if (member.isGenerativeConstructor) { 205 if (member.isGenerativeConstructor) {
206 // Ignore constructors that cannot be called with zero arguments. 206 // Ignore constructors that cannot be called with zero arguments.
207 ConstructorElement constructor = member; 207 ConstructorElement constructor = member;
208 constructor.computeType(compiler.resolution); 208 constructor.computeType(compiler.resolution);
209 FunctionSignature parameters = constructor.functionSignature; 209 FunctionSignature parameters = constructor.functionSignature;
210 if (parameters.requiredParameterCount == 0) { 210 if (parameters.requiredParameterCount == 0) {
211 result.add(member); 211 result.add(member);
212 } 212 }
213 } 213 }
214 } 214 }
215 215
216 classElement.forEachMember(selectGenerativeConstructors, 216 classElement.forEachMember(selectGenerativeConstructors,
217 includeBackendMembers: false, includeSuperAndInjectedMembers: false); 217 includeBackendMembers: false, includeSuperAndInjectedMembers: false);
218 return result; 218 return result;
219 } 219 }
220 } 220 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_system_javascript.dart ('k') | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698