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

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 18120)
+++ 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,10 +255,13 @@
return kind;
}
- bool applies(Element element, Compiler compiler)
- => appliesUntyped(element, compiler);
+ bool appliesUnnamed(Element element, Compiler compiler) {
+ assert(sameNameHack(element, compiler));
+ return appliesUntyped(element, compiler);
+ }
bool appliesUntyped(Element element, Compiler compiler) {
+ assert(sameNameHack(element, compiler));
if (Elements.isUnresolved(element)) return false;
if (name.isPrivate() && library != element.getLibrary()) return false;
if (element.isForeign(compiler)) return true;
@@ -301,7 +304,27 @@
}
}
+ bool sameNameHack(Element element, Compiler compiler) {
+ // TODO(ngeoffray): Remove workaround checks.
+ return element == compiler.assertMethod
+ || element.isConstructor()
+ || name == element.name;
+ }
+
+ bool applies(Element element, Compiler compiler) {
+ if (!sameNameHack(element, compiler)) 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 +470,8 @@
return false;
}
- bool applies(Element element, Compiler compiler) {
+ bool appliesUnnamed(Element element, Compiler compiler) {
+ assert(sameNameHack(element, compiler));
// [TypedSelector] are only used when compiling.
assert(compiler.phase == Compiler.PHASE_COMPILING);
if (!element.isMember()) return false;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/universe/selector_map.dart ('k') | tests/compiler/dart2js/interceptor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698