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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 18801007: Support type parameters and classes as expression in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 24832)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -854,7 +854,18 @@
void ValueGraphVisitor::VisitTypeNode(TypeNode* node) {
- ReturnDefinition(new ConstantInstr(node->type()));
+ const AbstractType& type = node->type();
+ ASSERT(type.IsFinalized() && !type.IsMalformed());
+ if (type.IsInstantiated()) {
+ ReturnDefinition(new ConstantInstr(type));
+ } else {
+ const Class& instantiator_class = Class::ZoneHandle(
+ owner()->parsed_function()->function().Owner());
+ Value* instantiator_value = BuildInstantiatorTypeArguments(
+ node->token_pos(), instantiator_class, NULL);
+ ReturnDefinition(new InstantiateTypeInstr(
+ node->token_pos(), type, instantiator_class, instantiator_value));
+ }
}
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698