You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
parent
88ff76fe28
commit
e46a49ecf1
118
mcs/class/corlib/System.Runtime.CompilerServices/Unsafe.cs
Normal file
118
mcs/class/corlib/System.Runtime.CompilerServices/Unsafe.cs
Normal file
@ -0,0 +1,118 @@
|
||||
//
|
||||
// Unsafe.cs: Compile only stubs for Unsafe implementation
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar (marek.safar@gmail.com)
|
||||
//
|
||||
// Copyright (C) 2017 Microsoft Corporation (http://microsoft.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Runtime.CompilerServices
|
||||
{
|
||||
static partial class Unsafe
|
||||
{
|
||||
public static ref T Add<T> (ref T source, int elementOffset)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static ref T Add<T> (ref T source, System.IntPtr elementOffset)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public unsafe static void* Add<T> (void* source, int elementOffset)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static ref T AddByteOffset<T> (ref T source, System.IntPtr byteOffset)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static bool AreSame<T> (ref T left, ref T right)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static T As<T> (object o) where T : class
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static ref TTo As<TFrom, TTo>(ref TFrom source)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public unsafe static ref T AsRef<T> (void* source)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static System.IntPtr ByteOffset<T> (ref T origin, ref T target)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static void CopyBlock (ref byte destination, ref byte source, uint byteCount)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static void InitBlockUnaligned (ref byte startAddress, byte value, uint byteCount)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public unsafe static void InitBlockUnaligned (void* startAddress, byte value, uint byteCount)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public unsafe static T Read<T> (void* source)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static T ReadUnaligned<T> (ref byte source)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static int SizeOf<T> ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static ref T Subtract<T> (ref T source, int elementOffset)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public static void WriteUnaligned<T> (ref byte destination, T value)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
351
mcs/class/corlib/System.Runtime.CompilerServices/Unsafe.il
Normal file
351
mcs/class/corlib/System.Runtime.CompilerServices/Unsafe.il
Normal file
@ -0,0 +1,351 @@
|
||||
// Simplified version of ../../../external/corefx/src/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il
|
||||
|
||||
.class public abstract auto ansi sealed beforefieldinit System.Runtime.CompilerServices.Unsafe
|
||||
{
|
||||
.method public hidebysig static !!T Read<T>(void* source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
ldobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T ReadUnaligned<T>(void* source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
unaligned. 0x1
|
||||
ldobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T ReadUnaligned<T>(uint8& source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
unaligned. 0x1
|
||||
ldobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void Write<T>(void* destination,
|
||||
!!T 'value') cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
stobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void WriteUnaligned<T>(void* destination,
|
||||
!!T 'value') cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
unaligned. 0x01
|
||||
stobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void WriteUnaligned<T>(uint8& destination,
|
||||
!!T 'value') cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
unaligned. 0x01
|
||||
stobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void Copy<T>(void* destination,
|
||||
!!T& source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldobj !!T
|
||||
stobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void Copy<T>(!!T& destination,
|
||||
void* source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldobj !!T
|
||||
stobj !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void* AsPointer<T>(!!T& 'value') cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
conv.u
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static int32 SizeOf<T>() cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
sizeof !!T
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void CopyBlock(void* destination, void* source, uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
cpblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void CopyBlock(uint8& destination, uint8& source, uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
cpblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void CopyBlockUnaligned(void* destination, void* source, uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
unaligned. 0x1
|
||||
cpblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void CopyBlockUnaligned(uint8& destination, uint8& source, uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
unaligned. 0x1
|
||||
cpblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void InitBlock(void* startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
initblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void InitBlock(uint8& startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
initblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void InitBlockUnaligned(void* startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
unaligned. 0x1
|
||||
initblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void InitBlockUnaligned(uint8& startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ldarg.2
|
||||
unaligned. 0x1
|
||||
initblk
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T As<class T>(object o) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& AsRef<T>(void* source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& AsRef<T>(!!T& source) cil managed aggressiveinlining
|
||||
{
|
||||
.param [1]
|
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!TTo& As<TFrom, TTo>(!!TFrom& source) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 1
|
||||
ldarg.0
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& Add<T>(!!T& source, int32 elementOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sizeof !!T
|
||||
conv.i
|
||||
mul
|
||||
add
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void* Add<T>(void* source, int32 elementOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sizeof !!T
|
||||
conv.i
|
||||
mul
|
||||
add
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& Add<T>(!!T& source, native int elementOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sizeof !!T
|
||||
mul
|
||||
add
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& AddByteOffset<T>(!!T& source, native int byteOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
add
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& Subtract<T>(!!T& source, int32 elementOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sizeof !!T
|
||||
conv.i
|
||||
mul
|
||||
sub
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static void* Subtract<T>(void* source, int32 elementOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sizeof !!T
|
||||
conv.i
|
||||
mul
|
||||
sub
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& Subtract<T>(!!T& source, native int elementOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 3
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sizeof !!T
|
||||
mul
|
||||
sub
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static !!T& SubtractByteOffset<T>(!!T& source, native int byteOffset) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
sub
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static native int ByteOffset<T>(!!T& origin, !!T& target) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.1
|
||||
ldarg.0
|
||||
sub
|
||||
ret
|
||||
}
|
||||
|
||||
.method public hidebysig static bool AreSame<T>(!!T& left, !!T& right) cil managed aggressiveinlining
|
||||
{
|
||||
|
||||
.maxstack 2
|
||||
ldarg.0
|
||||
ldarg.1
|
||||
ceq
|
||||
ret
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user