diff options
author | Andy Ayers <andya@microsoft.com> | 2016-03-09 16:04:11 -0800 |
---|---|---|
committer | Andy Ayers <andya@microsoft.com> | 2016-03-09 18:20:38 -0800 |
commit | 9cbd25871b360647686a79be6d9021bbefd84313 (patch) | |
tree | 06bc910f599177f77f7ce817dc3e38c0c66155e0 /src/jit/inline.h | |
parent | 587e7c08ef1edc53d2ce6bf90da0c63ba70aa00b (diff) | |
download | coreclr-9cbd25871b360647686a79be6d9021bbefd84313.tar.gz coreclr-9cbd25871b360647686a79be6d9021bbefd84313.tar.bz2 coreclr-9cbd25871b360647686a79be6d9021bbefd84313.zip |
Inline refactoring: move profitability assessment to LegacyPolicy
LegacyPolicy now encapsulates all the computations needed to evaluate
whether an inline is profitable or not.
This completes the main objective of the refactoring effort, which
was to preserve and encapsulate the current inliner's behavior.
Diffstat (limited to 'src/jit/inline.h')
-rw-r--r-- | src/jit/inline.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/jit/inline.h b/src/jit/inline.h index 923140daa9..8e1cbea8b3 100644 --- a/src/jit/inline.h +++ b/src/jit/inline.h @@ -241,9 +241,7 @@ public: virtual void NoteDouble(InlineObservation obs, double value) = 0; // Policy determinations - virtual double DetermineMultiplier() = 0; - virtual int DetermineNativeSizeEstimate() = 0; - virtual int DetermineCallsiteNativeSizeEstimate(CORINFO_METHOD_INFO* methodInfo) = 0; + virtual void DetermineProfitability(CORINFO_METHOD_INFO* methodInfo) = 0; // Policy policies virtual bool PropagateNeverToRuntime() const = 0; @@ -320,6 +318,16 @@ public: return InlDecisionIsCandidate(m_Policy->GetDecision()); } + // Has the policy determined this inline attempt is still viable + // and is a discretionary inline? + bool IsDiscretionaryCandidate() const + { + bool result = InlDecisionIsCandidate(m_Policy->GetDecision()) && + (m_Policy->GetObservation() == InlineObservation::CALLEE_IS_DISCRETIONARY_INLINE); + + return result; + } + // Has the policy made a determination? bool IsDecided() const { @@ -373,22 +381,10 @@ public: m_Policy->NoteDouble(obs, value); } - // Determine the benfit multiplier for this inline. - double DetermineMultiplier() - { - return m_Policy->DetermineMultiplier(); - } - - // Determine the native size estimate for this inline - int DetermineNativeSizeEstimate() - { - return m_Policy->DetermineNativeSizeEstimate(); - } - - // Determine the native size estimate for this call site - int DetermineCallsiteNativeSizeEstimate(CORINFO_METHOD_INFO* methodInfo) + // Determine if this inline is profitable + void DetermineProfitability(CORINFO_METHOD_INFO* methodInfo) { - return m_Policy->DetermineCallsiteNativeSizeEstimate(methodInfo); + return m_Policy->DetermineProfitability(methodInfo); } // Ensure details of this inlining process are appropriately |