diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-12-01 00:44:11 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-12-01 00:56:17 +0300 |
commit | d8773a8b9848e595224c6593f5887961531cf52e (patch) | |
tree | 69ef32ec2f2f4ab855a070286e313ce229ebefd8 /src/Runtime.Base | |
parent | 2c55eedacd44a9b115a59480f359a27f588599bd (diff) |
Move TriggerGCForGCStress to GCStress class
Diffstat (limited to 'src/Runtime.Base')
5 files changed, 19 insertions, 17 deletions
diff --git a/src/Runtime.Base/src/System/Diagnostics/Debug.cs b/src/Runtime.Base/src/System/Diagnostics/Debug.cs index 2c0529f12..071fd12aa 100644 --- a/src/Runtime.Base/src/System/Diagnostics/Debug.cs +++ b/src/Runtime.Base/src/System/Diagnostics/Debug.cs @@ -17,15 +17,5 @@ namespace System.Diagnostics EH.FailFast(RhFailFastReason.InternalError, null); } } - - [System.Diagnostics.Conditional("DEBUG")] - [MethodImpl(MethodImplOptions.NoInlining)] - internal static void TriggerGCForGCStress() - { -#if FEATURE_GC_STRESS - if(GCStress.Initialized) - InternalCalls.RhCollect(-1, InternalGCCollectionMode.Blocking); -#endif - } } } diff --git a/src/Runtime.Base/src/System/Runtime/BinderIntrinsics.cs b/src/Runtime.Base/src/System/Runtime/BinderIntrinsics.cs index f4f7626a9..6b81d4cf3 100644 --- a/src/Runtime.Base/src/System/Runtime/BinderIntrinsics.cs +++ b/src/Runtime.Base/src/System/Runtime/BinderIntrinsics.cs @@ -8,14 +8,14 @@ namespace System.Runtime internal static class BinderIntrinsics { // NOTE: We rely on the RID of DebugBreak, so it must be kept as the first method declared in this class. - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization | MethodImplOptions.ForwardRef)] + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void DebugBreak() { // Ignore body of method, it will be generated by the binder. } // NOTE: We rely on the RID of GetReturnAddress, so it must be kept as the second method declared in this class. - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization | MethodImplOptions.ForwardRef)] + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static IntPtr GetReturnAddress() { // Ignore body of method, it will be generated by the binder. @@ -23,7 +23,7 @@ namespace System.Runtime } // NOTE: We rely on the RID of TailCall_RhpThrowEx, so it must be kept as the third method declared in this class. - [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization | MethodImplOptions.ForwardRef)] + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void TailCall_RhpThrowEx(Exception e) { // Ignore body of method, it will be generated by the binder. diff --git a/src/Runtime.Base/src/System/Runtime/CompilerServices/ICastable.cs b/src/Runtime.Base/src/System/Runtime/CompilerServices/ICastable.cs index 4a8161eeb..2798d2f13 100644 --- a/src/Runtime.Base/src/System/Runtime/CompilerServices/ICastable.cs +++ b/src/Runtime.Base/src/System/Runtime/CompilerServices/ICastable.cs @@ -55,6 +55,6 @@ namespace System.Runtime.CompilerServices // // The results of this lookup are cached so computation of the result is not as perf-sensitive as // IsInstanceOfInterface. - EETypePtr GetImplType(EEType interfaceType); + EETypePtr GetImplType(EETypePtr interfaceType); } } diff --git a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs index e9e170921..3862c9853 100644 --- a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs +++ b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs @@ -570,7 +570,7 @@ namespace System.Runtime public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo) { // trigger a GC (only if gcstress) to ensure we can stackwalk at this point - Debug.TriggerGCForGCStress(); + GCStress.TriggerGC(); InternalCalls.RhpValidateExInfoStack(); @@ -619,7 +619,7 @@ namespace System.Runtime public static void RhThrowEx(Exception exceptionObj, ref ExInfo exInfo) { // trigger a GC (only if gcstress) to ensure we can stackwalk at this point - Debug.TriggerGCForGCStress(); + GCStress.TriggerGC(); InternalCalls.RhpValidateExInfoStack(); @@ -639,7 +639,7 @@ namespace System.Runtime public static void RhRethrow(ref ExInfo activeExInfo, ref ExInfo exInfo) { // trigger a GC (only if gcstress) to ensure we can stackwalk at this point - Debug.TriggerGCForGCStress(); + GCStress.TriggerGC(); InternalCalls.RhpValidateExInfoStack(); diff --git a/src/Runtime.Base/src/System/Runtime/GCStress.cs b/src/Runtime.Base/src/System/Runtime/GCStress.cs index a65d4fb1d..ce59089e4 100644 --- a/src/Runtime.Base/src/System/Runtime/GCStress.cs +++ b/src/Runtime.Base/src/System/Runtime/GCStress.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System.Runtime.CompilerServices; + namespace System.Runtime { public /*internal*/ class GCStress @@ -34,6 +36,16 @@ namespace System.Runtime #endif // FEATURE_GC_STRESS } + [System.Diagnostics.Conditional("FEATURE_GC_STRESS")] + [MethodImpl(MethodImplOptions.NoInlining)] + internal static void TriggerGC() + { +#if FEATURE_GC_STRESS + if(GCStress.Initialized) + InternalCalls.RhCollect(-1, InternalGCCollectionMode.Blocking); +#endif + } + ~GCStress() { #if FEATURE_GC_STRESS |