summaryrefslogtreecommitdiff
path: root/src/jit/inlinepolicy.cpp
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2018-01-05 16:41:02 -0800
committerGitHub <noreply@github.com>2018-01-05 16:41:02 -0800
commita46475cdacca8beeb02193c2298f1df62328a317 (patch)
tree43bdf05c96245c74ccbb1d914b0ef1cb7c2672f8 /src/jit/inlinepolicy.cpp
parenta91d3fd660568a53a9395ef5d0eeaf869e56606a (diff)
downloadcoreclr-a46475cdacca8beeb02193c2298f1df62328a317.tar.gz
coreclr-a46475cdacca8beeb02193c2298f1df62328a317.tar.bz2
coreclr-a46475cdacca8beeb02193c2298f1df62328a317.zip
JIT: fix issue with inline observations (#15713)
In DEBUG/CHECK builds the jit tries to keep track of failed inlines. Because inlines can be rejected "early" (when the parent method is being imported) as well as "late" (when their call site is encountered by the inliner) there is a tracking mechanism to convey the early observations that cause failures to be resurrected later on. These observations sometimes didn't end up in the inline context, leading to assertions when dumping methods. Fix is to add a new way to propagate the earlier observation to the context that bypasses some of the policy sanity checks and simply record the reason that the inline failed.
Diffstat (limited to 'src/jit/inlinepolicy.cpp')
-rw-r--r--src/jit/inlinepolicy.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/jit/inlinepolicy.cpp b/src/jit/inlinepolicy.cpp
index 2d4ebfd327..959ef1ba68 100644
--- a/src/jit/inlinepolicy.cpp
+++ b/src/jit/inlinepolicy.cpp
@@ -104,6 +104,27 @@ void LegalPolicy::NoteFatal(InlineObservation obs)
assert(InlDecisionIsFailure(m_Decision));
}
+#if defined(DEBUG) || defined(INLINE_DATA)
+
+//------------------------------------------------------------------------
+// NotePriorFailure: record reason for earlier inline failure
+//
+// Arguments:
+// obs - the current obsevation
+//
+// Notes:
+// Used to "resurrect" failure observations from the early inline
+// screen when building the inline context tree. Only used during
+// debug modes.
+
+void LegalPolicy::NotePriorFailure(InlineObservation obs)
+{
+ NoteInternal(obs);
+ assert(InlDecisionIsFailure(m_Decision));
+}
+
+#endif // defined(DEBUG) || defined(INLINE_DATA)
+
//------------------------------------------------------------------------
// NoteInternal: helper for handling an observation
//