Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -10,7 +10,11 @@ internal static partial class Interop
{
internal unsafe partial class Sys
{
#if !MONO
[DllImport(Interop.Libraries.CoreLibNative, EntryPoint = "CoreLibNative_DoubleToString")]
#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
#endif
internal static extern unsafe int DoubleToString(double value, byte* format, byte* buffer, int bufferLength);
}
}

View File

@@ -37,7 +37,10 @@ namespace System
return true;
}
private static bool EqualsOrdinalIgnoreCase(this ReadOnlySpan<char> left, ReadOnlySpan<char> right)
#if MONO
internal
#endif
static bool EqualsOrdinalIgnoreCase(this ReadOnlySpan<char> left, ReadOnlySpan<char> right)
{
if (left.Length != right.Length)
{

View File

@@ -910,22 +910,14 @@ namespace System
if (array.Length - index < length)
throw new ArgumentException(SR.Argument_InvalidOffLen);
#if !MONO
ref T p = ref Unsafe.As<byte, T>(ref array.GetRawSzArrayData());
#endif
int i = index;
int j = index + length - 1;
while (i < j)
{
#if MONO
T temp = array[i];
array[i] = array[j];
array[j] = temp;
#else
T temp = Unsafe.Add(ref p, i);
Unsafe.Add(ref p, i) = Unsafe.Add(ref p, j);
Unsafe.Add(ref p, j) = temp;
#endif
i++;
j--;
}

View File

@@ -1 +1 @@
05afe6b7e296d261b03eff87b6fb61e1db537d32
c14603d45ef7ad7f0c541d64df6fd49fc47b9879

View File

@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -54,7 +55,9 @@ namespace System
// the range of the Decimal type.
[Serializable]
[StructLayout(LayoutKind.Explicit)]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public partial struct Decimal : IFormattable, IComparable, IConvertible, IComparable<Decimal>, IEquatable<Decimal>, IDeserializationCallback, ISpanFormattable
{
// Sign mask for the flags field. A value of zero in this bit indicates a

View File

@@ -22,7 +22,9 @@ using System.Runtime.Serialization;
namespace System
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public sealed class InsufficientMemoryException : OutOfMemoryException
{
// There may be a problem here interacting with the ResourceManager in out of memory conditions,

View File

@@ -14,7 +14,9 @@ using System.Runtime.Serialization;
namespace System
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class MissingFieldException : MissingMemberException
{
public MissingFieldException()

View File

@@ -16,7 +16,9 @@ using System.Runtime.Serialization;
namespace System
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class MissingMemberException : MemberAccessException
{
public MissingMemberException()

View File

@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime;
using System.Globalization;

View File

@@ -16,7 +16,9 @@ using System.Runtime.Serialization;
namespace System
{
[Serializable]
#if !MONO
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
public class OutOfMemoryException : SystemException
{
public OutOfMemoryException()

View File

@@ -82,6 +82,7 @@ namespace System
// declared constructors.
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char[])")]
public extern String(char[] value);
[System.Runtime.CompilerServices.DependencyReductionRoot]
@@ -105,6 +106,7 @@ namespace System
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char[], System.Int32, System.Int32)")]
public extern String(char[] value, int startIndex, int length);
[System.Runtime.CompilerServices.DependencyReductionRoot]
@@ -141,6 +143,7 @@ namespace System
[CLSCompliant(false)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char*)")]
unsafe public extern String(char* value);
[System.Runtime.CompilerServices.DependencyReductionRoot]
@@ -173,6 +176,7 @@ namespace System
[CLSCompliant(false)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char*, System.Int32, System.Int32)")]
unsafe public extern String(char* value, int startIndex, int length);
[System.Runtime.CompilerServices.DependencyReductionRoot]
@@ -214,6 +218,7 @@ namespace System
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.SByte*)")]
public extern unsafe String(sbyte* value);
[DependencyReductionRoot]
@@ -232,6 +237,7 @@ namespace System
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.SByte*, System.Int32, System.Int32)")]
public extern unsafe String(sbyte* value, int startIndex, int length);
[DependencyReductionRoot]
@@ -284,6 +290,7 @@ namespace System
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.SByte*, System.Int32, System.Int32, System.Text.Encoding)")]
public extern unsafe String(sbyte* value, int startIndex, int length, Encoding enc);
[DependencyReductionRoot]
@@ -329,6 +336,7 @@ namespace System
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.Char, System.Int32)")]
public extern String(char c, int count);
[System.Runtime.CompilerServices.DependencyReductionRoot]
@@ -376,6 +384,7 @@ namespace System
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[PreserveDependency("System.String.CreateString(System.ReadOnlySpan`1<System.Char>)")]
public extern String(ReadOnlySpan<char> value);
[DependencyReductionRoot]
@@ -394,7 +403,6 @@ namespace System
return result;
}
#if !MONO // TODO: Undo
public static string Create<TState>(int length, TState state, SpanAction<char, TState> action)
{
if (action == null)
@@ -419,7 +427,6 @@ namespace System
public static implicit operator ReadOnlySpan<char>(string value) =>
value != null ? new ReadOnlySpan<char>(ref value.GetRawStringData(), value.Length) : default;
#endif
public object Clone()
{
@@ -818,3 +825,13 @@ namespace System
}
}
}
#if MONO
namespace System.Buffers
{
public delegate void SpanAction<T, in TArg>(Span<T> span, TArg arg);
public delegate void ReadOnlySpanAction<T, in TArg>(ReadOnlySpan<T> span, TArg arg);
}
#endif

View File

@@ -10,6 +10,7 @@
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

View File

@@ -9,6 +9,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime.InteropServices;
namespace System.Threading

View File

@@ -17,6 +17,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Diagnostics.CodeAnalysis;
namespace System.Threading.Tasks
@@ -712,7 +713,9 @@ namespace System.Threading.Tasks
private static void ContractAssertMonitorStatus(Lock syncObj, bool held)
{
Debug.Assert(syncObj != null, "The Lock object to check must be provided.");
#if !MONO
Debug.Assert(syncObj.IsAcquired == held, "The locking scheme was not correctly followed.");
#endif
}
/// <summary>Gets the options to use for tasks.</summary>

View File

@@ -26,6 +26,7 @@ using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime.InteropServices;
namespace System.Threading.Tasks
@@ -64,7 +65,13 @@ namespace System.Threading.Tasks
/// </summary>
/// <typeparam name="T">Specifies the type of data contained in the queue.</typeparam>
[DebuggerDisplay("Count = {Count}")]
internal sealed class MultiProducerMultiConsumerQueue<T> : LowLevelConcurrentQueue<T>, IProducerConsumerQueue<T>
internal sealed class MultiProducerMultiConsumerQueue<T> :
#if MONO
ConcurrentQueue<T>,
#else
LowLevelConcurrentQueue<T>,
#endif
IProducerConsumerQueue<T>
{
/// <summary>Enqueues an item into the queue.</summary>
/// <param name="item">The item to enqueue.</param>

View File

@@ -18,6 +18,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Runtime.ExceptionServices;
namespace System.Threading.Tasks

View File

@@ -17,6 +17,7 @@
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System.Diagnostics;
using System.Diagnostics.Private;
using System.Collections.Generic;
namespace System.Threading

View File

@@ -10,7 +10,7 @@ namespace System.Threading
/// Simple wrapper around Monitor.Enter and Exit exposing interface as expected by
/// System.Private.InteropServices.__ComObject
/// </summary>
public class Lock
public partial class Lock
{
private object _lock = new object();
public void Acquire()