| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_IL_PRINTER_H_ | 5 #ifndef VM_IL_PRINTER_H_ |
| 6 #define VM_IL_PRINTER_H_ | 6 #define VM_IL_PRINTER_H_ |
| 7 | 7 |
| 8 #include "vm/flow_graph.h" | 8 #include "vm/flow_graph.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const AbstractType& dst_type, | 53 const AbstractType& dst_type, |
| 54 const String& dst_name, | 54 const String& dst_name, |
| 55 bool eliminated); | 55 bool eliminated); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 const Function& function_; | 58 const Function& function_; |
| 59 const GrowableArray<BlockEntryInstr*>& block_order_; | 59 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 60 const bool print_locations_; | 60 const bool print_locations_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 | |
| 64 class FlowGraphVisualizer : public ValueObject { | |
| 65 public: | |
| 66 explicit FlowGraphVisualizer(const FlowGraph& flow_graph) | |
| 67 : function_(flow_graph.parsed_function().function()), | |
| 68 block_order_(flow_graph.reverse_postorder()), | |
| 69 indent_(0) { } | |
| 70 | |
| 71 void PrintFunction(); | |
| 72 | |
| 73 private: | |
| 74 // Helpers for printing. | |
| 75 void PrintInstruction(Instruction* instr); | |
| 76 void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | |
| 77 | |
| 78 const Function& function_; | |
| 79 const GrowableArray<BlockEntryInstr*>& block_order_; | |
| 80 intptr_t indent_; | |
| 81 | |
| 82 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisualizer); | |
| 83 }; | |
| 84 | |
| 85 } // namespace dart | 63 } // namespace dart |
| 86 | 64 |
| 87 #endif // VM_IL_PRINTER_H_ | 65 #endif // VM_IL_PRINTER_H_ |
| OLD | NEW |