From 1e08c762ba686282eb3075e260a7a309e0f31646 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Thu, 9 Feb 2017 14:23:45 -0800 Subject: [PATCH] JIT: fix confusing inline failure reason When attempting to inline a method from the core library, the inline will fail if the method being inlined has a noinline callee; the presumption being that the callee expects to be able to find it's immediate caller on the stack (this may or not may be the case, see dotnet/coreclr#8102). Update the failure message for this case to hopefully better explain why the inline doesn't happen. Commit migrated from https://github.com/dotnet/coreclr/commit/0826f9dee6a8fdf8266523945708a684376b0280 --- src/coreclr/src/jit/importer.cpp | 2 +- src/coreclr/src/jit/inline.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index c9b92a2..b1e0f48 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -6519,7 +6519,7 @@ var_types Compiler::impImportCall(OPCODE opcode, if (mflags & CORINFO_FLG_DONT_INLINE_CALLER) { - compInlineResult->NoteFatal(InlineObservation::CALLEE_STACK_CRAWL_MARK); + compInlineResult->NoteFatal(InlineObservation::CALLEE_HAS_NOINLINE_CALLEE); return callRetTyp; } diff --git a/src/coreclr/src/jit/inline.def b/src/coreclr/src/jit/inline.def index ff0b211..2a6f5a3 100644 --- a/src/coreclr/src/jit/inline.def +++ b/src/coreclr/src/jit/inline.def @@ -39,6 +39,7 @@ INLINE_OBSERVATION(HAS_LEAVE, bool, "has leave", INLINE_OBSERVATION(HAS_MANAGED_VARARGS, bool, "managed varargs", FATAL, CALLEE) INLINE_OBSERVATION(HAS_NATIVE_VARARGS, bool, "native varargs", FATAL, CALLEE) INLINE_OBSERVATION(HAS_NO_BODY, bool, "has no body", FATAL, CALLEE) +INLINE_OBSERVATION(HAS_NOINLINE_CALLEE, bool, "in corelib, noinline callee", FATAL, CALLEE) INLINE_OBSERVATION(HAS_NULL_FOR_LDELEM, bool, "has null pointer for ldelem", FATAL, CALLEE) INLINE_OBSERVATION(IS_ARRAY_METHOD, bool, "is array method", FATAL, CALLEE) INLINE_OBSERVATION(IS_GENERIC_VIRTUAL, bool, "generic virtual", FATAL, CALLEE) @@ -55,7 +56,6 @@ INLINE_OBSERVATION(NEEDS_SECURITY_CHECK, bool, "needs security check", INLINE_OBSERVATION(NO_METHOD_INFO, bool, "cannot get method info", FATAL, CALLEE) INLINE_OBSERVATION(NOT_PROFITABLE_INLINE, bool, "unprofitable inline", FATAL, CALLEE) INLINE_OBSERVATION(RANDOM_REJECT, bool, "random reject", FATAL, CALLEE) -INLINE_OBSERVATION(STACK_CRAWL_MARK, bool, "uses stack crawl mark", FATAL, CALLEE) INLINE_OBSERVATION(STFLD_NEEDS_HELPER, bool, "stfld needs helper", FATAL, CALLEE) INLINE_OBSERVATION(THROW_WITH_INVALID_STACK, bool, "throw with invalid stack", FATAL, CALLEE) INLINE_OBSERVATION(TOO_MANY_ARGUMENTS, bool, "too many arguments", FATAL, CALLEE) -- 2.7.4