Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / v8 / src / compiler / graph-visualizer.h
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
8 #include <iosfwd>
9
10 namespace v8 {
11 namespace internal {
12
13 class CompilationInfo;
14
15 namespace compiler {
16
17 class Graph;
18 class InstructionSequence;
19 class RegisterAllocator;
20 class Schedule;
21 class SourcePositionTable;
22
23
24 struct AsDOT {
25   explicit AsDOT(const Graph& g) : graph(g) {}
26   const Graph& graph;
27 };
28
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 AsC1VCompilation {
40   explicit AsC1VCompilation(const CompilationInfo* info) : info_(info) {}
41   const CompilationInfo* info_;
42 };
43
44
45 struct AsC1V {
46   AsC1V(const char* phase, const Schedule* schedule,
47         const SourcePositionTable* positions = NULL,
48         const InstructionSequence* instructions = NULL)
49       : schedule_(schedule),
50         instructions_(instructions),
51         positions_(positions),
52         phase_(phase) {}
53   const Schedule* schedule_;
54   const InstructionSequence* instructions_;
55   const SourcePositionTable* positions_;
56   const char* phase_;
57 };
58
59 struct AsC1VAllocator {
60   explicit AsC1VAllocator(const char* phase,
61                           const RegisterAllocator* allocator = NULL)
62       : phase_(phase), allocator_(allocator) {}
63   const char* phase_;
64   const RegisterAllocator* allocator_;
65 };
66
67 std::ostream& operator<<(std::ostream& os, const AsDOT& ad);
68 std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac);
69 std::ostream& operator<<(std::ostream& os, const AsC1V& ac);
70 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac);
71
72 }  // namespace compiler
73 }  // namespace internal
74 }  // namespace v8
75
76 #endif  // V8_COMPILER_GRAPH_VISUALIZER_H_