2015-04-07 09:35:12 +01:00
|
|
|
|
|
|
|
namespace System.Runtime.CompilerServices {
|
|
|
|
|
|
|
|
internal static class JitHelpers
|
|
|
|
{
|
|
|
|
static internal T UnsafeCast<T>(Object o) where T : class
|
|
|
|
{
|
2015-08-26 07:17:56 -04:00
|
|
|
return Array.UnsafeMov<object, T> (o);
|
|
|
|
}
|
|
|
|
|
|
|
|
static internal int UnsafeEnumCast<T>(T val) where T : struct
|
|
|
|
{
|
|
|
|
return Array.UnsafeMov<T, int> (val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static internal long UnsafeEnumCastLong<T>(T val) where T : struct
|
|
|
|
{
|
2016-02-22 11:00:01 -05:00
|
|
|
return Array.UnsafeMov<T, long> (val);
|
2015-04-07 09:35:12 +01:00
|
|
|
}
|
2019-07-26 19:53:28 +00:00
|
|
|
|
|
|
|
#if NETCORE
|
|
|
|
[Intrinsic]
|
|
|
|
internal static bool EnumEquals<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException ();
|
|
|
|
|
|
|
|
[Intrinsic]
|
|
|
|
internal static int EnumCompareTo<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException ();
|
|
|
|
#endif
|
2015-04-07 09:35:12 +01:00
|
|
|
}
|
|
|
|
}
|