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

Unified Diff: vm/il_printer.cc

Issue 10696090: Add deoptimization environments to instructions. (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 9340)
+++ vm/il_printer.cc (working copy)
@@ -9,7 +9,9 @@
namespace dart {
+DEFINE_FLAG(bool, print_environments, false, "Print SSA environments.");
+
void BufferFormatter::Print(const char* format, ...) {
va_list args;
va_start(args, format);
@@ -58,6 +60,9 @@
char str[120];
BufferFormatter f(str, sizeof(str));
instr->PrintTo(&f);
+ if (FLAG_print_environments && (instr->env() != NULL)) {
+ instr->env()->PrintTo(&f);
+ }
OS::Print("%s", str);
}
@@ -433,6 +438,9 @@
char str[120];
BufferFormatter f(str, sizeof(str));
instr->PrintToVisualizer(&f);
+ if (FLAG_print_environments && (instr->env() != NULL)) {
+ instr->env()->PrintTo(&f);
+ }
f.Print(" <|@\n");
(*Dart::flow_graph_writer())(str, strlen(str));
}
@@ -649,5 +657,13 @@
}
+void Environment::PrintTo(BufferFormatter* f) const {
+ f->Print(" env={ ");
+ for (intptr_t i = 0; i < values_.length(); ++i) {
+ if (i > 0) f->Print(", ");
+ values_[i]->PrintTo(f);
+ }
+ f->Print(" }");
+}
} // namespace dart
« 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