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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 11633054: Implemented class literals in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 16515)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -547,11 +547,19 @@
}
-// Type nodes only occur as the right-hand side of instanceof comparisons,
-// and they are handled specially in that context.
-void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { UNREACHABLE(); }
+// Type nodes are used when a type is referenced as a literal. Type nodes
+// can also be used for the right-hand side of instanceof comparisons,
+// but they are handled specially in that context, not here.
+void EffectGraphVisitor::VisitTypeNode(TypeNode* node) {
+ return;
+}
+void ValueGraphVisitor::VisitTypeNode(TypeNode* node) {
+ ReturnDefinition(new ConstantInstr(node->type()));
+}
+
+
// Returns true if the type check can be skipped, for example, if the
// destination type is dynamic or if the compile type of the value is a subtype
// of the destination type.

Powered by Google App Engine
This is Rietveld 408576698