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

Unified Diff: vm/il_printer.cc

Issue 10544206: Second step for computing SSA: renaming. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 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 | « vm/flow_graph_builder.cc ('k') | vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/il_printer.cc
===================================================================
--- vm/il_printer.cc (revision 8786)
+++ vm/il_printer.cc (working copy)
@@ -86,7 +86,11 @@
void UseVal::PrintTo(BufferFormatter* f) const {
- f->Print("t%d", definition()->temp_index());
+ if (definition()->ssa_temp_index() != -1) {
+ f->Print("t%d", definition()->ssa_temp_index());
+ } else {
+ f->Print("t%d", definition()->temp_index());
+ }
}
@@ -332,6 +336,12 @@
void GraphEntryInstr::PrintTo(BufferFormatter* f) const {
f->Print("%2d: [graph]", block_id());
+ if (start_env_ != NULL) {
+ for (intptr_t i = 0; i < start_env_->length(); ++i) {
+ f->Print("\n ");
+ (*start_env_)[i]->PrintTo(f);
+ }
+ }
}
@@ -348,7 +358,7 @@
void PhiInstr::PrintTo(BufferFormatter* f) const {
- f->Print(" phi(");
+ f->Print(" t%d <- phi(", ssa_temp_index());
for (intptr_t i = 0; i < inputs_.length(); ++i) {
if (inputs_[i] != NULL) inputs_[i]->PrintTo(f);
if (i < inputs_.length() - 1) f->Print(",");
@@ -374,7 +384,11 @@
void BindInstr::PrintTo(BufferFormatter* f) const {
- f->Print(" t%d <- ", temp_index());
+ if (ssa_temp_index() != -1) {
+ f->Print(" t%d <- ", ssa_temp_index());
+ } else {
+ f->Print(" t%d <- ", temp_index());
+ }
computation()->PrintTo(f);
}
@@ -428,7 +442,7 @@
char str[120];
BufferFormatter f(str, sizeof(str));
instr->PrintToVisualizer(&f);
- f.Print("%s <|@\n", str);
+ f.Print(" <|@\n");
(*Dart::flow_graph_writer())(str, strlen(str));
}
@@ -556,12 +570,30 @@
void PhiInstr::PrintToVisualizer(BufferFormatter* f) const {
- // TODO(fschneider): Print operands when SSA renaming is implemented.
- f->Print("v [");
+ f->Print("t%d [", ssa_temp_index());
+ bool has_constant = false;
for (intptr_t i = 0; i < InputCount(); ++i) {
- f->Print(" v ");
+ if (i > 0) f->Print(" ");
+ if (InputAt(i)->IsConstant()) {
+ f->Print("const");
+ has_constant = true;
+ } else {
+ InputAt(i)->PrintTo(f);
+ }
}
f->Print("]");
+ // The vizualizer file format does not allow arbitrary strings inside the phi.
+ // Print constants as a line-end comment instead.
+ if (has_constant) {
+ f->Print("\"");
+ for (intptr_t i = 0; i < InputCount(); ++i) {
+ if (i > 0) f->Print(" ");
+ if (InputAt(i)->IsConstant()) {
+ InputAt(i)->PrintTo(f);
+ }
+ }
+ f->Print("\"");
+ }
}
@@ -582,7 +614,11 @@
void BindInstr::PrintToVisualizer(BufferFormatter* f) const {
- f->Print("t%d ", temp_index());
+ if (ssa_temp_index() != -1) {
+ f->Print("t%d ", ssa_temp_index());
+ } else {
+ f->Print("t%d ", temp_index());
+ }
computation()->PrintTo(f);
}
« no previous file with comments | « vm/flow_graph_builder.cc ('k') | vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698