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

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

Issue 368593002: Register the constructors of custom elements for deferred loading (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 | « no previous file | tests/compiler/dart2js/deferred_custom_element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart b/sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart
index 3a255997638c365a67ad2af5e0ec2d010d943521..695edbb19dd102a6f8448f608e43f7da686cb229 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart
@@ -119,7 +119,7 @@ class CustomElementsAnalysis {
codegenJoin.activeClasses.contains(classElement);
List<Element> constructors(ClassElement classElement) =>
- codegenJoin.escapingConstructors(classElement);
+ codegenJoin.computeEscapingConstructors(classElement);
}
@@ -158,7 +158,11 @@ class CustomElementsAnalysisJoin {
(isExtension &&
(allClassesSelected || selectedClasses.contains(classElement)))) {
newActiveClasses.add(classElement);
- escapingConstructors(classElement).forEach(enqueuer.registerStaticUse);
+ Iterable<Element> escapingConstructors =
+ computeEscapingConstructors(classElement);
+ escapingConstructors.forEach(enqueuer.registerStaticUse);
+ escapingConstructors
+ .forEach(compiler.globalDependencies.registerDependency);
// Force the generaton of the type constant that is the key to an entry
// in the generated table.
Constant constant = makeTypeConstant(classElement);
@@ -177,7 +181,7 @@ class CustomElementsAnalysisJoin {
return new TypeConstant(elementType, constantType);
}
- List<Element> escapingConstructors(ClassElement classElement) {
+ List<Element> computeEscapingConstructors(ClassElement classElement) {
List<Element> result = <Element>[];
// Only classes that extend native classes have constructors in the table.
// We could refine this to classes that extend Element, but that would break
« no previous file with comments | « no previous file | tests/compiler/dart2js/deferred_custom_element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698