Exposing Remaining CompilerServices Apis in mscorlib
authorRama Krishnan Raghupathy <ramarag@microsoft.com>
Wed, 14 Sep 2016 02:21:58 +0000 (19:21 -0700)
committerRama Krishnan Raghupathy <ramarag@microsoft.com>
Sat, 17 Sep 2016 01:09:03 +0000 (18:09 -0700)
src/mscorlib/model.xml
src/mscorlib/mscorlib.shared.sources.props
src/mscorlib/ref/mscorlib.cs
src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs

index ba7adbc..b3c4f8f 100644 (file)
       <Member Name="get_Value" />
       <Member MemberType="Property" Name="Value" />
     </Type>
+    <Type Name="System.Runtime.CompilerServices.DefaultDependencyAttribute">
+      <Member Name="#ctor(System.Runtime.CompilerServices.LoadHint)" />
+      <Member Name="get_LoadHint" />
+      <Member MemberType="Property" Name="LoadHint" />
+    </Type>
+    <Type Name="System.Runtime.CompilerServices.DependencyAttribute">
+      <Member Name="#ctor(System.String,System.Runtime.CompilerServices.LoadHint)" />
+      <Member Name="get_DependentAssembly" />
+      <Member Name="get_LoadHint" />
+      <Member MemberType="Property" Name="DependentAssembly" />
+      <Member MemberType="Property" Name="LoadHint" />
+    </Type>
+    <Type Name="System.Runtime.CompilerServices.DiscardableAttribute">
+      <Member Name="#ctor" />
+    </Type>
     <Type Name="System.Runtime.CompilerServices.DisablePrivateReflectionAttribute">
       <Member Name="#ctor" />
     </Type>
       <Member Name="ExecuteCodeWithGuaranteedCleanup(System.Runtime.CompilerServices.RuntimeHelpers+TryCode,System.Runtime.CompilerServices.RuntimeHelpers+CleanupCode,System.Object)" />
       <Member MemberType="Property" Name="OffsetToStringData" />
       <Member Status="ImplRoot" Name="ExecuteBackoutCodeHelper(System.Object,System.Object,System.Boolean)" />
-      <Member Status="ImplRoot" Name="PrepareConstrainedRegionsNoOP" />
-      <Member Status="ImplRoot" Name="PrepareConstrainedRegions" />
+      <Member Name="PrepareConstrainedRegions" />
+      <Member Name="PrepareConstrainedRegionsNoOP" />
+      <Member Name="PrepareContractedDelegate(System.Delegate)" />
+      <Member Name="PrepareDelegate(System.Delegate)" />
+      <Member Name="PrepareMethod(System.RuntimeMethodHandle)" />
+      <Member Name="PrepareMethod(System.RuntimeMethodHandle,System.RuntimeTypeHandle[])" />
+      <Member Name="ProbeForSufficientStack" />
     </Type>
     <Type Name="System.Runtime.CompilerServices.RuntimeHelpers+CleanupCode">
       <Member Name="#ctor(System.Object,System.IntPtr)" />
     <Type Name="System.Runtime.CompilerServices.CompilerGeneratedAttribute">
       <Member Name="#ctor" />
     </Type>
+    <Type Name="System.Runtime.CompilerServices.CompilerGlobalScopeAttribute">
+      <Member Name="#ctor" />
+    </Type>
 <!-- SMOSIER ADDED API ROOTS FOR our build process -->
     <Type Name="System.Runtime.InteropServices.ComVisibleAttribute">
       <Member Name="#ctor(System.Boolean)" />
       <Member Name="ResolveToken(System.Int32,System.IntPtr@,System.IntPtr@,System.IntPtr@)" /> <!-- EE -->
       <Member Name="ResolveSignature(System.Int32,System.Int32)" /> <!-- EE -->
     </Type>
-    <Type Status="ImplRoot" Name="System.Runtime.CompilerServices.RuntimeWrappedException">
+    <Type Name="System.Runtime.CompilerServices.RuntimeWrappedException">
       <Member Name="#ctor(System.Object)" /> <!-- EE -->
+      <Member Name="get_WrappedException" />
+      <Member Name="GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
+      <Member MemberType="Property" Name="WrappedException" />
+    </Type>
+    <Type Name="System.Runtime.CompilerServices.StringFreezingAttribute">
+      <Member Name="#ctor" />
     </Type>
     <Type Status="ImplRoot" Name="System.Runtime.CompilerServices.TypeDependencyAttribute">
       <Member Name="#ctor(System.String)" />
       <Member Name="op_Equality(System.Runtime.InteropServices.ArrayWithOffset,System.Runtime.InteropServices.ArrayWithOffset)" />
       <Member Name="op_Inequality(System.Runtime.InteropServices.ArrayWithOffset,System.Runtime.InteropServices.ArrayWithOffset)" />
     </Type>
-    <Type Status="ImplRoot" Name="System.Runtime.ConstrainedExecution.ReliabilityContractAttribute" />
+     <Type Name="System.Runtime.ConstrainedExecution.ReliabilityContractAttribute">
+      <Member Name="#ctor(System.Runtime.ConstrainedExecution.Consistency,System.Runtime.ConstrainedExecution.Cer)" />
+      <Member Name="get_Cer" />
+      <Member Name="get_ConsistencyGuarantee" />
+      <Member MemberType="Property" Name="Cer" />
+      <Member MemberType="Property" Name="ConsistencyGuarantee" />
+    </Type>
     <Type Status="ImplRoot" Name="System.Runtime.ConstrainedExecution.PrePrepareMethodAttribute" />
     <Type Name="System.Runtime.ConstrainedExecution.CriticalFinalizerObject">
       <Member Name="#ctor"/>
index fc5153f..2bb6b91 100644 (file)
@@ -25,7 +25,7 @@
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AssemblySettingAttributes.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeDependencyAttribute.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerMarshalOverride.cs" />
-    <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\HasCopySemanticsAttribute.cs" />
+    <CompilerServicesSources Condition="'$(FeatureCoreClr)'!='true'"  Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\HasCopySemanticsAttribute.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsBoxed.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsByValue.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsConst.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsImplicitlyDereferenced.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsJitIntrinsic.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsLong.cs" />
-    <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsPinned.cs" />
+    <CompilerServicesSources Condition="'$(FeatureCoreClr)'!='true'"  Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsPinned.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsSignUnspecifiedByte.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsUdtReturn.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\jithelpers.cs" />
-    <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ScopelessEnumAttribute.cs" />
+    <CompilerServicesSources Condition="'$(FeatureCoreClr)'!='true'"  Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ScopelessEnumAttribute.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SpecialNameAttribute.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SuppressMergeCheckAttribute.cs" />
     <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsCopyConstructed.cs" />
index cb83c6c..6de555e 100644 (file)
@@ -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
 {
index 59585e5..507593b 100644 (file)
@@ -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.