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

Unified Diff: vm/flow_graph_compiler_x64.cc

Issue 10407031: Add IR printing into a supplied buffer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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
Index: vm/flow_graph_compiler_x64.cc
===================================================================
--- vm/flow_graph_compiler_x64.cc (revision 7724)
+++ vm/flow_graph_compiler_x64.cc (working copy)
@@ -13,6 +13,7 @@
#include "vm/code_generator.h"
#include "vm/debugger.h"
#include "vm/disassembler.h"
+#include "vm/il_printer.h"
#include "vm/intrinsifier.h"
#include "vm/longjump.h"
#include "vm/object_store.h"
@@ -28,6 +29,7 @@
DECLARE_FLAG(bool, optimization_counter_threshold);
DECLARE_FLAG(bool, print_ast);
DECLARE_FLAG(bool, report_usage_count);
+DECLARE_FLAG(bool, code_comments);
FlowGraphCompiler::FlowGraphCompiler(
@@ -1128,7 +1130,7 @@
Instruction* instr = current_block()->Accept(this);
// Compile all successors until an exit, branch, or a block entry.
while ((instr != NULL) && !instr->IsBlockEntry()) {
- __ Comment("@%d: instruction", instr->cid());
+ if (FLAG_code_comments) EmitComment(instr);
instr = instr->Accept(this);
}
@@ -1146,6 +1148,14 @@
}
+void FlowGraphCompiler::EmitComment(Instruction* instr) {
+ char buffer[80];
+ BufferFormatter f(buffer, sizeof(buffer));
+ instr->PrintTo(&f);
+ __ Comment("@%d: %s", instr->cid(), buffer);
+}
+
+
void FlowGraphCompiler::VisitGraphEntry(GraphEntryInstr* instr) {
// Nothing to do.
}
« no previous file with comments | « vm/flow_graph_compiler_x64.h ('k') | vm/il_printer.h » ('j') | vm/il_printer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698