Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1 | // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef V8_COMPILER_GRAPH_VISUALIZER_H_ |
| 6 | #define V8_COMPILER_GRAPH_VISUALIZER_H_ |
| 7 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 8 | #include <iosfwd> |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 9 | |
| 10 | namespace v8 { |
| 11 | namespace internal { |
| 12 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 13 | class CompilationInfo; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 14 | |
| 15 | namespace compiler { |
| 16 | |
| 17 | class Graph; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 18 | class InstructionSequence; |
| 19 | class RegisterAllocator; |
| 20 | class Schedule; |
| 21 | class SourcePositionTable; |
| 22 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 23 | |
| 24 | struct AsDOT { |
| 25 | explicit AsDOT(const Graph& g) : graph(g) {} |
| 26 | const Graph& graph; |
| 27 | }; |
| 28 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 29 | std::ostream& operator<<(std::ostream& os, const AsDOT& ad); |
| 30 | |
| 31 | |
| 32 | struct AsJSON { |
| 33 | explicit AsJSON(const Graph& g) : graph(g) {} |
| 34 | const Graph& graph; |
| 35 | }; |
| 36 | |
| 37 | std::ostream& operator<<(std::ostream& os, const AsJSON& ad); |
| 38 | |
| 39 | struct AsRPO { |
| 40 | explicit AsRPO(const Graph& g) : graph(g) {} |
| 41 | const Graph& graph; |
| 42 | }; |
| 43 | |
| 44 | std::ostream& operator<<(std::ostream& os, const AsRPO& ad); |
| 45 | |
| 46 | |
| 47 | struct AsC1VCompilation { |
| 48 | explicit AsC1VCompilation(const CompilationInfo* info) : info_(info) {} |
| 49 | const CompilationInfo* info_; |
| 50 | }; |
| 51 | |
| 52 | |
| 53 | struct AsC1V { |
| 54 | AsC1V(const char* phase, const Schedule* schedule, |
| 55 | const SourcePositionTable* positions = NULL, |
| 56 | const InstructionSequence* instructions = NULL) |
| 57 | : schedule_(schedule), |
| 58 | instructions_(instructions), |
| 59 | positions_(positions), |
| 60 | phase_(phase) {} |
| 61 | const Schedule* schedule_; |
| 62 | const InstructionSequence* instructions_; |
| 63 | const SourcePositionTable* positions_; |
| 64 | const char* phase_; |
| 65 | }; |
| 66 | |
| 67 | struct AsC1VAllocator { |
| 68 | explicit AsC1VAllocator(const char* phase, |
| 69 | const RegisterAllocator* allocator = NULL) |
| 70 | : phase_(phase), allocator_(allocator) {} |
| 71 | const char* phase_; |
| 72 | const RegisterAllocator* allocator_; |
| 73 | }; |
| 74 | |
| 75 | std::ostream& operator<<(std::ostream& os, const AsDOT& ad); |
| 76 | std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac); |
| 77 | std::ostream& operator<<(std::ostream& os, const AsC1V& ac); |
| 78 | std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac); |
| 79 | |
| 80 | } // namespace compiler |
| 81 | } // namespace internal |
| 82 | } // namespace v8 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 83 | |
| 84 | #endif // V8_COMPILER_GRAPH_VISUALIZER_H_ |