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 RUNTIME_VM_IL_PRINTER_H_ | 5 #ifndef RUNTIME_VM_IL_PRINTER_H_ |
6 #define RUNTIME_VM_IL_PRINTER_H_ | 6 #define RUNTIME_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 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 class BufferFormatter : public ValueObject { | 13 class BufferFormatter : public ValueObject { |
14 public: | 14 public: |
15 BufferFormatter(char* buffer, intptr_t size) | 15 BufferFormatter(char* buffer, intptr_t size) |
16 : position_(0), buffer_(buffer), size_(size) {} | 16 : position_(0), buffer_(buffer), size_(size) {} |
17 | 17 |
18 void VPrint(const char* format, va_list args); | 18 void VPrint(const char* format, va_list args); |
19 void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 19 void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
20 | 20 |
21 private: | 21 private: |
22 intptr_t position_; | 22 intptr_t position_; |
23 char* buffer_; | 23 char* buffer_; |
24 const intptr_t size_; | 24 const intptr_t size_; |
25 | 25 |
26 DISALLOW_COPY_AND_ASSIGN(BufferFormatter); | 26 DISALLOW_COPY_AND_ASSIGN(BufferFormatter); |
27 }; | 27 }; |
28 | 28 |
29 | |
30 class ParsedFunction; | 29 class ParsedFunction; |
31 | 30 |
32 | |
33 // Graph printing. | 31 // Graph printing. |
34 class FlowGraphPrinter : public ValueObject { | 32 class FlowGraphPrinter : public ValueObject { |
35 public: | 33 public: |
36 static const intptr_t kPrintAll = -1; | 34 static const intptr_t kPrintAll = -1; |
37 | 35 |
38 explicit FlowGraphPrinter(const FlowGraph& flow_graph, | 36 explicit FlowGraphPrinter(const FlowGraph& flow_graph, |
39 bool print_locations = false) | 37 bool print_locations = false) |
40 : function_(flow_graph.function()), | 38 : function_(flow_graph.function()), |
41 block_order_(flow_graph.reverse_postorder()), | 39 block_order_(flow_graph.reverse_postorder()), |
42 print_locations_(print_locations) {} | 40 print_locations_(print_locations) {} |
(...skipping 30 matching lines...) Expand all Loading... |
73 | 71 |
74 private: | 72 private: |
75 const Function& function_; | 73 const Function& function_; |
76 const GrowableArray<BlockEntryInstr*>& block_order_; | 74 const GrowableArray<BlockEntryInstr*>& block_order_; |
77 const bool print_locations_; | 75 const bool print_locations_; |
78 }; | 76 }; |
79 | 77 |
80 } // namespace dart | 78 } // namespace dart |
81 | 79 |
82 #endif // RUNTIME_VM_IL_PRINTER_H_ | 80 #endif // RUNTIME_VM_IL_PRINTER_H_ |
OLD | NEW |