OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_GRAPH_VISUALIZER_H_ | 5 #ifndef V8_COMPILER_GRAPH_VISUALIZER_H_ |
6 #define V8_COMPILER_GRAPH_VISUALIZER_H_ | 6 #define V8_COMPILER_GRAPH_VISUALIZER_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 10 matching lines...) Expand all Loading... |
21 class SourcePositionTable; | 21 class SourcePositionTable; |
22 | 22 |
23 FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, | 23 FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, |
24 const char* suffix, const char* mode); | 24 const char* suffix, const char* mode); |
25 | 25 |
26 struct AsDOT { | 26 struct AsDOT { |
27 explicit AsDOT(const Graph& g) : graph(g) {} | 27 explicit AsDOT(const Graph& g) : graph(g) {} |
28 const Graph& graph; | 28 const Graph& graph; |
29 }; | 29 }; |
30 | 30 |
31 std::ostream& operator<<(std::ostream& os, const AsDOT& ad); | 31 struct GraphAsJSON { |
32 | 32 GraphAsJSON(const Graph& g, SourcePositionTable* p) |
33 | 33 : graph(g), positions(p) {} |
34 struct AsJSON { | |
35 AsJSON(const Graph& g, SourcePositionTable* p) : graph(g), positions(p) {} | |
36 const Graph& graph; | 34 const Graph& graph; |
37 const SourcePositionTable* positions; | 35 const SourcePositionTable* positions; |
38 }; | 36 }; |
39 | 37 |
40 std::ostream& operator<<(std::ostream& os, const AsJSON& ad); | 38 struct ScheduleAsJSON { |
| 39 explicit ScheduleAsJSON(const Schedule& s, SourcePositionTable* p = NULL) |
| 40 : schedule(s), positions(p) {} |
| 41 const Schedule& schedule; |
| 42 const SourcePositionTable* positions; |
| 43 }; |
41 | 44 |
42 struct AsRPO { | 45 struct AsRPO { |
43 explicit AsRPO(const Graph& g) : graph(g) {} | 46 explicit AsRPO(const Graph& g) : graph(g) {} |
44 const Graph& graph; | 47 const Graph& graph; |
45 }; | 48 }; |
46 | 49 |
47 std::ostream& operator<<(std::ostream& os, const AsRPO& ad); | |
48 | |
49 | |
50 struct AsC1VCompilation { | 50 struct AsC1VCompilation { |
51 explicit AsC1VCompilation(const CompilationInfo* info) : info_(info) {} | 51 explicit AsC1VCompilation(const CompilationInfo* info) : info_(info) {} |
52 const CompilationInfo* info_; | 52 const CompilationInfo* info_; |
53 }; | 53 }; |
54 | 54 |
55 | |
56 struct AsC1V { | 55 struct AsC1V { |
57 AsC1V(const char* phase, const Schedule* schedule, | 56 AsC1V(const char* phase, const Schedule* schedule, |
58 const SourcePositionTable* positions = NULL, | 57 const SourcePositionTable* positions = NULL, |
59 const InstructionSequence* instructions = NULL) | 58 const InstructionSequence* instructions = NULL) |
60 : schedule_(schedule), | 59 : schedule_(schedule), |
61 instructions_(instructions), | 60 instructions_(instructions), |
62 positions_(positions), | 61 positions_(positions), |
63 phase_(phase) {} | 62 phase_(phase) {} |
64 const Schedule* schedule_; | 63 const Schedule* schedule_; |
65 const InstructionSequence* instructions_; | 64 const InstructionSequence* instructions_; |
66 const SourcePositionTable* positions_; | 65 const SourcePositionTable* positions_; |
67 const char* phase_; | 66 const char* phase_; |
68 }; | 67 }; |
69 | 68 |
70 struct AsC1VAllocator { | 69 struct AsC1VAllocator { |
71 explicit AsC1VAllocator(const char* phase, | 70 explicit AsC1VAllocator(const char* phase, |
72 const RegisterAllocator* allocator = NULL) | 71 const RegisterAllocator* allocator = NULL) |
73 : phase_(phase), allocator_(allocator) {} | 72 : phase_(phase), allocator_(allocator) {} |
74 const char* phase_; | 73 const char* phase_; |
75 const RegisterAllocator* allocator_; | 74 const RegisterAllocator* allocator_; |
76 }; | 75 }; |
77 | 76 |
78 std::ostream& operator<<(std::ostream& os, const AsDOT& ad); | 77 std::ostream& operator<<(std::ostream& os, const AsDOT& ad); |
| 78 std::ostream& operator<<(std::ostream& os, const GraphAsJSON& ad); |
| 79 std::ostream& operator<<(std::ostream& os, const ScheduleAsJSON& ad); |
| 80 std::ostream& operator<<(std::ostream& os, const AsRPO& ad); |
| 81 std::ostream& operator<<(std::ostream& os, const AsDOT& ad); |
79 std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac); | 82 std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac); |
80 std::ostream& operator<<(std::ostream& os, const AsC1V& ac); | 83 std::ostream& operator<<(std::ostream& os, const AsC1V& ac); |
81 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac); | 84 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac); |
82 | 85 |
83 } // namespace compiler | 86 } // namespace compiler |
84 } // namespace internal | 87 } // namespace internal |
85 } // namespace v8 | 88 } // namespace v8 |
86 | 89 |
87 #endif // V8_COMPILER_GRAPH_VISUALIZER_H_ | 90 #endif // V8_COMPILER_GRAPH_VISUALIZER_H_ |
OLD | NEW |