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

Side by Side Diff: pkg/compiler/lib/src/types/flat_type_mask.dart

Issue 1431513010: Revert "Normalize type masks to use the least upper instantiated subclass/type." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/types/type_mask.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of types; 5 part of types;
6 6
7 /** 7 /**
8 * A flat type mask is a type mask that has been flattened to contain a 8 * A flat type mask is a type mask that has been flattened to contain a
9 * base type. 9 * base type.
10 */ 10 */
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 || classWorld.hasAnySubclassThatMixes(mixinApplication, other)); 539 || classWorld.hasAnySubclassThatMixes(mixinApplication, other));
540 } 540 }
541 } 541 }
542 542
543 /** 543 /**
544 * Returns whether a [selector] call on an instance of [cls] 544 * Returns whether a [selector] call on an instance of [cls]
545 * will hit a method at runtime, and not go through [noSuchMethod]. 545 * will hit a method at runtime, and not go through [noSuchMethod].
546 */ 546 */
547 static bool hasConcreteMatch(ClassElement cls, 547 static bool hasConcreteMatch(ClassElement cls,
548 Selector selector, 548 Selector selector,
549 ClassWorld world) { 549 World world) {
550 assert(invariant(cls, world.isInstantiated(cls), 550 assert(invariant(cls,
551 world.compiler.resolverWorld.isInstantiated(cls),
551 message: '$cls has not been instantiated.')); 552 message: '$cls has not been instantiated.'));
552 Element element = findMatchIn(cls, selector); 553 Element element = findMatchIn(cls, selector);
553 if (element == null) return false; 554 if (element == null) return false;
554 555
555 if (element.isAbstract) { 556 if (element.isAbstract) {
556 ClassElement enclosingClass = element.enclosingClass; 557 ClassElement enclosingClass = element.enclosingClass;
557 return hasConcreteMatch(enclosingClass.superclass, selector, world); 558 return hasConcreteMatch(enclosingClass.superclass, selector, world);
558 } 559 }
559 return selector.appliesUntyped(element, world); 560 return selector.appliesUntyped(element, world);
560 } 561 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 if (x.isExact) { 704 if (x.isExact) {
704 return null; 705 return null;
705 } else if (x.isSubclass) { 706 } else if (x.isSubclass) {
706 return classWorld.strictSubclassesOf(element); 707 return classWorld.strictSubclassesOf(element);
707 } else { 708 } else {
708 assert(x.isSubtype); 709 assert(x.isSubtype);
709 return classWorld.strictSubtypesOf(element); 710 return classWorld.strictSubtypesOf(element);
710 } 711 }
711 } 712 }
712 } 713 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/types/type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698