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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 996263002: Don't generate forwarding hooks if all noSuchMethod implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More tests Created 5 years, 9 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 | pkg/compiler/lib/src/enqueue.dart » ('j') | pkg/compiler/lib/src/enqueue.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index c26087dc10523cce49a3b4959a4d68b82c995ee3..6d65c50cd9960ada7fd49a5284d66dc71a783b2f 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -362,10 +362,20 @@ abstract class Backend {
void registerRuntimeType(Enqueuer enqueuer, Registry registry) {}
/**
+ * Call this to register a `noSuchMethod` implementation.
+ */
+ void registerNoSuchMethod(Element noSuchMethodElement, Enqueuer enqueuer) {
Johnni Winther 2015/03/16 14:20:43 Leave the default implementation empty. Only the J
Harry Terkelsen 2015/03/17 21:43:11 Done.
+ if (compiler.enabledNoSuchMethod) return;
+ if (isDefaultNoSuchMethodImplementation(noSuchMethodElement)) return;
+ enableNoSuchMethod(enqueuer);
+ compiler.enabledNoSuchMethod = true;
floitsch 2015/03/13 15:51:49 I would have expected this to be in `enableNoSuchM
Johnni Winther 2015/03/16 14:20:43 Add a TODO on Compiler.enabledNoSuchMethod to move
Harry Terkelsen 2015/03/17 21:43:11 It is just a flag that says if noSuchMethod suppor
Harry Terkelsen 2015/03/17 21:43:11 I just moved it
+ }
+
+ /**
* Call this method to enable [noSuchMethod] handling in the
* backend.
*/
- void enableNoSuchMethod(Element context, Enqueuer enqueuer) {
+ void enableNoSuchMethod(Enqueuer enqueuer) {
floitsch 2015/03/13 15:51:49 Can we remove this method? (or make it private)
Harry Terkelsen 2015/03/17 21:43:11 Done.
enqueuer.registerInvocation(compiler.noSuchMethodSelector);
}
@@ -1627,7 +1637,7 @@ abstract class Compiler implements DiagnosticListener {
backend.enableIsolateSupport(enqueuer.codegen);
}
if (enabledNoSuchMethod) {
- backend.enableNoSuchMethod(null, enqueuer.codegen);
+ backend.enableNoSuchMethod(enqueuer.codegen);
}
if (compileAll) {
libraryLoader.libraries.forEach((LibraryElement library) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/enqueue.dart » ('j') | pkg/compiler/lib/src/enqueue.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698