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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.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
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 08fa0a74db29be482239a6f7e62b6111c4bfc36d..1af1fd46cd1b719c4399db04621d48ed8e7639d4 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -585,6 +585,9 @@ class JavaScriptBackend extends Backend {
/// constructors for custom elements.
CustomElementsAnalysis customElementsAnalysis;
+ /// Support for classifying `noSuchMethod` implementations.
+ NoSuchMethodAnalysis noSuchMethodAnalysis;
+
JavaScriptConstantTask constantCompilerTask;
JavaScriptResolutionCallbacks resolutionCallbacks;
@@ -603,6 +606,7 @@ class JavaScriptBackend extends Backend {
emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
typeVariableHandler = new TypeVariableHandler(this);
customElementsAnalysis = new CustomElementsAnalysis(this);
+ noSuchMethodAnalysis = new NoSuchMethodAnalysis(this);
constantCompilerTask = new JavaScriptConstantTask(compiler);
resolutionCallbacks = new JavaScriptResolutionCallbacks(this);
patchResolverTask = new PatchResolverTask(compiler);
@@ -1206,11 +1210,13 @@ class JavaScriptBackend extends Backend {
enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, registry);
}
- void enableNoSuchMethod(Element context, Enqueuer world) {
+ void registerNoSuchMethod(Element noSuchMethod, Enqueuer enqueuer) {
+ noSuchMethodAnalysis.registerNoSuchMethod(noSuchMethod);
+ }
+
+ void enableNoSuchMethod(Enqueuer world) {
enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies);
world.registerInvocation(compiler.noSuchMethodSelector);
- // TODO(tyoverby): Send the context element to DumpInfoTask to be
- // blamed.
}
void enableIsolateSupport(Enqueuer enqueuer) {
@@ -2399,6 +2405,8 @@ class JavaScriptBackend extends Backend {
customElementsAnalysis.onQueueEmpty(enqueuer);
if (!enqueuer.queueIsEmpty) return false;
+ noSuchMethodAnalysis.onQueueEmpty(enqueuer);
+
if (compiler.hasIncrementalSupport) {
// Always enable tear-off closures during incremental compilation.
Element e = findHelper('closureFromTearOff');

Powered by Google App Engine
This is Rietveld 408576698