ILRuntimeJITAttribute.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ILRuntime.Runtime
  6. {
  7. public static class ILRuntimeJITFlags
  8. {
  9. public const int None = 0;
  10. /// <summary>
  11. /// Method will be JIT when method is called multiple time
  12. /// </summary>
  13. public const int JITOnDemand = 1;
  14. /// <summary>
  15. /// Method will be JIT immediately when called, instead of progressively warm up
  16. /// </summary>
  17. public const int JITImmediately = 2;
  18. /// <summary>
  19. /// Method will not be JIT when called
  20. /// </summary>
  21. public const int NoJIT = 4;
  22. /// <summary>
  23. /// Method will always be inlined when called
  24. /// </summary>
  25. public const int ForceInline = 8;
  26. }
  27. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
  28. public class ILRuntimeJITAttribute : Attribute
  29. {
  30. int flags;
  31. public int Flags { get { return flags; } }
  32. public ILRuntimeJITAttribute()
  33. {
  34. this.flags = ILRuntimeJITFlags.JITOnDemand;
  35. }
  36. public ILRuntimeJITAttribute(int flags)
  37. {
  38. this.flags = flags;
  39. }
  40. }
  41. }