blob: 3dd66eaf41f3de71182e71902666f3d9f44f3339 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// 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 Bernierd0a1eb72015-03-24 16:35:39 -04008#include <iosfwd>
Ben Murdochb8a8cc12014-11-26 15:28:44 +00009
10namespace v8 {
11namespace internal {
12
Emily Bernierd0a1eb72015-03-24 16:35:39 -040013class CompilationInfo;
Ben Murdochb8a8cc12014-11-26 15:28:44 +000014
15namespace compiler {
16
17class Graph;
Emily Bernierd0a1eb72015-03-24 16:35:39 -040018class InstructionSequence;
19class RegisterAllocator;
20class Schedule;
21class SourcePositionTable;
22
Ben Murdochb8a8cc12014-11-26 15:28:44 +000023
24struct AsDOT {
25 explicit AsDOT(const Graph& g) : graph(g) {}
26 const Graph& graph;
27};
28
Emily Bernierd0a1eb72015-03-24 16:35:39 -040029std::ostream& operator<<(std::ostream& os, const AsDOT& ad);
30
31
32struct AsJSON {
33 explicit AsJSON(const Graph& g) : graph(g) {}
34 const Graph& graph;
35};
36
37std::ostream& operator<<(std::ostream& os, const AsJSON& ad);
38
39struct AsRPO {
40 explicit AsRPO(const Graph& g) : graph(g) {}
41 const Graph& graph;
42};
43
44std::ostream& operator<<(std::ostream& os, const AsRPO& ad);
45
46
47struct AsC1VCompilation {
48 explicit AsC1VCompilation(const CompilationInfo* info) : info_(info) {}
49 const CompilationInfo* info_;
50};
51
52
53struct 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
67struct 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
75std::ostream& operator<<(std::ostream& os, const AsDOT& ad);
76std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac);
77std::ostream& operator<<(std::ostream& os, const AsC1V& ac);
78std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac);
79
80} // namespace compiler
81} // namespace internal
82} // namespace v8
Ben Murdochb8a8cc12014-11-26 15:28:44 +000083
84#endif // V8_COMPILER_GRAPH_VISUALIZER_H_