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

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

Issue 1083043002: cps-ir: Register instantiated type at InvokeConstructor. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index f87435da32f0285130691e0fc077023619ca6da2..fe66f5bcda6c3057f8d800569909e36271dcd867 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -239,8 +239,7 @@ class CodeGenerator extends tree_ir.StatementVisitor
checkStaticTargetIsValid(node, node.target);
if (node.constant != null) return giveup(node);
- ClassElement instantiatedClass = node.target.enclosingClass;
- registry.registerInstantiatedClass(instantiatedClass);
+ registry.registerInstantiatedType(node.type);
Selector selector = node.selector;
FunctionElement target = node.target;
List<js.Expression> arguments = visitArguments(node.arguments);
@@ -530,6 +529,10 @@ class CodeGenerator extends tree_ir.StatementVisitor
@override
js.Expression visitCreateInstance(tree_ir.CreateInstance node) {
ClassElement cls = node.classElement;
+ // TODO(asgerf): To allow inlining of InvokeConstructor, CreateInstance must
+ // carry a DartType so we can register the instantiated type
+ // with its type arguments. Otherwise dataflow analysis is
+ // needed to reconstruct the instantiated type.
registry.registerInstantiatedClass(cls);
js.Expression instance = new js.New(
glue.constructorAccess(cls),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698