5#ifndef RUNTIME_VM_COMPILER_BACKEND_INLINER_H_
6#define RUNTIME_VM_COMPILER_BACKEND_INLINER_H_
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
21class ForwardInstructionIterator;
23class FunctionEntryInstr;
26class InstanceCallInstr;
28struct InstructionSource;
31class TargetEntryInstr;
37 : enable_suppression_(enable_suppression), remaining_(limit) {}
40 return !enable_suppression_ || remaining_ > 0;
45 if (!enable_suppression_) {
50 if (IsSuppressed(call_deopt_id)) {
55 return remaining_ > 0;
59 ASSERT(enable_suppression_);
66 if (remaining_ <= 0)
return false;
68 inlining_suppressions_.
Add(
id);
73 intptr_t
length()
const {
return inlining_suppressions_.
length(); }
76 bool IsSuppressed(intptr_t
id)
const {
77 for (intptr_t
i = 0;
i < inlining_suppressions_.
length(); ++
i) {
78 if (inlining_suppressions_[
i] ==
id)
return true;
84 const bool enable_suppression_;
89 GrowableArray<intptr_t> inlining_suppressions_;
115 intptr_t num_constant_args,
117 intptr_t* instruction_count,
118 intptr_t* call_site_count);
135 return speculative_policy_;
145 const bool trace_inlining_;
bool AlwaysInline(const Function &function)
FlowGraphInliner(FlowGraph *flow_graph, GrowableArray< const Function * > *inline_id_to_function, GrowableArray< TokenPosition > *inline_id_to_token_pos, GrowableArray< intptr_t > *caller_inline_id, SpeculativeInliningPolicy *speculative_policy, Precompiler *precompiler)
intptr_t NextInlineId(const Function &function, const InstructionSource &source)
bool trace_inlining() const
static bool FunctionHasAlwaysConsiderInliningPragma(const Function &function)
static void SetInliningId(FlowGraph *flow_graph, intptr_t inlining_id)
SpeculativeInliningPolicy * speculative_policy()
static bool FunctionHasNeverInlinePragma(const Function &function)
static void CollectGraphInfo(FlowGraph *flow_graph, intptr_t num_constant_args, bool force, intptr_t *instruction_count, intptr_t *call_site_count)
FlowGraph * flow_graph() const
static bool FunctionHasPreferInlinePragma(const Function &function)
bool IsAllowedForInlining(intptr_t call_deopt_id) const
bool AllowsSpeculativeInlining() const
bool AddBlockedDeoptId(intptr_t id)
SpeculativeInliningPolicy(bool enable_suppression, intptr_t limit=-1)
Dart_NativeFunction function