From: Rama Krishnan Raghupathy Date: Wed, 14 Sep 2016 02:21:58 +0000 (-0700) Subject: Exposing Remaining CompilerServices Apis in mscorlib X-Git-Tag: accepted/tizen/base/20180629.140029~3544^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=561ce4a5324c5f388bcc7ed32ad8418ec3e5453b;p=platform%2Fupstream%2Fcoreclr.git Exposing Remaining CompilerServices Apis in mscorlib --- diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml index ba7adbc..b3c4f8f 100644 --- a/src/mscorlib/model.xml +++ b/src/mscorlib/model.xml @@ -6213,6 +6213,21 @@ + + + + + + + + + + + + + + + @@ -6329,8 +6344,13 @@ - - + + + + + + + @@ -8835,6 +8855,9 @@ + + + @@ -9871,8 +9894,14 @@ - + + + + + + + @@ -9887,7 +9916,13 @@ - + + + + + + + diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props index fc5153f..2bb6b91 100644 --- a/src/mscorlib/mscorlib.shared.sources.props +++ b/src/mscorlib/mscorlib.shared.sources.props @@ -25,7 +25,7 @@ - + @@ -33,11 +33,11 @@ - + - + diff --git a/src/mscorlib/ref/mscorlib.cs b/src/mscorlib/ref/mscorlib.cs index cb83c6c..6de555e 100644 --- a/src/mscorlib/ref/mscorlib.cs +++ b/src/mscorlib/ref/mscorlib.cs @@ -9821,6 +9821,12 @@ namespace System.Runtime.CompilerServices { public CompilerGeneratedAttribute() { } } + [System.AttributeUsageAttribute((System.AttributeTargets)(4))] + [System.Runtime.InteropServices.ComVisibleAttribute(true)] + public partial class CompilerGlobalScopeAttribute : System.Attribute + { + public CompilerGlobalScopeAttribute() { } + } public static partial class CompilerMarshalOverride { } @@ -9902,11 +9908,29 @@ namespace System.Runtime.CompilerServices public DecimalConstantAttribute(byte scale, byte sign, uint hi, uint mid, uint low) { } public decimal Value { get { throw null; } } } + [System.AttributeUsageAttribute((System.AttributeTargets)(1))] + public sealed partial class DefaultDependencyAttribute : System.Attribute + { + public DefaultDependencyAttribute(System.Runtime.CompilerServices.LoadHint loadHintArgument) { } + public System.Runtime.CompilerServices.LoadHint LoadHint { get { return default(System.Runtime.CompilerServices.LoadHint); } } + } + [System.AttributeUsageAttribute((System.AttributeTargets)(1), AllowMultiple=true)] + public sealed partial class DependencyAttribute : System.Attribute + { + public DependencyAttribute(string dependentAssemblyArgument, System.Runtime.CompilerServices.LoadHint loadHintArgument) { } + public string DependentAssembly { get { return default(string); } } + public System.Runtime.CompilerServices.LoadHint LoadHint { get { return default(System.Runtime.CompilerServices.LoadHint); } } + } [System.AttributeUsageAttribute((System.AttributeTargets)(1), AllowMultiple=false, Inherited=false)] public sealed partial class DisablePrivateReflectionAttribute : System.Attribute { public DisablePrivateReflectionAttribute() { } } + [System.Runtime.InteropServices.ComVisibleAttribute(true)] + public partial class DiscardableAttribute : System.Attribute + { + public DiscardableAttribute() { } + } [System.AttributeUsageAttribute((System.AttributeTargets)(69))] public sealed partial class ExtensionAttribute : System.Attribute { @@ -10000,6 +10024,11 @@ namespace System.Runtime.CompilerServices { public IteratorStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { } } + public enum LoadHint { + Always = 1, + Default = 0, + Sometimes = 2, + } [System.Runtime.InteropServices.ComVisibleAttribute(true)] public enum MethodCodeType { @@ -10078,12 +10107,41 @@ namespace System.Runtime.CompilerServices public delegate void CleanupCode(object userData, bool exceptionThrown); [System.Security.SecurityCriticalAttribute] public delegate void TryCode(object userData); + [System.Runtime.ConstrainedExecution.ReliabilityContractAttribute((System.Runtime.ConstrainedExecution.Consistency)(3), (System.Runtime.ConstrainedExecution.Cer)(1))] + [System.Security.SecurityCriticalAttribute] + public static void PrepareConstrainedRegions() { } + [System.Runtime.ConstrainedExecution.ReliabilityContractAttribute((System.Runtime.ConstrainedExecution.Consistency)(3), (System.Runtime.ConstrainedExecution.Cer)(1))] + [System.Security.SecurityCriticalAttribute] + public static void PrepareConstrainedRegionsNoOP() { } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)][System.Security.SecurityCriticalAttribute] + public static void PrepareContractedDelegate(System.Delegate d) { } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)][System.Security.SecurityCriticalAttribute] + public static void PrepareDelegate(System.Delegate d) { } + [System.Security.SecurityCriticalAttribute] + public static void PrepareMethod(System.RuntimeMethodHandle method) { } + [System.Security.SecurityCriticalAttribute] + public static void PrepareMethod(System.RuntimeMethodHandle method, System.RuntimeTypeHandle[] instantiation) { } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)][System.Runtime.ConstrainedExecution.ReliabilityContractAttribute((System.Runtime.ConstrainedExecution.Consistency)(3), (System.Runtime.ConstrainedExecution.Cer)(1))] + [System.Security.SecurityCriticalAttribute] + public static void ProbeForSufficientStack() { } + } + public sealed partial class RuntimeWrappedException : System.Exception + { + internal RuntimeWrappedException() { } + public object WrappedException { get { return default(object); } } + [System.Security.SecurityCriticalAttribute] + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } [System.AttributeUsageAttribute((System.AttributeTargets)(972))] public sealed partial class SpecialNameAttribute : System.Attribute { public SpecialNameAttribute() { } } + [System.AttributeUsageAttribute((System.AttributeTargets)(1), Inherited=false)] + public sealed partial class StringFreezingAttribute : System.Attribute + { + public StringFreezingAttribute() { } + } [System.AttributeUsageAttribute((System.AttributeTargets)(64), Inherited=false, AllowMultiple=false)] public partial class StateMachineAttribute : System.Attribute { @@ -10157,6 +10215,27 @@ namespace System.Runtime.ConstrainedExecution protected CriticalFinalizerObject() { } ~CriticalFinalizerObject() { } } + + public enum Cer + { + MayFail = 1, + None = 0, + Success = 2, + } + public enum Consistency + { + MayCorruptAppDomain = 1, + MayCorruptInstance = 2, + MayCorruptProcess = 0, + WillNotCorruptState = 3, + } + [System.AttributeUsageAttribute((System.AttributeTargets)(1133), Inherited=false)] + internal sealed partial class ReliabilityContractAttribute : System.Attribute + { + public ReliabilityContractAttribute(System.Runtime.ConstrainedExecution.Consistency consistencyGuarantee, System.Runtime.ConstrainedExecution.Cer cer) { } + public System.Runtime.ConstrainedExecution.Cer Cer { get { return default(System.Runtime.ConstrainedExecution.Cer); } } + public System.Runtime.ConstrainedExecution.Consistency ConsistencyGuarantee { get { return default(System.Runtime.ConstrainedExecution.Consistency); } } + } } namespace System.Runtime.ExceptionServices { diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs index 59585e5..507593b 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -89,14 +89,31 @@ namespace System.Runtime.CompilerServices { _RunModuleConstructor(module.GetRuntimeModule()); } - [System.Security.SecurityCritical] // auto-generated - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static unsafe extern void _PrepareMethod(IRuntimeMethodInfo method, IntPtr* pInstantiation, int cInstantiation); [System.Security.SecurityCritical] // auto-generated [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern void _CompileMethod(IRuntimeMethodInfo method); + + #if FEATURE_CORECLR + public static void PrepareMethod(RuntimeMethodHandle method){} + public static void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation){} + public static void PrepareContractedDelegate(Delegate d){} + + public static void PrepareDelegate(Delegate d) + { + if (d == null) + { + throw new ArgumentNullException ("d"); + } + } + + #else + + [System.Security.SecurityCritical] // auto-generated + [MethodImplAttribute(MethodImplOptions.InternalCall)] + private static unsafe extern void _PrepareMethod(IRuntimeMethodInfo method, IntPtr* pInstantiation, int cInstantiation); + // Simple (instantiation not required) method. [System.Security.SecurityCritical] // auto-generated_required public static void PrepareMethod(RuntimeMethodHandle method) @@ -122,7 +139,6 @@ namespace System.Runtime.CompilerServices { } } } - // This method triggers a given delegate to be prepared. This involves preparing the // delegate's Invoke method and preparing the target of that Invoke. In the case of // a multi-cast delegate, we rely on the fact that each individual component was prepared @@ -149,7 +165,7 @@ namespace System.Runtime.CompilerServices { [System.Security.SecurityCritical] // auto-generated_required [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void PrepareContractedDelegate(Delegate d); - + #endif [System.Security.SecuritySafeCritical] // auto-generated [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern int GetHashCode(Object o); @@ -197,10 +213,16 @@ namespace System.Runtime.CompilerServices { [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public static extern bool TryEnsureSufficientExecutionStack(); + #if FEATURE_CORECLR + public static void ProbeForSufficientStack() + { + } + #else [System.Security.SecurityCritical] // auto-generated_required [MethodImplAttribute(MethodImplOptions.InternalCall)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] public static extern void ProbeForSufficientStack(); + #endif // This method is a marker placed immediately before a try clause to mark the corresponding catch and finally blocks as // constrained. There's no code here other than the probe because most of the work is done at JIT time when we spot a call to this routine.