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

Unified Diff: pkg/compiler/lib/src/enqueue.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: Return enum result for _categorizeImpl 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
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index e00b7502307ec18991bc98417fd171974ca51c46..adc2363c339717809225255e9c62132d680160fe 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) {
- enableNoSuchMethod(function);
+ registerNoSuchMethod(function);
}
if (function.name == Compiler.CALL_OPERATOR_NAME &&
!cls.typeVariables.isEmpty) {
@@ -212,7 +212,8 @@ abstract class Enqueuer {
.add(member);
}
- void enableNoSuchMethod(Element element) {}
+ void registerNoSuchMethod(Element noSuchMethod);
+
void enableIsolateSupport() {}
void processInstantiatedClass(ClassElement cls) {
@@ -736,19 +737,15 @@ 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.
*
@@ -806,6 +803,8 @@ class CodegenEnqueuer extends Enqueuer {
final Set<Selector> newlySeenSelectors;
+ bool enabledNoSuchMethod = false;
+
CodegenEnqueuer(Compiler compiler,
ItemCompilationContext itemCompilationContextCreator())
: queue = new Queue<CodegenWorkItem>(),
@@ -855,6 +854,13 @@ 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.');
}

Powered by Google App Engine
This is Rietveld 408576698