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

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

Issue 14416014: After a dynamic call, refine the receiver type by looking at the potential targets of that call. (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
Index: sdk/lib/_internal/compiler/implementation/universe/function_set.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/universe/function_set.dart (revision 22031)
+++ sdk/lib/_internal/compiler/implementation/universe/function_set.dart (working copy)
@@ -44,6 +44,13 @@
: false;
}
+ Iterable<ClassElement> findTargets(Selector selector) {
+ SourceString name = selector.name;
+ FunctionSetNode node = nodes[name];
+ if (node == null) return const <ClassElement>[];
+ return node.query(selector, compiler, null).classes;
+ }
+
/**
* Returns an object that allows iterating over all the functions
* that may be invoked with the given [selector].
@@ -179,18 +186,21 @@
}
cache[selector] = result = (functions != null)
? newQuery(functions, selector, compiler)
- : const FunctionSetQuery(const <Element>[]);
+ : const FunctionSetQuery(const <Element>[],
+ const <ClassElement>[]);
return result;
}
FunctionSetQuery newQuery(List<Element> functions,
Selector selector,
Compiler compiler) {
- return new FunctionSetQuery(functions);
+ return new FunctionSetQuery(
+ functions, <ClassElement>[compiler.objectClass]);
}
}
class FunctionSetQuery {
final List<Element> functions;
- const FunctionSetQuery(this.functions);
+ final List<ClassElement> classes;
+ const FunctionSetQuery(this.functions, this.classes);
}

Powered by Google App Engine
This is Rietveld 408576698