From ee0344e285c1c9727e35e16ff2502a8e4937a96e Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 25 Oct 2016 09:31:47 -0700 Subject: [PATCH] Inliner: fix RARE_GC_STRUCT observation impact Closes #7792. Since this observation isn't always fatal, change its impact to INFORMATION. Also, refresh the assertion checking around fatal observations so that the EnhancedLegacyPolicy (which is the current default) will catch this kind of error going forward. --- src/jit/inline.def | 2 +- src/jit/inlinepolicy.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/jit/inline.def b/src/jit/inline.def index 71d4410..f73015d 100644 --- a/src/jit/inline.def +++ b/src/jit/inline.def @@ -156,7 +156,7 @@ INLINE_OBSERVATION(TOO_MANY_LOCALS, bool, "too many locals", // ------ Call Site Performance ------- -INLINE_OBSERVATION(RARE_GC_STRUCT, bool, "rarely called, has gc struct", FATAL, CALLSITE) +INLINE_OBSERVATION(RARE_GC_STRUCT, bool, "rarely called, has gc struct", INFORMATION, CALLSITE) // ------ Call Site Information ------- diff --git a/src/jit/inlinepolicy.cpp b/src/jit/inlinepolicy.cpp index 20d18c4..94a6198 100644 --- a/src/jit/inlinepolicy.cpp +++ b/src/jit/inlinepolicy.cpp @@ -106,7 +106,7 @@ InlinePolicy* InlinePolicy::GetPolicy(Compiler* compiler, bool isPrejitRoot) void LegalPolicy::NoteFatal(InlineObservation obs) { // As a safeguard, all fatal impact must be - // reported via noteFatal. + // reported via NoteFatal. assert(InlGetImpact(obs) == InlineImpact::FATAL); NoteInternal(obs); assert(InlDecisionIsFailure(m_Decision)); @@ -243,7 +243,7 @@ void LegacyPolicy::NoteBool(InlineObservation obs, bool value) InlineImpact impact = InlGetImpact(obs); // As a safeguard, all fatal impact must be - // reported via noteFatal. + // reported via NoteFatal. assert(impact != InlineImpact::FATAL); // Handle most information here @@ -847,6 +847,16 @@ int LegacyPolicy::CodeSizeEstimate() void EnhancedLegacyPolicy::NoteBool(InlineObservation obs, bool value) { + +#ifdef DEBUG + // Check the impact + InlineImpact impact = InlGetImpact(obs); + + // As a safeguard, all fatal impact must be + // reported via NoteFatal. + assert(impact != InlineImpact::FATAL); +#endif // DEBUG + switch (obs) { case InlineObservation::CALLEE_DOES_NOT_RETURN: @@ -1001,7 +1011,7 @@ void RandomPolicy::NoteBool(InlineObservation obs, bool value) InlineImpact impact = InlGetImpact(obs); // As a safeguard, all fatal impact must be - // reported via noteFatal. + // reported via NoteFatal. assert(impact != InlineImpact::FATAL); // Handle most information here -- 2.7.4