ReplayPolicy::ReplayPolicy(Compiler* compiler, bool isPrejitRoot)
: DiscretionaryPolicy(compiler, isPrejitRoot)
, m_InlineContext(nullptr)
+ , m_Offset(BAD_IL_OFFSET)
+ , m_WasForceInline(false)
{
// Is there a log file open already? If so, we can use it.
if (s_ReplayFile == nullptr)
{
offset = (int) jitGetILoffs(m_Offset);
}
-
+
unsigned calleeOffset = (unsigned) offset;
bool foundInline = FindInline(calleeToken, calleeHash, calleeOffset);
}
//------------------------------------------------------------------------
+// NoteBool: handle an observed boolean value
+//
+// Arguments:
+// obs - the current obsevation
+// value - the value being observed
+//
+// Notes:
+// Overrides parent so Replay can control force inlines.
+
+void ReplayPolicy::NoteBool(InlineObservation obs, bool value)
+{
+ // When inlining, let log override force inline.
+ // Make a note of the actual value for later reporting during observations.
+ if (!m_IsPrejitRoot && (obs == InlineObservation::CALLEE_IS_FORCE_INLINE))
+ {
+ m_WasForceInline = value;
+ value = false;
+ }
+
+ DiscretionaryPolicy::NoteBool(obs, value);
+}
+
+//------------------------------------------------------------------------
// DetermineProfitability: determine if this inline is profitable
//
// Arguments:
{
MethodInfoObservations(methodInfo);
EstimateCodeSize();
+ m_IsForceInline = m_WasForceInline;
}
// Try and find this candiate in the Xml.
// Construct a ReplayPolicy
ReplayPolicy(Compiler* compiler, bool isPrejitRoot);
+ // Policy observations
+ void NoteBool(InlineObservation obs, bool value) override;
+
// Optional observations
void NoteContext(InlineContext* context) override
{
static CritSecObject s_XmlReaderLock;
InlineContext* m_InlineContext;
IL_OFFSETX m_Offset;
+ bool m_WasForceInline;
};
#endif // defined(DEBUG) || defined(INLINE_DATA)