Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::SpeculativeInliningPolicy Class Reference

#include <inliner.h>

Public Member Functions

 SpeculativeInliningPolicy (bool enable_suppression, intptr_t limit=-1)
 
bool AllowsSpeculativeInlining () const
 
bool IsAllowedForInlining (intptr_t call_deopt_id) const
 
bool AddBlockedDeoptId (intptr_t id)
 
intptr_t length () const
 

Detailed Description

Definition at line 33 of file inliner.h.

Constructor & Destructor Documentation

◆ SpeculativeInliningPolicy()

dart::SpeculativeInliningPolicy::SpeculativeInliningPolicy ( bool  enable_suppression,
intptr_t  limit = -1 
)
inlineexplicit

Definition at line 35 of file inliner.h.

37 : enable_suppression_(enable_suppression), remaining_(limit) {}

Member Function Documentation

◆ AddBlockedDeoptId()

bool dart::SpeculativeInliningPolicy::AddBlockedDeoptId ( intptr_t  id)
inline

Definition at line 58 of file inliner.h.

58 {
59 ASSERT(enable_suppression_);
60#if defined(DEBUG)
61 ASSERT(!IsSuppressed(id));
62#endif
63
64 // If we exhausted the number of suppression entries there is no point
65 // in adding entries to the list.
66 if (remaining_ <= 0) return false;
67
68 inlining_suppressions_.Add(id);
69 remaining_ -= 1;
70 return true;
71 }
void Add(const T &value)
#define ASSERT(E)

◆ AllowsSpeculativeInlining()

bool dart::SpeculativeInliningPolicy::AllowsSpeculativeInlining ( ) const
inline

Definition at line 39 of file inliner.h.

39 {
40 return !enable_suppression_ || remaining_ > 0;
41 }

◆ IsAllowedForInlining()

bool dart::SpeculativeInliningPolicy::IsAllowedForInlining ( intptr_t  call_deopt_id) const
inline

Definition at line 43 of file inliner.h.

43 {
44 // If we are not suppressing, we always enable optimistic inlining.
45 if (!enable_suppression_) {
46 return true;
47 }
48
49 // If we have already suppressed the deopt-id we don't allow inlining it.
50 if (IsSuppressed(call_deopt_id)) {
51 return false;
52 }
53
54 // Allow it if we can bailout at least one more time.
55 return remaining_ > 0;
56 }

◆ length()

intptr_t dart::SpeculativeInliningPolicy::length ( ) const
inline

Definition at line 73 of file inliner.h.

73{ return inlining_suppressions_.length(); }
intptr_t length() const

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