Make TryEnsureSufficientExecutionStack public (#7077)
authorBart J.F. De Smet <bartdesmet@hotmail.com>
Thu, 8 Sep 2016 01:37:45 +0000 (18:37 -0700)
committerJan Kotas <jkotas@microsoft.com>
Thu, 8 Sep 2016 01:37:45 +0000 (18:37 -0700)
src/mscorlib/model.xml
src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs
src/vm/ecalllist.h
src/vm/reflectioninvocation.cpp
src/vm/reflectioninvocation.h

index ac6b95c1acc93a7d54188ceb6b2a7ffad3d1c0b4..cd4a3fe3a5e25eff5198d6547ed9bbf989e5fa44 100644 (file)
     <Type Name="System.Runtime.CompilerServices.RuntimeHelpers">
       <Member Name="GetUninitializedObject(System.Type)" />
       <Member Name="EnsureSufficientExecutionStack" />
+      <Member Name="TryEnsureSufficientExecutionStack" />
       <Member Name="get_OffsetToStringData" />
       <Member Name="GetObjectValue(System.Object)" />
       <Member Name="InitializeArray(System.Array,System.RuntimeFieldHandle)" />
index d20fe0bffdc0ccc6f3b7dcf831ddebbd6918017a..59585e5e4d41316d0c99e294c0ab82c38d4a6187 100644 (file)
@@ -188,7 +188,6 @@ namespace System.Runtime.CompilerServices {
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
         public static extern void EnsureSufficientExecutionStack();
 
-#if FEATURE_CORECLR
         // This method ensures that there is sufficient stack to execute the average Framework function.
         // If there is not enough stack, then it return false.
         // Note: this method is not part of the CER support, and is not to be confused with ProbeForSufficientStack
@@ -196,8 +195,7 @@ namespace System.Runtime.CompilerServices {
         [System.Security.SecuritySafeCritical]
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-        internal static extern bool TryEnsureSufficientExecutionStack();
-#endif
+        public static extern bool TryEnsureSufficientExecutionStack();
 
         [System.Security.SecurityCritical]  // auto-generated_required
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
index 8d4164e0187a78b53c9b3c5ea5b6fd476f32efb2..19f8abd8f3c69008b328bbeacc3d0a8537ab981e 100644 (file)
@@ -1843,9 +1843,7 @@ FCFuncStart(gCompilerFuncs)
     FCFuncElement("GetHashCode", ObjectNative::GetHashCode)
     FCFuncElement("Equals", ObjectNative::Equals)
     FCFuncElement("EnsureSufficientExecutionStack", ReflectionInvocation::EnsureSufficientExecutionStack)
-#ifdef FEATURE_CORECLR
     FCFuncElement("TryEnsureSufficientExecutionStack", ReflectionInvocation::TryEnsureSufficientExecutionStack)
-#endif // FEATURE_CORECLR
 FCFuncEnd()
 
 FCFuncStart(gContextSynchronizationFuncs)
index de5051468248a8dc0bbf40cde26aa450d5031f57..9847c0575ab562074e1ad24935893daaf643750e 100644 (file)
@@ -2637,7 +2637,6 @@ FCIMPL0(void, ReflectionInvocation::EnsureSufficientExecutionStack)
 }
 FCIMPLEND
 
-#ifdef FEATURE_CORECLR
 // As with EnsureSufficientExecutionStack, this method checks and returns whether there is 
 // sufficient stack to execute the average Framework method, but rather than throwing,
 // it simply returns a Boolean: true for sufficient stack space, otherwise false.
@@ -2654,7 +2653,6 @@ FCIMPL0(FC_BOOL_RET, ReflectionInvocation::TryEnsureSufficientExecutionStack)
        FC_RETURN_BOOL(current >= limit);
 }
 FCIMPLEND
-#endif // FEATURE_CORECLR
 
 struct ECWGCFContext
 {
index fd14532091399152bbdd601bee1c40a5bd73c413..7f72b61cd81102acdee8c77ece7aa54d2ed444f7 100644 (file)
@@ -56,10 +56,8 @@ public:
 #endif // !FEATURE_CORECLR
     static FCDECL1(void, PrepareContractedDelegate, Object* delegateUNSAFE);
     static FCDECL0(void, ProbeForSufficientStack);    
-       static FCDECL0(void, EnsureSufficientExecutionStack);
-#ifdef FEATURE_CORECLR // currently only used from mscorlib in FEATURE_CORECLR
-       static FCDECL0(FC_BOOL_RET, TryEnsureSufficientExecutionStack);
-#endif // FEATURE_CORECLR
+    static FCDECL0(void, EnsureSufficientExecutionStack);
+    static FCDECL0(FC_BOOL_RET, TryEnsureSufficientExecutionStack);
     static FCDECL3(void, ExecuteCodeWithGuaranteedCleanup, Object* pCodeDelegateUNSAFE, Object* pBackoutDelegateUNSAFE, Object* pUserDataUNSAFE);
 
     // TypedReference functions, should go somewhere else