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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 340253003: Avoid counting custom elements as added due to mirrors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « sdk/lib/_internal/compiler/implementation/enqueue.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 57b0ffd3b884749d2281bdfabfc8f755f70cba76..05acc6a053ddfb8870c97b032c774f829076ee38 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1899,6 +1899,11 @@ class JavaScriptBackend extends Backend {
/// Called when [enqueuer] is empty, but before it is closed.
void onQueueEmpty(Enqueuer enqueuer) {
+ // Add elements referenced only via custom elements. Return early if any
+ // elements are added to avoid counting the elements as due to mirrors.
+ customElementsAnalysis.onQueueEmpty(enqueuer);
+ if (!enqueuer.queueIsEmpty) return;
+
if (!enqueuer.isResolutionQueue && preMirrorsMethodCount == 0) {
preMirrorsMethodCount = generatedCode.length;
}
@@ -1924,8 +1929,6 @@ class JavaScriptBackend extends Backend {
}
metadataConstants.clear();
}
-
- customElementsAnalysis.onQueueEmpty(enqueuer);
}
void onElementResolved(Element element, TreeElements elements) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/enqueue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698