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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 9635016: Support compilation of ArrayNode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 4f387f971414ebb17531c0859d5693006b903521..8abd46c0722c94478732ba217d7392e804e6ef02 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -625,7 +625,19 @@ void EffectGraphVisitor::VisitArgumentListNode(ArgumentListNode* node) {
void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) {
- Bailout("EffectGraphVisitor::VisitArrayNode");
+ // Translate the array elements and collect their values.
+ ZoneGrowableArray<Value*>* values =
+ new ZoneGrowableArray<Value*>(node->length());
+ int index = temp_index();
+ for (int i = 0; i < node->length(); ++i) {
+ ValueGraphVisitor for_value(owner(), index);
+ node->ElementAt(i)->Visit(&for_value);
+ Append(for_value);
+ values->Add(for_value.value());
+ index = for_value.temp_index();
+ }
+ CreateArrayComp* create = new CreateArrayComp(node, values);
+ ReturnComputation(create);
}
@@ -1097,6 +1109,17 @@ void FlowGraphPrinter::VisitInstanceOf(InstanceOfComp* comp) {
String::Handle(comp->type().Name()).ToCString());
}
+
+void FlowGraphPrinter::VisitCreateArray(CreateArrayComp* comp) {
+ OS::Print("CreateArray(");
+ for (int i = 0; i < comp->ElementCount(); ++i) {
+ if (i != 0) OS::Print(", ");
+ comp->ElementAt(i)->Accept(this);
+ }
+ OS::Print(")");
+}
+
+
void FlowGraphPrinter::VisitJoinEntry(JoinEntryInstr* instr) {
OS::Print("%2d: [join]", instr->block_number());
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698