5#ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_
6#define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_
10#if defined(DART_PRECOMPILED_RUNTIME)
11#error "AOT runtime should not use compiler sources (including header files)"
32class FlowGraphChecker :
public FlowGraphVisitor {
37 FlowGraphChecker(FlowGraph* flow_graph,
38 const GrowableArray<const Function*>& inline_id_to_function)
39 : FlowGraphVisitor(flow_graph->preorder()),
40 flow_graph_(flow_graph),
41 inline_id_to_function_(inline_id_to_function),
42 script_(Script::Handle(flow_graph_->zone())),
43 current_block_(nullptr) {}
46 void Check(
const char* pass_name);
50 void VisitBlocks()
override;
51 void VisitInstructions(BlockEntryInstr* block);
52 void VisitInstruction(Instruction* instruction);
53 void VisitDefinition(Definition* def);
54 void VisitUseDef(Instruction* instruction,
58 void VisitDefUse(Definition* def,
Value* use,
Value*
prev,
bool is_env);
61 void VisitConstant(ConstantInstr* constant)
override;
62 void VisitPhi(PhiInstr* phi)
override;
63 void VisitGoto(GotoInstr* jmp)
override;
64 void VisitIndirectGoto(IndirectGotoInstr* jmp)
override;
65 void VisitBranch(BranchInstr* branch)
override;
66 void VisitRedefinition(RedefinitionInstr* def)
override;
67 void AssertArgumentsInEnv(Definition*
call);
68 void VisitClosureCall(ClosureCallInstr*
call)
override;
69 void VisitStaticCall(StaticCallInstr*
call)
override;
70 void VisitInstanceCall(InstanceCallInstr*
call)
override;
71 void VisitPolymorphicInstanceCall(
72 PolymorphicInstanceCallInstr*
call)
override;
74 FlowGraph*
const flow_graph_;
75 const GrowableArray<const Function*>& inline_id_to_function_;
77 BlockEntryInstr* current_block_;
static float prev(float f)