diff --git a/src/coreclr/inc/corjit.h b/src/coreclr/inc/corjit.h index 3c02853b1cfa0b..bf17388fd4bb64 100644 --- a/src/coreclr/inc/corjit.h +++ b/src/coreclr/inc/corjit.h @@ -32,13 +32,14 @@ // These are error codes returned by CompileMethod enum CorJitResult { - CORJIT_OK = 0, - CORJIT_BADCODE = (JITINTERFACE_HRESULT)0x80000001, - CORJIT_OUTOFMEM = (JITINTERFACE_HRESULT)0x80000002, - CORJIT_INTERNALERROR = (JITINTERFACE_HRESULT)0x80000003, - CORJIT_SKIPPED = (JITINTERFACE_HRESULT)0x80000004, - CORJIT_RECOVERABLEERROR = (JITINTERFACE_HRESULT)0x80000005, - CORJIT_IMPLLIMITATION= (JITINTERFACE_HRESULT)0x80000006, + CORJIT_OK = 0, + CORJIT_BADCODE = (JITINTERFACE_HRESULT)0x80000001, + CORJIT_OUTOFMEM = (JITINTERFACE_HRESULT)0x80000002, + CORJIT_INTERNALERROR = (JITINTERFACE_HRESULT)0x80000003, + CORJIT_SKIPPED = (JITINTERFACE_HRESULT)0x80000004, + CORJIT_RECOVERABLEERROR = (JITINTERFACE_HRESULT)0x80000005, + CORJIT_IMPLLIMITATION = (JITINTERFACE_HRESULT)0x80000006, + CORJIT_R2R_UNSUPPORTED = (JITINTERFACE_HRESULT)0x80000007, }; /*****************************************************************************/ diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index b1e4ab8c49fb07..75e98a796a949c 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -37,11 +37,11 @@ #include -constexpr GUID JITEEVersionIdentifier = { /* db46fd97-a8e8-4bda-9cec-d7feb061154c */ - 0xdb46fd97, - 0xa8e8, - 0x4bda, - {0x9c, 0xec, 0xd7, 0xfe, 0xb0, 0x61, 0x15, 0x4c} +constexpr GUID JITEEVersionIdentifier = { /* d98b5b0d-dd75-4e4d-b950-0d1cafd01dea */ + 0xd98b5b0d, + 0xdd75, + 0x4e4d, + {0xb9, 0x50, 0x0d, 0x1c, 0xaf, 0xd0, 0x1d, 0xea} }; #endif // JIT_EE_VERSIONING_GUID_H diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 2336eeeabbdfa0..f2ea29dd8ccef0 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -7706,7 +7706,8 @@ int jitNativeCode(CORINFO_METHOD_HANDLE methodHnd, result = param.result; if (!inlineInfo && - (result == CORJIT_INTERNALERROR || result == CORJIT_RECOVERABLEERROR || result == CORJIT_IMPLLIMITATION) && + (result == CORJIT_INTERNALERROR || result == CORJIT_RECOVERABLEERROR || result == CORJIT_IMPLLIMITATION || + result == CORJIT_R2R_UNSUPPORTED) && !jitFallbackCompile) { // If we failed the JIT, reattempt with debuggable code. diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 0cf381b8b2dc85..0b7048eba62798 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -8480,7 +8480,7 @@ class Compiler { if (mustExpand) { - implLimitation(); + implReadyToRunUnsupported(); } return true; } diff --git a/src/coreclr/jit/error.cpp b/src/coreclr/jit/error.cpp index afd74afac25064..cb7d1c88481d3f 100644 --- a/src/coreclr/jit/error.cpp +++ b/src/coreclr/jit/error.cpp @@ -77,6 +77,12 @@ void DECLSPEC_NORETURN implLimitation() fatal(CORJIT_IMPLLIMITATION); } +/*****************************************************************************/ +void DECLSPEC_NORETURN implReadyToRunUnsupported() +{ + fatal(CORJIT_R2R_UNSUPPORTED); +} + /*****************************************************************************/ void DECLSPEC_NORETURN NOMEM() { diff --git a/src/coreclr/jit/error.h b/src/coreclr/jit/error.h index 8bbd5cac3889e9..5692730cd4b6b0 100644 --- a/src/coreclr/jit/error.h +++ b/src/coreclr/jit/error.h @@ -66,6 +66,7 @@ extern void DECLSPEC_NORETURN badCode(); extern void DECLSPEC_NORETURN badCode3(const char* msg, const char* msg2, int arg, _In_z_ const char* file, unsigned line); extern void DECLSPEC_NORETURN noWay(); extern void DECLSPEC_NORETURN implLimitation(); +extern void DECLSPEC_NORETURN implReadyToRunUnsupported(); extern void DECLSPEC_NORETURN NOMEM(); extern void DECLSPEC_NORETURN fatal(int errCode); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 49a70a4085a0d8..b230a62e092ae7 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -381,7 +381,7 @@ private CompilationResult CompileMethodInternal(IMethodNode methodCodeNodeNeedin { ThrowHelper.ThrowInvalidProgramException(); } - if (result == CorJitResult.CORJIT_IMPLLIMITATION) + if (result == CorJitResult.CORJIT_IMPLLIMITATION || result == CorJitResult.CORJIT_R2R_UNSUPPORTED) { #if READYTORUN throw new RequiresRuntimeJitException("JIT implementation limitation"); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs index 29d780fbefce86..edbcb331cf2058 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs @@ -1467,6 +1467,7 @@ public enum CorJitResult CORJIT_SKIPPED = unchecked((int)0x80000004), CORJIT_RECOVERABLEERROR = unchecked((int)0x80000005), CORJIT_IMPLLIMITATION = unchecked((int)0x80000006), + CORJIT_R2R_UNSUPPORTED = unchecked((int)0x80000007), }; public enum TypeCompareState diff --git a/src/coreclr/tools/superpmi/superpmi/jitinstance.cpp b/src/coreclr/tools/superpmi/superpmi/jitinstance.cpp index 5caefae5767fa0..753452a80a4b2d 100644 --- a/src/coreclr/tools/superpmi/superpmi/jitinstance.cpp +++ b/src/coreclr/tools/superpmi/superpmi/jitinstance.cpp @@ -334,7 +334,7 @@ ReplayResults JitInstance::CompileMethod(MethodContext* MethodToCompile, int mcI } } - if ((jitResult == CORJIT_OK) || (jitResult == CORJIT_BADCODE)) + if ((jitResult == CORJIT_OK) || (jitResult == CORJIT_BADCODE) || (jitResult == CORJIT_R2R_UNSUPPORTED)) { // capture the results of compilation pParam->pThis->mc->cr->recCompileMethod(&NEntryBlock, &NCodeSizeBlock, jitResult); diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index f481c7b3d3d200..8254617caef995 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -13148,6 +13148,7 @@ void ThrowExceptionForJit(HRESULT res) case CORJIT_BADCODE: case CORJIT_IMPLLIMITATION: + case CORJIT_R2R_UNSUPPORTED: default: COMPlusThrow(kInvalidProgramException); break;