Sticking to default calling convention is key for interoperability that is the primary goal of R2R.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7f61feafae3cdc9e560629e0bf2a03e64936a7b5
inline bool IsJit64Compat()
{
#if defined(_TARGET_AMD64_) && !defined(FEATURE_CORECLR)
- // JIT64 interop not required for ReadyToRun since it can simply fall-back
- return !IsReadyToRun();
-#else // defined(_TARGET_AMD64_) && !defined(FEATURE_CORECLR)
+ return true;
+#else
return false;
#endif
}
// the time being that the callee might be compiled by the other JIT and thus the return
// value will need to be widened by us (or not widened at all...)
- bool checkForSmallType = opts.IsJit64Compat();
+ // ReadyToRun code sticks with default calling convention that does not widen small return types.
+
+ bool checkForSmallType = opts.IsJit64Compat() || opts.IsReadyToRun();
bool bIntrinsicImported = false;
CORINFO_SIG_INFO calliSig;