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

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

Issue 12211013: Allow intercepted calls to have typed selectors. (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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/enqueue.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/enqueue.dart (revision 18164)
+++ sdk/lib/_internal/compiler/implementation/enqueue.dart (working copy)
@@ -319,8 +319,26 @@
registerInvocation(methodName, selector);
}
- void registerDynamicInvocationOf(Element element) {
- addToWorkList(element);
+ void registerDynamicInvocationOf(Element element, Selector selector) {
+ assert(selector.isCall()
+ || selector.isOperator()
+ || selector.isIndex()
+ || selector.isIndexSet());
+ if (element.isFunction()) {
+ addToWorkList(element);
+ } else if (element.isAbstractField()) {
+ AbstractFieldElement field = element;
+ // Since the invocation is a dynamic call on a getter, we only
+ // need to schedule the getter on the work list.
+ addToWorkList(field.getter);
+ } else {
+ assert(element.isField());
+ }
+ // We also need to add the selector to the invoked names map,
+ // because the emitter uses that map to generate parameter stubs.
+ Set<Selector> selectors = universe.invokedNames.putIfAbsent(
+ element.name, () => new Set<Selector>());
+ selectors.add(selector);
}
void registerDynamicGetter(SourceString methodName, Selector selector) {
@@ -445,12 +463,12 @@
void enableNoSuchMethod(Element element) {
if (compiler.enabledNoSuchMethod) return;
+ Selector selector = new Selector.noSuchMethod();
if (identical(element.getEnclosingClass(), compiler.objectClass)) {
- registerDynamicInvocationOf(element);
+ registerDynamicInvocationOf(element, selector);
return;
}
compiler.enabledNoSuchMethod = true;
- Selector selector = new Selector.noSuchMethod();
registerInvocation(Compiler.NO_SUCH_METHOD, selector);
compiler.createInvocationMirrorElement =
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698