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

Unified Diff: pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart

Issue 1424923004: Add StaticUse for more precise registration of statically known element use. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month 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/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
diff --git a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
index 24c0d3312b4a5070dafb9adfef3a18ae36f81371..1a5e287073646c42f05b507cc48e7fe130eb0379 100644
--- a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
@@ -156,9 +156,11 @@ class CustomElementsAnalysisJoin {
(isExtension &&
(allClassesSelected || selectedClasses.contains(classElement)))) {
newActiveClasses.add(classElement);
- Iterable<Element> escapingConstructors =
+ Iterable<ConstructorElement> escapingConstructors =
computeEscapingConstructors(classElement);
- escapingConstructors.forEach(enqueuer.registerStaticUse);
+ for (ConstructorElement constructor in escapingConstructors) {
+ enqueuer.registerStaticUse(new StaticUse.foreignUse(constructor));
+ }
escapingConstructors
.forEach(compiler.globalDependencies.registerDependency);
// Force the generaton of the type constant that is the key to an entry
@@ -178,17 +180,18 @@ class CustomElementsAnalysisJoin {
return backend.constantSystem.createType(compiler, elementType);
}
- List<Element> computeEscapingConstructors(ClassElement classElement) {
- List<Element> result = <Element>[];
+ List<ConstructorElement> computeEscapingConstructors(
+ ClassElement classElement) {
+ List<ConstructorElement> result = <ConstructorElement>[];
// Only classes that extend native classes have constructors in the table.
// We could refine this to classes that extend Element, but that would break
// the tests and there is no sane reason to subclass other native classes.
if (backend.isNative(classElement)) return result;
- selectGenerativeConstructors(ClassElement enclosing, Element member) {
+ void selectGenerativeConstructors(ClassElement enclosing, Element member) {
if (member.isGenerativeConstructor) {
// Ignore constructors that cannot be called with zero arguments.
- FunctionElement constructor = member;
+ ConstructorElement constructor = member;
constructor.computeType(compiler.resolution);
FunctionSignature parameters = constructor.functionSignature;
if (parameters.requiredParameterCount == 0) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698