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

Unified Diff: vm/il_printer.h

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
« no previous file with comments | « vm/flow_graph_compiler_x64.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/il_printer.h
===================================================================
--- vm/il_printer.h (revision 7724)
+++ vm/il_printer.h (working copy)
@@ -9,40 +9,40 @@
namespace dart {
+class BufferFormatter : public ValueObject {
+ public:
+ BufferFormatter(char* buffer, int size)
+ : position_(0),
+ buffer_(buffer),
+ size_(size) { }
+
+ void Print(const char* format, ...);
+
+ private:
+ intptr_t position_;
+ char* buffer_;
+ intptr_t size_;
srdjan 2012/05/18 00:51:34 Add DISALLOW_xxxxx
srdjan 2012/05/18 00:51:34 size_ is const?
Florian Schneider 2012/05/18 01:04:38 Done.
Florian Schneider 2012/05/18 01:04:38 Done.
+};
+
+
// Graph printing.
-class FlowGraphPrinter : public FlowGraphVisitor {
+class FlowGraphPrinter : public ValueObject {
public:
FlowGraphPrinter(const Function& function,
const GrowableArray<BlockEntryInstr*>& block_order)
- : FlowGraphVisitor(block_order), function_(function) { }
+ : function_(function), block_order_(block_order) { }
virtual ~FlowGraphPrinter() {}
// Print the instructions in a block terminated by newlines. Add "goto N"
// to the end of the block if it ends with an unconditional jump to
// another block and that block is not next in reverse postorder.
- void VisitBlocks();
+ void PrintBlocks();
+ void Print(Instruction* instr);
- // Visiting a computation prints it with no indentation or newline.
-#define DECLARE_VISIT_COMPUTATION(ShortName, ClassName) \
- virtual void Visit##ShortName(ClassName* comp);
-
- // Visiting an instruction prints it with a four space indent and no
- // trailing newline. Basic block entries are labeled with their block
- // number.
-#define DECLARE_VISIT_INSTRUCTION(ShortName) \
- virtual void Visit##ShortName(ShortName##Instr* instr);
-
- FOR_EACH_COMPUTATION(DECLARE_VISIT_COMPUTATION)
- FOR_EACH_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
-
-#undef DECLARE_VISIT_COMPUTATION
-#undef DECLARE_VISIT_INSTRUCTION
-
private:
const Function& function_;
-
- DISALLOW_COPY_AND_ASSIGN(FlowGraphPrinter);
+ const GrowableArray<BlockEntryInstr*>& block_order_;
};
} // namespace dart
« no previous file with comments | « vm/flow_graph_compiler_x64.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698