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

Unified Diff: sdk/lib/_internal/compiler/implementation/universe/function_set.dart

Issue 12207081: Add a type kind to TypedSelector. A typed selector can either be (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/universe/function_set.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/universe/function_set.dart (revision 18306)
+++ sdk/lib/_internal/compiler/implementation/universe/function_set.dart (working copy)
@@ -37,13 +37,19 @@
: false;
}
+ bool shouldVisitAll(Selector selector) {
+ return containsInterfaceSubtypes
+ && (selector.typeKind == TypedSelectorKind.INTERFACE
+ || selector.typeKind == TypedSelectorKind.UNKNOWN);
+ }
+
/**
* Returns all elements that may be invoked with the given [selector].
*/
Set<Element> filterBySelector(Selector selector) {
// TODO(kasperl): For now, we use a different implementation for
// filtering if the tree contains interface subtypes.
- return containsInterfaceSubtypes
+ return shouldVisitAll(selector)
? filterAllBySelector(selector)
: filterHierarchyBySelector(selector);
}
@@ -55,7 +61,7 @@
bool hasAnyElementMatchingSelector(Selector selector) {
// TODO(kasperl): For now, we use a different implementation for
// filtering if the tree contains interface subtypes.
- return containsInterfaceSubtypes
+ return shouldVisitAll(selector)
? hasAnyInAll(selector)
: hasAnyInHierarchy(selector);
}

Powered by Google App Engine
This is Rietveld 408576698