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

Unified Diff: pkg/compiler/lib/src/cps_ir/inline.dart

Issue 1779723002: dart2js cps: Inline constructor bodies that are only called once. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test expectation Created 4 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/cps_ir/expected/constructor_9.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/inline.dart
diff --git a/pkg/compiler/lib/src/cps_ir/inline.dart b/pkg/compiler/lib/src/cps_ir/inline.dart
index 08375a2468d6e1fbf3055306a47bbcbe1b24660b..076e809581579b6345116c7330d78b097dad0e82 100644
--- a/pkg/compiler/lib/src/cps_ir/inline.dart
+++ b/pkg/compiler/lib/src/cps_ir/inline.dart
@@ -185,6 +185,11 @@ class Inliner implements Pass {
Inliner(this.functionCompiler);
bool isCalledOnce(Element element) {
+ if (element is ConstructorBodyElement) {
+ ClassElement class_ = element.enclosingClass;
+ return !functionCompiler.compiler.world.hasAnyStrictSubclass(class_) &&
+ class_.constructors.tail?.isEmpty ?? false;
+ }
return functionCompiler.compiler.typesTask.typesInferrer.isCalledOnce(
element);
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/cps_ir/expected/constructor_9.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698