Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NgenServicingAttributes.cs « runtime « system « mscorlib « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a71ff9b3e27ed3cd13d21fda6da14d5ed5c56e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;

namespace System.Runtime
{
    [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
    public sealed class AssemblyTargetedPatchBandAttribute : Attribute
    {
        private String m_targetedPatchBand;

        public AssemblyTargetedPatchBandAttribute(String targetedPatchBand)
        {
            m_targetedPatchBand = targetedPatchBand;
        }

        public String TargetedPatchBand
        {
            get { return m_targetedPatchBand; }
        }
    }

// This attribute seems particularly prone to accidental inclusion in bcl.small
// We would only want to do so intentionally (if targeted patching were enabled there)
#if !FEATURE_CORECLR

    //============================================================================================================
    // [TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] - 
    // Sacrifices cheap servicing of a method body in order to allow unrestricted inlining.  Certain types of
    // trivial methods (e.g. simple property getters) are automatically attributed by ILCA.EXE during the build.
    // For other performance critical methods, it should be added manually.
    //============================================================================================================

    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
    public sealed class TargetedPatchingOptOutAttribute : Attribute
    {
        private String m_reason;

        public TargetedPatchingOptOutAttribute(String reason) 
        { 
            m_reason = reason;
        }

        public String Reason
        {
            get { return m_reason; }
        }

        private TargetedPatchingOptOutAttribute() { }
    }

#endif

    //============================================================================================================
    // [ForceTokenStabilization] - Using this CA forces ILCA.EXE to stabilize the attached type, method or field.
    // We use this to identify private helper methods invoked by IL stubs.
    //
    // NOTE: Attaching this to a type is NOT equivalent to attaching it to all of its methods!
    //============================================================================================================
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Delegate |
                    AttributeTargets.Method | AttributeTargets.Constructor |
                    AttributeTargets.Field
                   , AllowMultiple = false, Inherited = false)]
    sealed class ForceTokenStabilizationAttribute : Attribute
    {
        public ForceTokenStabilizationAttribute() { }
    }
}