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

Unified Diff: runtime/vm/flow_graph_optimizer.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/flow_graph_builder.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 24832)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -5905,6 +5905,27 @@
}
+void ConstantPropagator::VisitInstantiateType(InstantiateTypeInstr* instr) {
+ const Object& object =
+ instr->instantiator()->definition()->constant_value();
+ if (IsNonConstant(object)) {
+ SetValue(instr, non_constant_);
+ return;
+ }
+ if (IsConstant(object)) {
+ if (instr->type().IsTypeParameter()) {
+ if (object.IsNull()) {
+ SetValue(instr, Type::ZoneHandle(Type::DynamicType()));
+ return;
+ }
+ // We could try to instantiate the type parameter and return it if no
+ // malformed error is reported.
+ }
+ SetValue(instr, non_constant_);
+ }
+}
+
+
void ConstantPropagator::VisitInstantiateTypeArguments(
InstantiateTypeArgumentsInstr* instr) {
const Object& object =
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698