Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@@ -408,7 +408,7 @@ namespace System.Runtime.CompilerServices
/// It must only be used by the debugger and tracing pruposes, and only in a single-threaded manner
/// when no other threads are in the middle of accessing this property or this.Task.
/// </remarks>
private object ObjectIdForDebugger { get { return this.Task; } }
internal object ObjectIdForDebugger { get { return this.Task; } }
}
/// <summary>
@@ -850,7 +850,6 @@ namespace System.Runtime.CompilerServices
// This method is copy&pasted into the public Start methods to avoid size overhead of valuetype generic instantiations.
// Ideally, we would build intrinsics to get the raw ref address and raw code address of MoveNext, and just use the shared implementation.
#if false
/// <summary>Initiates the builder's execution with the associated state machine.</summary>
/// <typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam>
/// <param name="stateMachine">The state machine instance, passed by reference.</param>
@@ -880,7 +879,6 @@ namespace System.Runtime.CompilerServices
ecs.Undo();
}
}
#endif
/// <summary>Associates the builder with the state machine it represents.</summary>
/// <param name="stateMachine">The heap-allocated state machine object.</param>

View File

@@ -17,7 +17,7 @@
**
=============================================================================*/
#if FEATURE_EXCEPTIONDISPATCHINFO
#if FEATURE_EXCEPTIONDISPATCHINFO || MONO
namespace System.Runtime.ExceptionServices {
using System;
@@ -150,8 +150,10 @@ namespace System.Runtime.ExceptionServices {
#endif
public void Throw()
{
#if FEATURE_EXCEPTIONDISPATCHINFO
// Restore the exception dispatch details before throwing the exception.
m_Exception.RestoreExceptionDispatchInfo(this);
#endif
throw m_Exception;
}

View File

@@ -391,7 +391,8 @@ namespace System.Runtime.InteropServices{
}
public TypeLibVarFlags Value { get {return _val;} }
}
#endif
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum VarEnum
@@ -799,7 +800,7 @@ namespace System.Runtime.InteropServices{
PInvokeAttributes flags = 0;
#if MONO
((MonoMethod)method).GetPInvoke(out flags, out entryPoint, out dllName);
((RuntimeMethodInfo)method).GetPInvoke(out flags, out entryPoint, out dllName);
#else
scope.GetPInvokeMap(token, out flags, out entryPoint, out dllName);
#endif
@@ -882,6 +883,7 @@ namespace System.Runtime.InteropServices{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)]
[System.Runtime.InteropServices.ComVisible(true)]
public unsafe sealed class StructLayoutAttribute : Attribute
@@ -1066,8 +1068,7 @@ namespace System.Runtime.InteropServices{
public Type SourceInterface { get {return _SourceInterface;} }
public Type EventProvider { get {return _EventProvider;} }
}
#endif
#if FEATURE_COMINTEROP || MOBILE_LEGACY
[AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class TypeLibVersionAttribute : Attribute
@@ -1164,5 +1165,4 @@ namespace System.Runtime.InteropServices{
public String MethodName { get { return _methodName; } }
}
#endif
#endif
}

View File

@@ -50,7 +50,9 @@
using System;
using System.Reflection;
using System.Threading;
#if !MONO
using System.Security.Permissions;
#endif
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Runtime.ConstrainedExecution;
@@ -142,7 +144,7 @@ namespace System.Runtime.InteropServices
// methods have a link demand to ensure untrusted code cannot directly edit
// or alter a handle.
[System.Security.SecurityCritical] // auto-generated_required
#if !FEATURE_CORECLR
#if !FEATURE_CORECLR && !MONO
[SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode=true)]
#endif
public abstract class CriticalHandle : CriticalFinalizerObject, IDisposable

View File

@@ -21,7 +21,9 @@ namespace System.Runtime.InteropServices {
using System;
using System.Reflection;
using System.Threading;
#if !MONO
using System.Security.Permissions;
#endif
using System.Runtime;
using System.Runtime.CompilerServices;
using System.IO;
@@ -137,7 +139,7 @@ using System.Runtime.Versioning;
// methods have a link demand to ensure untrusted code cannot directly edit
// or alter a handle.
[System.Security.SecurityCritical] // auto-generated_required
#if !FEATURE_CORECLR
#if !FEATURE_CORECLR && !MONO
[SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode=true)]
#endif
public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable
@@ -224,7 +226,9 @@ public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable
// untrusted caller can query data on the handle you've just returned
// and get back information for an entirely unrelated resource).
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
#if !MONO
[ResourceExposure(ResourceScope.None)]
#endif
public IntPtr DangerousGetHandle()
{
return handle;

View File

@@ -12,6 +12,7 @@
**
**
=============================================================================*/
#if FEATURE_COMINTEROP || MOBILE_LEGACY
namespace System.Runtime.InteropServices
{
@@ -332,3 +333,5 @@ namespace System.Runtime.InteropServices
}
#endif
}
#endif

View File

@@ -148,6 +148,13 @@ namespace System.Runtime.Serialization {
RuntimeType objectType = (RuntimeType)typeof(object);
for (RuntimeType t1 = parentType; t1 != objectType; t1 = (RuntimeType)t1.BaseType)
{
#if MONO
// This should never happen
if (t1 == null) {
throw new InvalidOperationException($"Type '{parentType}' of type '{parentType?.GetType()}' does not derive from System.Object");
}
#endif
if (t1.IsInterface) continue;
string t1Name = t1.Name;
for(int i=0;unique && i<parentTypeCount;i++){