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

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

Issue 12087101: Turn getters and setters that we know are not intercepted into regular getter and setter calls. (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/universe.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/universe/universe.dart (revision 18037)
+++ sdk/lib/_internal/compiler/implementation/universe/universe.dart (working copy)
@@ -50,7 +50,7 @@
Compiler compiler) {
if (selectors == null) return false;
for (Selector selector in selectors) {
- if (selector.applies(member, compiler)) return true;
+ if (selector.appliesUnnamed(member, compiler)) return true;
}
return false;
}
@@ -255,7 +255,7 @@
return kind;
}
- bool applies(Element element, Compiler compiler)
+ bool appliesUnnamed(Element element, Compiler compiler)
=> appliesUntyped(element, compiler);
bool appliesUntyped(Element element, Compiler compiler) {
@@ -301,7 +301,23 @@
}
}
+ bool applies(Element element, Compiler compiler) {
+ // TODO(ngeoffray): Remove workaround checks.
+ if (element != compiler.assertMethod
+ && !element.isConstructor()
+ && name != element.name) return false;
+ return appliesUnnamed(element, compiler);
+ }
+
/**
+ * Fills [list] with the arguments in a defined order.
+ *
+ * [compileArgument] is a function that returns a compiled version
+ * of an argument located in [arguments].
+ *
+ * [compileConstant] is a function that returns a compiled constant
+ * of an optional argument that is not in [arguments.
+ *
* Returns [:true:] if the selector and the [element] match; [:false:]
* otherwise.
*
@@ -447,7 +463,7 @@
return false;
}
- bool applies(Element element, Compiler compiler) {
+ bool appliesUnnamed(Element element, Compiler compiler) {
// [TypedSelector] are only used when compiling.
kasperl 2013/02/04 13:39:03 Can we assert that the names are the same in here?
ngeoffray 2013/02/04 14:51:07 Done with a helper method sameNameHack, until we c
assert(compiler.phase == Compiler.PHASE_COMPILING);
if (!element.isMember()) return false;

Powered by Google App Engine
This is Rietveld 408576698