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

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

Issue 2392943003: Handle const constructor invocation in kernel_impact. (Closed)
Patch Set: Created 4 years, 2 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 bf9c1ab7b4190114223e2daefac81fe1f8e8c019..eeefe580d6703274a722ceff70f73c06092bc009 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -2951,14 +2951,21 @@ class JavaScriptImpactTransformer extends ImpactTransformer {
}
for (StaticUse staticUse in worldImpact.staticUses) {
- if (staticUse.kind == StaticUseKind.CLOSURE) {
- registerBackendImpact(transformed, impacts.closure);
- LocalFunctionElement closure = staticUse.element;
- if (closure.type.containsTypeVariables) {
- resolutionEnqueuer.universe.closuresWithFreeTypeVariables
- .add(closure);
- registerBackendImpact(transformed, impacts.computeSignature);
- }
+ switch (staticUse.kind) {
+ case StaticUseKind.CLOSURE:
+ registerBackendImpact(transformed, impacts.closure);
+ LocalFunctionElement closure = staticUse.element;
+ if (closure.type.containsTypeVariables) {
+ resolutionEnqueuer.universe.closuresWithFreeTypeVariables
+ .add(closure);
+ registerBackendImpact(transformed, impacts.computeSignature);
+ }
+ break;
+ case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+ case StaticUseKind.CONSTRUCTOR_INVOKE:
+ registerRequiredType(staticUse.type);
+ break;
+ default:
}
}
@@ -3144,11 +3151,18 @@ class JavaScriptImpactTransformer extends ImpactTransformer {
}
for (StaticUse staticUse in impact.staticUses) {
- if (staticUse.kind == StaticUseKind.CLOSURE) {
- LocalFunctionElement closure = staticUse.element;
- if (backend.methodNeedsRti(closure)) {
- registerBackendImpact(transformed, impacts.computeSignature);
- }
+ switch (staticUse.kind) {
+ case StaticUseKind.CLOSURE:
+ LocalFunctionElement closure = staticUse.element;
+ if (backend.methodNeedsRti(closure)) {
+ registerBackendImpact(transformed, impacts.computeSignature);
+ }
+ break;
+ case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
+ case StaticUseKind.CONSTRUCTOR_INVOKE:
+ backend.lookupMapAnalysis.registerInstantiatedType(staticUse.type);
Harry Terkelsen 2016/10/07 15:53:21 just a heads up: I think we are planning to remove
Johnni Winther 2016/10/10 09:58:12 Acknowledged.
+ break;
+ default:
}
}

Powered by Google App Engine
This is Rietveld 408576698