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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1109033002: dart2js: Do not emit closure classes if their instantiation is dead code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index ac17c4787e1a39f41c232ca4e4533142e62071ac..75bab2ac4b82d1130034dc473a70a1d32c6c5c3c 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1816,6 +1816,12 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
push(new js.New(jsClassReference, arguments), node);
registerForeignTypes(node);
+ // We also use ForeignNew to instantiate closure classes that belong to
+ // function expressions. We have to register their use here, as otherwise
+ // code for them might not be emitted.
+ if (node.element.isClosure) {
+ registry.registerInstantiatedClass(node.element);
+ }
if (node.instantiatedTypes == null) {
return;
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698