Flutter Engine
The Flutter Engine
il_printer.h
Go to the documentation of this file.
1// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
6#define RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
7
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
10#endif // defined(DART_PRECOMPILED_RUNTIME)
11
15
16namespace dart {
17
18class ParsedFunction;
19
20// Graph printing.
22 public:
23 static constexpr intptr_t kPrintAll = -1;
24
25 explicit FlowGraphPrinter(const FlowGraph& flow_graph,
26 bool print_locations = false)
27 : function_(flow_graph.function()),
28 block_order_(flow_graph.reverse_postorder()),
29 print_locations_(print_locations) {}
30
31 // Print the instructions in a block terminated by newlines. Add "goto N"
32 // to the end of the block if it ends with an unconditional jump to
33 // another block and that block is not next in reverse postorder.
36 static void PrintOneInstruction(Instruction* instr, bool print_locations);
37 static void PrintTypeCheck(const ParsedFunction& parsed_function,
38 TokenPosition token_pos,
39 Value* value,
40 const AbstractType& dst_type,
41 const String& dst_name,
42 bool eliminated);
43 static void PrintBlock(BlockEntryInstr* block, bool print_locations);
44
45 static void PrintGraph(const char* phase, FlowGraph* flow_graph);
46
47 // Debugging helper function. If 'num_checks_to_print' is not specified
48 // all checks will be printed.
49 static void PrintICData(const ICData& ic_data,
50 intptr_t num_checks_to_print = kPrintAll);
51
52 // Debugging helper function. If 'num_checks_to_print' is not specified
53 // all checks will be printed.
54 static void PrintCidRangeData(const CallTargets& ic_data,
55 intptr_t num_checks_to_print = kPrintAll);
56
57 static bool ShouldPrint(const Function& function,
58 uint8_t** compiler_pass_filter = nullptr);
59
60 private:
61 const Function& function_;
62 const GrowableArray<BlockEntryInstr*>& block_order_;
63 const bool print_locations_;
64};
65
66} // namespace dart
67
68#endif // RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
static void PrintOneInstruction(Instruction *instr, bool print_locations)
Definition: il_printer.cc:1687
static void PrintGraph(const char *phase, FlowGraph *flow_graph)
Definition: il_printer.cc:1706
static void PrintCidRangeData(const CallTargets &ic_data, intptr_t num_checks_to_print=kPrintAll)
static bool ShouldPrint(const Function &function, uint8_t **compiler_pass_filter=nullptr)
Definition: il_printer.cc:1715
static void PrintBlock(BlockEntryInstr *block, bool print_locations)
Definition: il_printer.cc:1701
static constexpr intptr_t kPrintAll
Definition: il_printer.h:23
FlowGraphPrinter(const FlowGraph &flow_graph, bool print_locations=false)
Definition: il_printer.h:25
void PrintInstruction(Instruction *instr)
static void PrintICData(const ICData &ic_data, intptr_t num_checks_to_print=kPrintAll)
Definition: il_printer.cc:1710
static void PrintTypeCheck(const ParsedFunction &parsed_function, TokenPosition token_pos, Value *value, const AbstractType &dst_type, const String &dst_name, bool eliminated)
Definition: il_printer.cc:1692
Definition: il.h:75
uint8_t value
Dart_NativeFunction function
Definition: fuchsia.cc:51
Definition: dart_vm.cc:33