diff --git a/src/coreclr/inc/readytorun.h b/src/coreclr/inc/readytorun.h index 702efdce58697d..74ab3da854e082 100644 --- a/src/coreclr/inc/readytorun.h +++ b/src/coreclr/inc/readytorun.h @@ -20,7 +20,7 @@ // If you update this, ensure you run `git grep MINIMUM_READYTORUN_MAJOR_VERSION` // and handle pending work. #define READYTORUN_MAJOR_VERSION 18 -#define READYTORUN_MINOR_VERSION 0x0003 +#define READYTORUN_MINOR_VERSION 0x0004 #define MINIMUM_READYTORUN_MAJOR_VERSION 18 @@ -54,6 +54,7 @@ // R2R Version 18 updates fields layout algorithm // R2R Version 18.2 adds InitClass and InitInstClass helpers // R2R Version 18.3 adds the ExternalTypeMaps, ProxyTypeMaps, TypeMapAssemblyTargets sections +// R2R Version 18.4 adds ThrowArgument, ThrowArgumentOutOfRange, ThrowPlatformNotSupported, and ThrowNotImplemented helpers struct READYTORUN_CORE_HEADER { @@ -346,6 +347,10 @@ enum ReadyToRunHelper READYTORUN_HELPER_ThrowNullRef = 0x25, READYTORUN_HELPER_ThrowDivZero = 0x26, READYTORUN_HELPER_ThrowExact = 0x27, + READYTORUN_HELPER_ThrowArgument = 0x28, + READYTORUN_HELPER_ThrowArgumentOutOfRange = 0x29, + READYTORUN_HELPER_ThrowPlatformNotSupported = 0x2A, + READYTORUN_HELPER_ThrowNotImplemented = 0x2B, // Write barriers READYTORUN_HELPER_WriteBarrier = 0x30, diff --git a/src/coreclr/inc/readytorunhelpers.h b/src/coreclr/inc/readytorunhelpers.h index 35ff922e413a6d..e4402eaf0743e7 100644 --- a/src/coreclr/inc/readytorunhelpers.h +++ b/src/coreclr/inc/readytorunhelpers.h @@ -21,6 +21,10 @@ HELPER(READYTORUN_HELPER_FailFast, CORINFO_HELP_FAIL_FAST, HELPER(READYTORUN_HELPER_ThrowNullRef, CORINFO_HELP_THROWNULLREF, OPTIMIZEFORSIZE) HELPER(READYTORUN_HELPER_ThrowDivZero, CORINFO_HELP_THROWDIVZERO, OPTIMIZEFORSIZE) HELPER(READYTORUN_HELPER_ThrowExact, CORINFO_HELP_THROWEXACT, OPTIMIZEFORSIZE) +HELPER(READYTORUN_HELPER_ThrowArgument, CORINFO_HELP_THROW_ARGUMENTEXCEPTION, OPTIMIZEFORSIZE) +HELPER(READYTORUN_HELPER_ThrowArgumentOutOfRange, CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, OPTIMIZEFORSIZE) +HELPER(READYTORUN_HELPER_ThrowPlatformNotSupported, CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, OPTIMIZEFORSIZE) +HELPER(READYTORUN_HELPER_ThrowNotImplemented, CORINFO_HELP_THROW_NOT_IMPLEMENTED, OPTIMIZEFORSIZE) HELPER(READYTORUN_HELPER_WriteBarrier, CORINFO_HELP_ASSIGN_REF, ) HELPER(READYTORUN_HELPER_CheckedWriteBarrier, CORINFO_HELP_CHECKED_ASSIGN_REF, ) diff --git a/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h b/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h index e33145fd6a54b0..33a69be66da6cd 100644 --- a/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h +++ b/src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h @@ -12,7 +12,7 @@ struct ReadyToRunHeaderConstants static const uint32_t Signature = 0x00525452; // 'RTR' static const uint32_t CurrentMajorVersion = 18; - static const uint32_t CurrentMinorVersion = 3; + static const uint32_t CurrentMinorVersion = 4; }; struct ReadyToRunHeader diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs index 03f76b8f9ba99e..8cc8bb36e747b2 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -16,7 +16,7 @@ internal struct ReadyToRunHeaderConstants public const uint Signature = 0x00525452; // 'RTR' public const ushort CurrentMajorVersion = 18; - public const ushort CurrentMinorVersion = 3; + public const ushort CurrentMinorVersion = 4; } #if READYTORUN #pragma warning disable 0169 diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs index bb877a077e3b74..63e9d707b7c1f1 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs @@ -234,6 +234,10 @@ public enum ReadyToRunHelper ThrowNullRef = 0x25, ThrowDivZero = 0x26, ThrowExact = 0x27, + ThrowArgument = 0x28, + ThrowArgumentOutOfRange = 0x29, + ThrowPlatformNotSupported = 0x2A, + ThrowNotImplemented = 0x2B, // Write barriers WriteBarrier = 0x30, @@ -372,11 +376,6 @@ public enum ReadyToRunHelper // Marker to be used in asserts. FirstFakeHelper, - ThrowArgumentOutOfRange, - ThrowArgument, - ThrowPlatformNotSupported, - ThrowNotImplemented, - DebugBreak, GetRuntimeType, diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index 443347112fc52c..024669a0c16dac 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -1291,17 +1291,25 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) id = ReadyToRunHelper.InitInstClass; break; - case CorInfoHelpFunc.CORINFO_HELP_GETSYNCFROMCLASSHANDLE: - case CorInfoHelpFunc.CORINFO_HELP_GETCLASSFROMMETHODPARAM: case CorInfoHelpFunc.CORINFO_HELP_THROW_ARGUMENTEXCEPTION: + id = ReadyToRunHelper.ThrowArgument; + break; case CorInfoHelpFunc.CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION: + id = ReadyToRunHelper.ThrowArgumentOutOfRange; + break; case CorInfoHelpFunc.CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED: + id = ReadyToRunHelper.ThrowPlatformNotSupported; + break; + case CorInfoHelpFunc.CORINFO_HELP_THROW_NOT_IMPLEMENTED: + id = ReadyToRunHelper.ThrowNotImplemented; + break; + + case CorInfoHelpFunc.CORINFO_HELP_GETSYNCFROMCLASSHANDLE: + case CorInfoHelpFunc.CORINFO_HELP_GETCLASSFROMMETHODPARAM: case CorInfoHelpFunc.CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL: case CorInfoHelpFunc.CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE_MAYBENULL: case CorInfoHelpFunc.CORINFO_HELP_GETREFANY: case CorInfoHelpFunc.CORINFO_HELP_NEW_MDARR_RARE: - // For Vector256.Create and similar cases - case CorInfoHelpFunc.CORINFO_HELP_THROW_NOT_IMPLEMENTED: // For x86 tailcall where helper is required we need runtime JIT. case CorInfoHelpFunc.CORINFO_HELP_TAILCALL: // DirectOnThreadLocalData helper is used at runtime during R2R fixup resolution, not during R2R compilation diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs index 2547a936f57f0b..406effbb5305aa 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs @@ -1690,6 +1690,22 @@ private void ParseHelper(StringBuilder builder) builder.Append("THROW_DIV_ZERO"); break; + case ReadyToRunHelper.ThrowArgument: + builder.Append("THROW_ARGUMENT"); + break; + + case ReadyToRunHelper.ThrowArgumentOutOfRange: + builder.Append("THROW_ARGUMENT_OUT_OF_RANGE"); + break; + + case ReadyToRunHelper.ThrowPlatformNotSupported: + builder.Append("THROW_PLATFORM_NOT_SUPPORTED"); + break; + + case ReadyToRunHelper.ThrowNotImplemented: + builder.Append("THROW_NOT_IMPLEMENTED"); + break; + // Write barriers case ReadyToRunHelper.WriteBarrier: builder.Append("WRITE_BARRIER");