5#ifndef V8_MAGLEV_MAGLEV_GRAPH_PRINTER_H_
6#define V8_MAGLEV_MAGLEV_GRAPH_PRINTER_H_
25class MaglevCompilationInfo;
26class MaglevGraphLabeller;
32#ifdef V8_ENABLE_MAGLEV_GRAPH_PRINTER
34class MaglevPrintingVisitor {
41 void PostProcessBasicBlock(BasicBlock* block) {}
48 std::ostream&
os() {
return *os_for_additional_info_; }
51 MaglevGraphLabeller* graph_labeller_;
53 std::unique_ptr<std::ostream> os_for_additional_info_;
54 std::set<BasicBlock*> loop_headers_;
55 std::vector<BasicBlock*> targets_;
57 MaglevGraphLabeller::Provenance existing_provenance_;
60void PrintGraph(std::ostream& os, MaglevCompilationInfo* compilation_info,
65 PrintNode(MaglevGraphLabeller* graph_labeller,
const NodeBase* node,
66 bool skip_targets =
false)
67 : graph_labeller_(graph_labeller),
69 skip_targets_(skip_targets) {}
71 void Print(std::ostream& os)
const;
74 MaglevGraphLabeller* graph_labeller_;
75 const NodeBase*
node_;
78 const bool skip_targets_;
83 PrintNodeLabel(MaglevGraphLabeller* graph_labeller,
const NodeBase* node)
84 : graph_labeller_(graph_labeller),
node_(node) {}
86 void Print(std::ostream& os)
const;
89 MaglevGraphLabeller* graph_labeller_;
90 const NodeBase*
node_;
127 Graph*
const graph) {}
132 bool skip_targets =
false) {}
133 void Print(std::ostream& os)
const {}
139 void Print(std::ostream& os)
const {}
ProcessResult Process(Phi *phi, const ProcessingState &state)
void PostProcessGraph(Graph *graph)
ProcessResult Process(ControlNode *node, const ProcessingState &state)
MaglevPrintingVisitor(MaglevGraphLabeller *graph_labeller, std::ostream &os)
void PreProcessGraph(Graph *graph)
ProcessResult Process(Node *node, const ProcessingState &state)
BlockProcessResult PreProcessBasicBlock(BasicBlock *block)
PrintNodeLabel(MaglevGraphLabeller *graph_labeller, const NodeBase *node)
void Print(std::ostream &os) const
void Print(std::ostream &os) const
PrintNode(MaglevGraphLabeller *graph_labeller, const NodeBase *node, bool skip_targets=false)
static constexpr NodeIdT kInvalidNodeId
void PrintGraph(std::ostream &os, MaglevCompilationInfo *compilation_info, Graph *const graph)
std::ostream & operator<<(std::ostream &os, const PrintNode &printer)