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

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

Issue 1019903002: Revert "Don't generate forwarding hooks if all noSuchMethod implementations" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index adc2363c339717809225255e9c62132d680160fe..e00b7502307ec18991bc98417fd171974ca51c46 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -162,7 +162,7 @@ abstract class Enqueuer {
FunctionElement function = member;
function.computeSignature(compiler);
if (function.name == Compiler.NO_SUCH_METHOD) {
- registerNoSuchMethod(function);
+ enableNoSuchMethod(function);
}
if (function.name == Compiler.CALL_OPERATOR_NAME &&
!cls.typeVariables.isEmpty) {
@@ -212,8 +212,7 @@ abstract class Enqueuer {
.add(member);
}
- void registerNoSuchMethod(Element noSuchMethod);
-
+ void enableNoSuchMethod(Element element) {}
void enableIsolateSupport() {}
void processInstantiatedClass(ClassElement cls) {
@@ -737,15 +736,19 @@ class ResolutionEnqueuer extends Enqueuer {
return true;
}
- void registerNoSuchMethod(Element element) {
- compiler.backend.registerNoSuchMethod(element);
- }
-
void enableIsolateSupport() {
compiler.hasIsolateSupport = true;
compiler.backend.enableIsolateSupport(this);
}
+ void enableNoSuchMethod(Element element) {
+ if (compiler.enabledNoSuchMethod) return;
+ if (compiler.backend.isDefaultNoSuchMethodImplementation(element)) return;
+
+ compiler.enabledNoSuchMethod = true;
+ compiler.backend.enableNoSuchMethod(element, this);
+ }
+
/**
* Adds an action to the deferred task queue.
*
@@ -803,8 +806,6 @@ class CodegenEnqueuer extends Enqueuer {
final Set<Selector> newlySeenSelectors;
- bool enabledNoSuchMethod = false;
-
CodegenEnqueuer(Compiler compiler,
ItemCompilationContext itemCompilationContextCreator())
: queue = new Queue<CodegenWorkItem>(),
@@ -854,13 +855,6 @@ class CodegenEnqueuer extends Enqueuer {
return true;
}
- void registerNoSuchMethod(Element element) {
- if (!enabledNoSuchMethod && compiler.backend.enabledNoSuchMethod) {
- compiler.backend.enableNoSuchMethod(this);
- enabledNoSuchMethod = true;
- }
- }
-
void _logSpecificSummary(log(message)) {
log('Compiled ${generatedCode.length} methods.');
}
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698