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

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

Issue 10825337: Add name and library to selectors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: lib/compiler/implementation/enqueue.dart
diff --git a/lib/compiler/implementation/enqueue.dart b/lib/compiler/implementation/enqueue.dart
index dea729d2b454e28546c5d52172704028b31b9a18..9baba70246f4c2c4909e1a3e1806f3a4d9f816c2 100644
--- a/lib/compiler/implementation/enqueue.dart
+++ b/lib/compiler/implementation/enqueue.dart
@@ -152,8 +152,13 @@ class Enqueuer {
Set<Selector> invokedSelectors = universe.invokedNames[name];
if (invokedSelectors != null) {
for (Selector selector in invokedSelectors) {
+ Selector call = new Selector.call(
+ compiler.namer.CLOSURE_INVOCATION_NAME,
+ selector.library, // TODO(kasperl): Use default library somehow?
+ selector.argumentCount,
+ selector.namedArguments);
registerDynamicInvocation(compiler.namer.CLOSURE_INVOCATION_NAME,
- selector);
+ call);
}
}
}
@@ -224,6 +229,10 @@ class Enqueuer {
void registerNewSelector(SourceString name,
Selector selector,
Map<SourceString, Set<Selector>> selectorsMap) {
+ if (name != selector.name) {
+ String message = "$name != ${selector.name} (${selector.kind})";
+ compiler.internalError("Wrong selector name: $message.");
+ }
Set<Selector> selectors =
selectorsMap.putIfAbsent(name, () => new Set<Selector>());
if (!selectors.contains(selector)) {
@@ -298,18 +307,24 @@ class Enqueuer {
registerInvokedSetter(methodName, selector);
}
- void registerFieldGetter(SourceString getterName, Type type) {
+ void registerFieldGetter(SourceString getterName,
+ LibraryElement library,
+ Type type) {
task.measure(() {
+ Selector getter = new Selector.getter(getterName, library);
registerNewSelector(getterName,
- new TypedSelector(type, Selector.GETTER),
+ new TypedSelector(type, getter),
universe.fieldGetters);
});
}
- void registerFieldSetter(SourceString setterName, Type type) {
+ void registerFieldSetter(SourceString setterName,
+ LibraryElement library,
+ Type type) {
task.measure(() {
+ Selector setter = new Selector.setter(setterName, library);
registerNewSelector(setterName,
- new TypedSelector(type, Selector.SETTER),
+ new TypedSelector(type, setter),
universe.fieldSetters);
});
}

Powered by Google App Engine
This is Rietveld 408576698