v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
graph-visualizer.h
Go to the documentation of this file.
1// Copyright 2022 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_TURBOSHAFT_GRAPH_VISUALIZER_H_
6#define V8_COMPILER_TURBOSHAFT_GRAPH_VISUALIZER_H_
7
11#include "src/handles/handles.h"
12
14
20
22AsJSON(const Graph& graph, NodeOriginTable* origins, Zone* temp_zone) {
23 return TurboshaftGraphAsJSON{graph, origins, temp_zone};
24}
25
26V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
27 const TurboshaftGraphAsJSON& ad);
28
30 public:
31 JSONTurboshaftGraphWriter(std::ostream& os, const Graph& turboshaft_graph,
33
36 delete;
37
38 void Print();
39
40 protected:
41 void PrintNodes();
42 void PrintEdges();
43 void PrintBlocks();
44
45 protected:
46 std::ostream& os_;
50};
51
53 std::ofstream& stream, const char* data_name, const Graph& graph,
54 std::function<bool(std::ostream&, const Graph&, OpIndex)> printer);
56 std::ofstream& stream, const char* data_name, const Graph& graph,
57 std::function<bool(std::ostream&, const Graph&, BlockIndex)> printer);
58
59} // namespace v8::internal::compiler::turboshaft
60
61#endif // V8_COMPILER_TURBOSHAFT_GRAPH_VISUALIZER_H_
TFGraph * graph
JSONTurboshaftGraphWriter(const JSONTurboshaftGraphWriter &)=delete
JSONTurboshaftGraphWriter(std::ostream &os, const Graph &turboshaft_graph, NodeOriginTable *origins, Zone *zone)
JSONTurboshaftGraphWriter & operator=(const JSONTurboshaftGraphWriter &)=delete
NodeOriginTable * origins
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
V8_INLINE V8_EXPORT_PRIVATE TurboshaftGraphAsJSON AsJSON(const Graph &graph, NodeOriginTable *origins, Zone *temp_zone)
void PrintTurboshaftCustomDataPerBlock(std::ofstream &stream, const char *data_name, const Graph &graph, std::function< bool(std::ostream &, const Graph &, BlockIndex)> printer)
void PrintTurboshaftCustomDataPerOperation(std::ofstream &stream, const char *data_name, const Graph &graph, std::function< bool(std::ostream &, const Graph &, OpIndex)> printer)
#define V8_EXPORT_PRIVATE
Definition macros.h:460
#define V8_INLINE
Definition v8config.h:500