ILRuntimeJITAttribute.cs 1.3 KB

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