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

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

Issue 1413613010: Normalize type masks to use the least upper instantiated subclass/type. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix try/poi Created 5 years, 1 month 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 7 import '../common/names.dart' show
8 Identifiers, 8 Identifiers,
9 Selectors; 9 Selectors;
10 import '../compiler.dart' show 10 import '../compiler.dart' show
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 assert(classWorld.hasAnyStrictSubclass(classWorld.objectClass)); 291 assert(classWorld.hasAnyStrictSubclass(classWorld.objectClass));
292 if (_mask != null) return _mask; 292 if (_mask != null) return _mask;
293 return _mask = new TypeMask.unionOf(functions 293 return _mask = new TypeMask.unionOf(functions
294 .expand((element) { 294 .expand((element) {
295 ClassElement cls = element.enclosingClass; 295 ClassElement cls = element.enclosingClass;
296 return [cls]..addAll(classWorld.mixinUsesOf(cls)); 296 return [cls]..addAll(classWorld.mixinUsesOf(cls));
297 }) 297 })
298 .map((cls) { 298 .map((cls) {
299 if (classWorld.backend.isNullImplementation(cls)) { 299 if (classWorld.backend.isNullImplementation(cls)) {
300 return const TypeMask.empty(); 300 return const TypeMask.empty();
301 } else if (classWorld.isInstantiated(cls.declaration)) {
302 return new TypeMask.nonNullSubclass(cls.declaration, classWorld);
301 } else { 303 } else {
302 return new TypeMask.nonNullSubclass(cls.declaration, classWorld); 304 // TODO(johnniwinther): Avoid the need for this case.
305 return const TypeMask.empty();
303 } 306 }
304 }), 307 }),
305 classWorld); 308 classWorld);
306 } 309 }
307 } 310 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/universe/class_set.dart ('k') | pkg/compiler/lib/src/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698