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

Side by Side Diff: pkg/compiler/lib/src/universe/function_set.dart

Issue 2659883002: Use entities in BackendClasses (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 universe.function_set; 5 library universe.function_set;
6 6
7 import '../common/names.dart' show Identifiers, Selectors; 7 import '../common/names.dart' show Identifiers, Selectors;
8 import '../elements/elements.dart' show MemberElement; 8 import '../elements/elements.dart' show MemberElement;
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../types/types.dart'; 10 import '../types/types.dart';
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 @override 291 @override
292 TypeMask computeMask(ClosedWorld closedWorld) { 292 TypeMask computeMask(ClosedWorld closedWorld) {
293 assert(closedWorld 293 assert(closedWorld
294 .hasAnyStrictSubclass(closedWorld.commonElements.objectClass)); 294 .hasAnyStrictSubclass(closedWorld.commonElements.objectClass));
295 if (_mask != null) return _mask; 295 if (_mask != null) return _mask;
296 return _mask = new TypeMask.unionOf( 296 return _mask = new TypeMask.unionOf(
297 functions.expand((MemberElement element) { 297 functions.expand((MemberElement element) {
298 ClassEntity cls = element.enclosingClass; 298 ClassEntity cls = element.enclosingClass;
299 return [cls]..addAll(closedWorld.mixinUsesOf(cls)); 299 return [cls]..addAll(closedWorld.mixinUsesOf(cls));
300 }).map((cls) { 300 }).map((cls) {
301 if (closedWorld.backendClasses.nullImplementation == cls) { 301 if (closedWorld.backendClasses.nullClass == cls) {
302 return const TypeMask.empty(); 302 return const TypeMask.empty();
303 } else if (closedWorld.isInstantiated(cls)) { 303 } else if (closedWorld.isInstantiated(cls)) {
304 return new TypeMask.nonNullSubclass(cls, closedWorld); 304 return new TypeMask.nonNullSubclass(cls, closedWorld);
305 } else { 305 } else {
306 // TODO(johnniwinther): Avoid the need for this case. 306 // TODO(johnniwinther): Avoid the need for this case.
307 return const TypeMask.empty(); 307 return const TypeMask.empty();
308 } 308 }
309 }), 309 }),
310 closedWorld); 310 closedWorld);
311 } 311 }
312 } 312 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/types/masks.dart ('k') | tests/compiler/dart2js/field_type_simple_inferer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698