Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle)
throw new PlatformNotSupportedException();
}

private static unsafe ref byte GetSpanDataFrom(
RuntimeFieldHandle fldHandle,
RuntimeTypeHandle targetTypeHandle,
out int count)
{
// We only support this intrinsic when it occurs within a well-defined IL sequence.
// If a call to this method occurs within the recognized sequence, codegen must expand the IL sequence completely.
// For any other purpose, the API is currently unsupported.
// https://github.com/dotnet/corert/issues/364
throw new PlatformNotSupportedException();
}

[RequiresUnreferencedCode("Trimmer can't guarantee existence of class constructor")]
public static void RunClassConstructor(RuntimeTypeHandle type)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ internal static bool CanPrimitiveWiden(CorElementType srcET, CorElementType dstE
/// <remarks>This method is intended for compiler use rather than use directly in code. T must be one of byte, sbyte, bool, char, short, ushort, int, uint, long, ulong, float, or double.</remarks>
[Intrinsic]
public static ReadOnlySpan<T> CreateSpan<T>(RuntimeFieldHandle fldHandle)
#if NATIVEAOT
// We only support this intrinsic when it occurs within a well-defined IL sequence.
// If a call to this method occurs within the recognized sequence, codegen must expand the IL sequence completely.
// For any other purpose, the API is currently unsupported.
// We shortcut this here instead of in `GetSpanDataFrom` to avoid `typeof(T)` below marking T target of reflection.
=> throw new PlatformNotSupportedException();
#else
=> new ReadOnlySpan<T>(ref Unsafe.As<byte, T>(ref GetSpanDataFrom(fldHandle, typeof(T).TypeHandle, out int length)), length);
#endif


// The following intrinsics return true if input is a compile-time constant
Expand Down
Loading