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.
5 #ifndef V8_COMPILER_GRAPH_VISUALIZER_H_
6 #define V8_COMPILER_GRAPH_VISUALIZER_H_
13 class CompilationInfo;
18 class InstructionSequence;
19 class RegisterAllocator;
21 class SourcePositionTable;
25 explicit AsDOT(const Graph& g) : graph(g) {}
29 std::ostream& operator<<(std::ostream& os, const AsDOT& ad);
33 explicit AsJSON(const Graph& g) : graph(g) {}
37 std::ostream& operator<<(std::ostream& os, const AsJSON& ad);
39 struct AsC1VCompilation {
40 explicit AsC1VCompilation(const CompilationInfo* info) : info_(info) {}
41 const CompilationInfo* info_;
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),
53 const Schedule* schedule_;
54 const InstructionSequence* instructions_;
55 const SourcePositionTable* positions_;
59 struct AsC1VAllocator {
60 explicit AsC1VAllocator(const char* phase,
61 const RegisterAllocator* allocator = NULL)
62 : phase_(phase), allocator_(allocator) {}
64 const RegisterAllocator* allocator_;
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);
72 } // namespace compiler
73 } // namespace internal
76 #endif // V8_COMPILER_GRAPH_VISUALIZER_H_