Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::compiler::GraphIntrinsifier Class Reference

#include <graph_intrinsifier.h>

Inheritance diagram for dart::compiler::GraphIntrinsifier:
dart::AllStatic

Static Public Member Functions

static bool GraphIntrinsify (const ParsedFunction &parsed_function, FlowGraphCompiler *compiler)
 

Detailed Description

Definition at line 27 of file graph_intrinsifier.h.

Member Function Documentation

◆ GraphIntrinsify()

bool dart::compiler::GraphIntrinsifier::GraphIntrinsify ( const ParsedFunction parsed_function,
FlowGraphCompiler compiler 
)
static

Definition at line 70 of file graph_intrinsifier.cc.

71 {
72 ASSERT(!parsed_function.function().HasOptionalParameters());
73 PrologueInfo prologue_info(-1, -1);
74
75 auto graph_entry =
76 new GraphEntryInstr(parsed_function, Compiler::kNoOSRDeoptId);
77
78 intptr_t block_id = 1; // 0 is GraphEntry.
79 graph_entry->set_normal_entry(
80 new FunctionEntryInstr(graph_entry, block_id, kInvalidTryIndex,
81 CompilerState::Current().GetNextDeoptId()));
82
83 FlowGraph* graph =
84 new FlowGraph(parsed_function, graph_entry, block_id, prologue_info,
86 compiler->set_intrinsic_flow_graph(*graph);
87
88 const Function& function = parsed_function.function();
89
90 switch (function.recognized_kind()) {
91#define EMIT_CASE(class_name, function_name, enum_name, fp) \
92 case MethodRecognizer::k##enum_name: \
93 if (!Build_##enum_name(graph)) return false; \
94 break;
95
97#undef EMIT_CASE
98 default:
99 return false;
100 }
101
102 if (FLAG_support_il_printer && FLAG_print_flow_graph &&
104 THR_Print("Intrinsic graph before\n");
105 FlowGraphPrinter printer(*graph);
106 printer.PrintBlocks();
107 }
108
109 // Prepare for register allocation (cf. FinalizeGraph).
110 graph->RemoveRedefinitions();
111
112 // Ensure dominators are re-computed. Normally this is done during SSA
113 // construction (which we don't do for graph intrinsics).
114 GrowableArray<BitVector*> dominance_frontier;
115 graph->ComputeDominators(&dominance_frontier);
116
117 CompilerPassState state(parsed_function.thread(), graph,
118 /*speculative_inlining_policy*/ nullptr);
120
121 if (FLAG_support_il_printer && FLAG_print_flow_graph &&
123 THR_Print("Intrinsic graph after\n");
124 FlowGraphPrinter printer(*graph);
125 printer.PrintBlocks();
126 }
127 EmitCodeFor(compiler, graph);
128 return true;
129}
static void RunGraphIntrinsicPipeline(CompilerPassState *state)
static CompilerState & Current()
static constexpr intptr_t kNoOSRDeoptId
Definition: compiler.h:73
static bool ShouldPrint(const Function &function, uint8_t **compiler_pass_filter=nullptr)
Definition: il_printer.cc:1715
#define THR_Print(format,...)
Definition: log.h:20
#define ASSERT(E)
AtkStateType state
constexpr bool FLAG_support_il_printer
Definition: flag_list.h:48
Dart_NativeFunction function
Definition: fuchsia.cc:51
#define EMIT_CASE(class_name, function_name, enum_name, fp)
static void EmitCodeFor(FlowGraphCompiler *compiler, FlowGraph *graph)
static constexpr intptr_t kInvalidTryIndex
#define GRAPH_INTRINSICS_LIST(V)

The documentation for this class was generated from the following files: