void LegacyPolicy::SetFailure(InlineObservation obs) { // Expect a valid observation assert(InlIsValidObservation(obs)); switch (m_Decision) { case InlineDecision::FAILURE: // Repeated failure only ok if evaluating a prejit root // (since we can't fail fast because we're not inlining) // or if inlining and the observation is CALLSITE_TOO_MANY_LOCALS // (since we can't fail fast from lvaGrabTemp). assert(m_IsPrejitRoot || (obs == InlineObservation::CALLSITE_TOO_MANY_LOCALS)); break; case InlineDecision::UNDECIDED: case InlineDecision::CANDIDATE: m_Decision = InlineDecision::FAILURE; m_Observation = obs; break; default: // SUCCESS, NEVER, or ?? assert(!"Unexpected m_Decision"); unreached(); } }
void LegacyPolicy::SetNever(InlineObservation obs) { // Expect a valid observation assert(InlIsValidObservation(obs)); switch (m_Decision) { case InlineDecision::NEVER: // Repeated never only ok if evaluating a prejit root assert(m_IsPrejitRoot); break; case InlineDecision::UNDECIDED: case InlineDecision::CANDIDATE: m_Decision = InlineDecision::NEVER; m_Observation = obs; break; default: // SUCCESS, FAILURE or ?? assert(!"Unexpected m_Decision"); unreached(); } }
InlineTarget InlGetTarget(InlineObservation obs) { assert(InlIsValidObservation(obs)); return InlineTargets[static_cast<int>(obs)]; }
const char* InlGetObservationString(InlineObservation obs) { assert(InlIsValidObservation(obs)); return InlineDescriptions[static_cast<int>(obs)]; }
InlineImpact InlGetImpact(InlineObservation obs) { assert(InlIsValidObservation(obs)); return InlineImpacts[static_cast<int>(obs)]; }