JITTimeProfileInfo.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. class JITTimeProfileInfo
  7. {
  8. public:
  9. JITTimeProfileInfo(ProfileDataIDL * profileData);
  10. static void InitializeJITProfileData(
  11. __in ArenaAllocator * alloc,
  12. __in Js::DynamicProfileInfo * profileInfo,
  13. __in Js::FunctionBody *functionBody,
  14. __out ProfileDataIDL * data,
  15. bool isForegroundJIT);
  16. const Js::LdElemInfo * GetLdElemInfo(Js::ProfileId ldElemId) const;
  17. const Js::StElemInfo * GetStElemInfo(Js::ProfileId stElemId) const;
  18. Js::ArrayCallSiteInfo * GetArrayCallSiteInfo(Js::ProfileId index) const;
  19. intptr_t GetArrayCallSiteInfoAddr(Js::ProfileId index) const;
  20. Js::FldInfo * GetFldInfo(uint fieldAccessId) const;
  21. intptr_t GetFldInfoAddr(uint fieldAccessId) const;
  22. Js::ThisInfo GetThisInfo() const;
  23. ValueType GetSlotLoad(Js::ProfileId slotLoadId) const;
  24. ValueType GetReturnType(Js::OpCode opcode, Js::ProfileId callSiteId) const;
  25. ValueType GetDivProfileInfo(Js::ProfileId divideId) const;
  26. ValueType GetSwitchProfileInfo(Js::ProfileId switchId) const;
  27. ValueType GetParameterInfo(Js::ArgSlot index) const;
  28. Js::ImplicitCallFlags GetLoopImplicitCallFlags(uint loopNum) const;
  29. Js::ImplicitCallFlags GetImplicitCallFlags() const;
  30. Js::LoopFlags GetLoopFlags(uint loopNum) const;
  31. uint16 GetConstantArgInfo(Js::ProfileId callSiteId) const;
  32. void DisableAggressiveIntTypeSpec(bool isLoopBody);
  33. void DisableStackArgOpt();
  34. void DisableSwitchOpt();
  35. void DisableTrackCompoundedIntOverflow();
  36. void DisableArrayCheckHoist(bool isLoopBody);
  37. bool IsModulusOpByPowerOf2(Js::ProfileId profileId) const;
  38. bool IsAggressiveIntTypeSpecDisabled(const bool isJitLoopBody) const;
  39. bool IsSwitchOptDisabled() const;
  40. bool IsEquivalentObjTypeSpecDisabled() const;
  41. bool IsObjTypeSpecDisabledInJitLoopBody() const;
  42. bool IsAggressiveMulIntTypeSpecDisabled(const bool isJitLoopBody) const;
  43. bool IsDivIntTypeSpecDisabled(const bool isJitLoopBody) const;
  44. bool IsLossyIntTypeSpecDisabled() const;
  45. bool IsMemOpDisabled() const;
  46. bool IsTrackCompoundedIntOverflowDisabled() const;
  47. bool IsFloatTypeSpecDisabled() const;
  48. bool IsCheckThisDisabled() const;
  49. bool IsArrayCheckHoistDisabled(const bool isJitLoopBody) const;
  50. bool IsArrayMissingValueCheckHoistDisabled(const bool isJitLoopBody) const;
  51. bool IsJsArraySegmentHoistDisabled(const bool isJitLoopBody) const;
  52. bool IsArrayLengthHoistDisabled(const bool isJitLoopBody) const;
  53. bool IsTypedArrayTypeSpecDisabled(const bool isJitLoopBody) const;
  54. bool IsLdLenIntSpecDisabled() const;
  55. bool IsBoundCheckHoistDisabled(const bool isJitLoopBody) const;
  56. bool IsLoopCountBasedBoundCheckHoistDisabled(const bool isJitLoopBody) const;
  57. bool IsFloorInliningDisabled() const;
  58. bool IsNoProfileBailoutsDisabled() const;
  59. bool HasLdFldCallSiteInfo() const;
  60. bool IsStackArgOptDisabled() const;
  61. bool IsLoopImplicitCallInfoDisabled() const;
  62. bool IsPowIntIntTypeSpecDisabled() const;
  63. bool IsTagCheckDisabled() const;
  64. private:
  65. enum ProfileDataFlags : int64
  66. {
  67. Flags_None = 0,
  68. Flags_disableAggressiveIntTypeSpec = 1,
  69. Flags_disableAggressiveIntTypeSpec_jitLoopBody = 1 << 1,
  70. Flags_disableAggressiveMulIntTypeSpec = 1 << 2,
  71. Flags_disableAggressiveMulIntTypeSpec_jitLoopBody = 1 << 3,
  72. Flags_disableDivIntTypeSpec = 1 << 4,
  73. Flags_disableDivIntTypeSpec_jitLoopBody = 1 << 5,
  74. Flags_disableLossyIntTypeSpec = 1 << 6,
  75. Flags_disableTrackCompoundedIntOverflow = 1 << 7,
  76. Flags_disableFloatTypeSpec = 1 << 8,
  77. Flags_disableArrayCheckHoist = 1 << 9,
  78. Flags_disableArrayCheckHoist_jitLoopBody = 1 << 10,
  79. Flags_disableArrayMissingValueCheckHoist = 1 << 11,
  80. Flags_disableArrayMissingValueCheckHoist_jitLoopBody = 1 << 12,
  81. Flags_disableJsArraySegmentHoist = 1 << 13,
  82. Flags_disableJsArraySegmentHoist_jitLoopBody = 1 << 14,
  83. Flags_disableArrayLengthHoist = 1 << 15,
  84. Flags_disableArrayLengthHoist_jitLoopBody = 1 << 16,
  85. Flags_disableTypedArrayTypeSpec = 1 << 17,
  86. Flags_disableTypedArrayTypeSpec_jitLoopBody = 1 << 18,
  87. Flags_disableLdLenIntSpec = 1 << 19,
  88. Flags_disableBoundCheckHoist = 1 << 20,
  89. Flags_disableBoundCheckHoist_jitLoopBody = 1 << 21,
  90. Flags_disableLoopCountBasedBoundCheckHoist = 1 << 22,
  91. Flags_disableLoopCountBasedBoundCheckHoist_jitLoopBody = 1 << 23,
  92. Flags_disableFloorInlining = 1 << 24,
  93. Flags_disableNoProfileBailouts = 1 << 25,
  94. Flags_disableSwitchOpt = 1 << 26,
  95. Flags_disableEquivalentObjTypeSpec = 1 << 27,
  96. Flags_disableObjTypeSpec_jitLoopBody = 1 << 28,
  97. Flags_disableMemOp = 1 << 29,
  98. Flags_disableCheckThis = 1 << 30,
  99. Flags_hasLdFldCallSiteInfo = 1ll << 31,
  100. Flags_disableStackArgOpt = 1ll << 32,
  101. Flags_disableLoopImplicitCallInfo = 1ll << 33,
  102. Flags_disablePowIntIntTypeSpec = 1ll << 34,
  103. Flags_disableTagCheck = 1ll << 35
  104. };
  105. Js::ProfileId GetProfiledArrayCallSiteCount() const;
  106. Js::ProfileId GetProfiledCallSiteCount() const;
  107. Js::ProfileId GetProfiledReturnTypeCount() const;
  108. Js::ProfileId GetProfiledDivOrRemCount() const;
  109. Js::ProfileId GetProfiledSwitchCount() const;
  110. Js::ProfileId GetProfiledSlotCount() const;
  111. Js::ArgSlot GetProfiledInParamsCount() const;
  112. uint GetProfiledFldCount() const;
  113. uint GetLoopCount() const;
  114. BVFixed * GetLoopFlags() const;
  115. bool TestFlag(ProfileDataFlags flag) const;
  116. Js::CallSiteInfo * GetCallSiteInfo() const;
  117. ProfileDataIDL m_profileData;
  118. };