Skip to content

Commit 062177e

Browse files
EgorBojkotas
andauthored
Use CORJIT_PREJIT_UNSUPPORTED instead of CORJIT_LIMITATION for BlockNonDeterministicIntrinsics (#123716)
Apply @jakobbotsch's suggestion to unblock failing SPMI (x86-crossgen) --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com>
1 parent 72a1102 commit 062177e

File tree

10 files changed

+27
-16
lines changed

10 files changed

+27
-16
lines changed

src/coreclr/inc/corjit.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@
3232
// These are error codes returned by CompileMethod
3333
enum CorJitResult
3434
{
35-
CORJIT_OK = 0,
36-
CORJIT_BADCODE = (JITINTERFACE_HRESULT)0x80000001,
37-
CORJIT_OUTOFMEM = (JITINTERFACE_HRESULT)0x80000002,
38-
CORJIT_INTERNALERROR = (JITINTERFACE_HRESULT)0x80000003,
39-
CORJIT_SKIPPED = (JITINTERFACE_HRESULT)0x80000004,
40-
CORJIT_RECOVERABLEERROR = (JITINTERFACE_HRESULT)0x80000005,
41-
CORJIT_IMPLLIMITATION= (JITINTERFACE_HRESULT)0x80000006,
35+
CORJIT_OK = 0,
36+
CORJIT_BADCODE = (JITINTERFACE_HRESULT)0x80000001,
37+
CORJIT_OUTOFMEM = (JITINTERFACE_HRESULT)0x80000002,
38+
CORJIT_INTERNALERROR = (JITINTERFACE_HRESULT)0x80000003,
39+
CORJIT_SKIPPED = (JITINTERFACE_HRESULT)0x80000004,
40+
CORJIT_RECOVERABLEERROR = (JITINTERFACE_HRESULT)0x80000005,
41+
CORJIT_IMPLLIMITATION = (JITINTERFACE_HRESULT)0x80000006,
42+
CORJIT_R2R_UNSUPPORTED = (JITINTERFACE_HRESULT)0x80000007,
4243
};
4344

4445
/*****************************************************************************/

src/coreclr/inc/jiteeversionguid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737

3838
#include <minipal/guid.h>
3939

40-
constexpr GUID JITEEVersionIdentifier = { /* db46fd97-a8e8-4bda-9cec-d7feb061154c */
41-
0xdb46fd97,
42-
0xa8e8,
43-
0x4bda,
44-
{0x9c, 0xec, 0xd7, 0xfe, 0xb0, 0x61, 0x15, 0x4c}
40+
constexpr GUID JITEEVersionIdentifier = { /* d98b5b0d-dd75-4e4d-b950-0d1cafd01dea */
41+
0xd98b5b0d,
42+
0xdd75,
43+
0x4e4d,
44+
{0xb9, 0x50, 0x0d, 0x1c, 0xaf, 0xd0, 0x1d, 0xea}
4545
};
4646

4747
#endif // JIT_EE_VERSIONING_GUID_H

src/coreclr/jit/compiler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7715,7 +7715,8 @@ int jitNativeCode(CORINFO_METHOD_HANDLE methodHnd,
77157715
result = param.result;
77167716

77177717
if (!inlineInfo &&
7718-
(result == CORJIT_INTERNALERROR || result == CORJIT_RECOVERABLEERROR || result == CORJIT_IMPLLIMITATION) &&
7718+
(result == CORJIT_INTERNALERROR || result == CORJIT_RECOVERABLEERROR || result == CORJIT_IMPLLIMITATION ||
7719+
result == CORJIT_R2R_UNSUPPORTED) &&
77197720
!jitFallbackCompile)
77207721
{
77217722
// If we failed the JIT, reattempt with debuggable code.

src/coreclr/jit/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8488,7 +8488,7 @@ class Compiler
84888488
{
84898489
if (mustExpand)
84908490
{
8491-
implLimitation();
8491+
implReadyToRunUnsupported();
84928492
}
84938493
return true;
84948494
}

src/coreclr/jit/error.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ void DECLSPEC_NORETURN implLimitation()
7777
fatal(CORJIT_IMPLLIMITATION);
7878
}
7979

80+
/*****************************************************************************/
81+
void DECLSPEC_NORETURN implReadyToRunUnsupported()
82+
{
83+
fatal(CORJIT_R2R_UNSUPPORTED);
84+
}
85+
8086
/*****************************************************************************/
8187
void DECLSPEC_NORETURN NOMEM()
8288
{

src/coreclr/jit/error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extern void DECLSPEC_NORETURN badCode();
6666
extern void DECLSPEC_NORETURN badCode3(const char* msg, const char* msg2, int arg, _In_z_ const char* file, unsigned line);
6767
extern void DECLSPEC_NORETURN noWay();
6868
extern void DECLSPEC_NORETURN implLimitation();
69+
extern void DECLSPEC_NORETURN implReadyToRunUnsupported();
6970
extern void DECLSPEC_NORETURN NOMEM();
7071
extern void DECLSPEC_NORETURN fatal(int errCode);
7172

src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ private CompilationResult CompileMethodInternal(IMethodNode methodCodeNodeNeedin
381381
{
382382
ThrowHelper.ThrowInvalidProgramException();
383383
}
384-
if (result == CorJitResult.CORJIT_IMPLLIMITATION)
384+
if (result == CorJitResult.CORJIT_IMPLLIMITATION || result == CorJitResult.CORJIT_R2R_UNSUPPORTED)
385385
{
386386
#if READYTORUN
387387
throw new RequiresRuntimeJitException("JIT implementation limitation");

src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,7 @@ public enum CorJitResult
14671467
CORJIT_SKIPPED = unchecked((int)0x80000004),
14681468
CORJIT_RECOVERABLEERROR = unchecked((int)0x80000005),
14691469
CORJIT_IMPLLIMITATION = unchecked((int)0x80000006),
1470+
CORJIT_R2R_UNSUPPORTED = unchecked((int)0x80000007),
14701471
};
14711472

14721473
public enum TypeCompareState

src/coreclr/tools/superpmi/superpmi/jitinstance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ ReplayResults JitInstance::CompileMethod(MethodContext* MethodToCompile, int mcI
334334
}
335335
}
336336

337-
if ((jitResult == CORJIT_OK) || (jitResult == CORJIT_BADCODE))
337+
if ((jitResult == CORJIT_OK) || (jitResult == CORJIT_BADCODE) || (jitResult == CORJIT_R2R_UNSUPPORTED))
338338
{
339339
// capture the results of compilation
340340
pParam->pThis->mc->cr->recCompileMethod(&NEntryBlock, &NCodeSizeBlock, jitResult);

src/coreclr/vm/jitinterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13148,6 +13148,7 @@ void ThrowExceptionForJit(HRESULT res)
1314813148

1314913149
case CORJIT_BADCODE:
1315013150
case CORJIT_IMPLLIMITATION:
13151+
case CORJIT_R2R_UNSUPPORTED:
1315113152
default:
1315213153
COMPlusThrow(kInvalidProgramException);
1315313154
break;

0 commit comments

Comments
 (0)