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

Unified Diff: sdk/lib/_internal/compiler/implementation/world.dart

Issue 14636002: Make TypeMask an interface and start hiding implementation details of FlatTypeMask. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/universe/universe.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/world.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/world.dart (revision 22167)
+++ sdk/lib/_internal/compiler/implementation/world.dart (working copy)
@@ -148,20 +148,10 @@
}
Element locateSingleElement(Selector selector) {
- Iterable<Element> targets = allFunctions.filter(selector);
- if (targets.length != 1) return null;
- Element result = targets.first;
- ClassElement enclosing = result.getEnclosingClass();
- // TODO(kasperl): Move this code to the type mask.
- ti.TypeMask mask = selector.mask;
- ClassElement receiverTypeElement = (mask == null || mask.base == null)
- ? compiler.objectClass
- : mask.base.element;
- // We only return the found element if it is guaranteed to be
- // implemented on the exact receiver type. It could be found in a
- // subclass or in an inheritance-wise unrelated class in case of
- // subtype selectors.
- return (receiverTypeElement.isSubclassOf(enclosing)) ? result : null;
+ ti.TypeMask mask = selector.mask == null
+ ? new ti.TypeMask.subclass(compiler.objectClass.rawType)
+ : selector.mask;
+ return mask.locateSingleElement(selector, compiler);
}
bool hasSingleMatch(Selector selector) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/universe/universe.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698