summaryrefslogtreecommitdiff
path: root/src/jit/inlinepolicy.cpp
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2016-10-25 09:31:47 -0700
committerAndy Ayers <andya@microsoft.com>2016-10-25 09:31:47 -0700
commitee0344e285c1c9727e35e16ff2502a8e4937a96e (patch)
treeb5aab46be6caa4951852224db0af8d7cd2b752f9 /src/jit/inlinepolicy.cpp
parent3103a70d1fbe733d2b4e7ed9e2ff795b888b8b79 (diff)
downloadcoreclr-ee0344e285c1c9727e35e16ff2502a8e4937a96e.tar.gz
coreclr-ee0344e285c1c9727e35e16ff2502a8e4937a96e.tar.bz2
coreclr-ee0344e285c1c9727e35e16ff2502a8e4937a96e.zip
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.
Diffstat (limited to 'src/jit/inlinepolicy.cpp')
-rw-r--r--src/jit/inlinepolicy.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/jit/inlinepolicy.cpp b/src/jit/inlinepolicy.cpp
index 20d18c4e4d..94a619815e 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