| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 intptr_t position_; | 23 intptr_t position_; |
| 24 char* buffer_; | 24 char* buffer_; |
| 25 const intptr_t size_; | 25 const intptr_t size_; |
| 26 | 26 |
| 27 DISALLOW_COPY_AND_ASSIGN(BufferFormatter); | 27 DISALLOW_COPY_AND_ASSIGN(BufferFormatter); |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 | 30 |
| 31 class ParsedFunction; |
| 32 |
| 33 |
| 31 // Graph printing. | 34 // Graph printing. |
| 32 class FlowGraphPrinter : public ValueObject { | 35 class FlowGraphPrinter : public ValueObject { |
| 33 public: | 36 public: |
| 34 FlowGraphPrinter(const Function& function, | 37 FlowGraphPrinter(const Function& function, |
| 35 const GrowableArray<BlockEntryInstr*>& block_order, | 38 const GrowableArray<BlockEntryInstr*>& block_order, |
| 36 bool print_locations = false) | 39 bool print_locations = false) |
| 37 : function_(function), | 40 : function_(function), |
| 38 block_order_(block_order), | 41 block_order_(block_order), |
| 39 print_locations_(print_locations) { } | 42 print_locations_(print_locations) { } |
| 40 | 43 |
| 41 // Print the instructions in a block terminated by newlines. Add "goto N" | 44 // Print the instructions in a block terminated by newlines. Add "goto N" |
| 42 // to the end of the block if it ends with an unconditional jump to | 45 // to the end of the block if it ends with an unconditional jump to |
| 43 // another block and that block is not next in reverse postorder. | 46 // another block and that block is not next in reverse postorder. |
| 44 void PrintBlocks(); | 47 void PrintBlocks(); |
| 45 void PrintInstruction(Instruction* instr); | 48 void PrintInstruction(Instruction* instr); |
| 46 static void PrintComputation(Computation* comp); | 49 static void PrintComputation(Computation* comp); |
| 50 static void PrintTypeCheck(const ParsedFunction& parsed_function, |
| 51 intptr_t token_pos, |
| 52 Value* value, |
| 53 const AbstractType& dst_type, |
| 54 const String& dst_name, |
| 55 bool eliminated); |
| 47 | 56 |
| 48 private: | 57 private: |
| 49 const Function& function_; | 58 const Function& function_; |
| 50 const GrowableArray<BlockEntryInstr*>& block_order_; | 59 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 51 const bool print_locations_; | 60 const bool print_locations_; |
| 52 }; | 61 }; |
| 53 | 62 |
| 54 | 63 |
| 55 class FlowGraphVisualizer : public ValueObject { | 64 class FlowGraphVisualizer : public ValueObject { |
| 56 public: | 65 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 68 const Function& function_; | 77 const Function& function_; |
| 69 const GrowableArray<BlockEntryInstr*>& block_order_; | 78 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 70 intptr_t indent_; | 79 intptr_t indent_; |
| 71 | 80 |
| 72 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisualizer); | 81 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisualizer); |
| 73 }; | 82 }; |
| 74 | 83 |
| 75 } // namespace dart | 84 } // namespace dart |
| 76 | 85 |
| 77 #endif // VM_IL_PRINTER_H_ | 86 #endif // VM_IL_PRINTER_H_ |
| OLD | NEW |