JITTimeProfileInfo.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  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. #include "Backend.h"
  6. JITTimeProfileInfo::JITTimeProfileInfo(ProfileDataIDL * profileData) :
  7. m_profileData(*profileData)
  8. {
  9. CompileAssert(sizeof(JITTimeProfileInfo) == sizeof(ProfileDataIDL));
  10. }
  11. /* static */
  12. void
  13. JITTimeProfileInfo::InitializeJITProfileData(
  14. __in ArenaAllocator * alloc,
  15. __in Js::DynamicProfileInfo * profileInfo,
  16. __in Js::FunctionBody *functionBody,
  17. __out ProfileDataIDL * data,
  18. bool isForegroundJIT)
  19. {
  20. if (profileInfo == nullptr)
  21. {
  22. return;
  23. }
  24. CompileAssert(sizeof(LdElemIDL) == sizeof(Js::LdElemInfo));
  25. CompileAssert(sizeof(StElemIDL) == sizeof(Js::StElemInfo));
  26. data->profiledLdElemCount = functionBody->GetProfiledLdElemCount();
  27. data->profiledStElemCount = functionBody->GetProfiledStElemCount();
  28. if (JITManager::GetJITManager()->IsOOPJITEnabled() || isForegroundJIT)
  29. {
  30. data->ldElemData = (LdElemIDL*)profileInfo->GetLdElemInfo();
  31. data->stElemData = (StElemIDL*)profileInfo->GetStElemInfo();
  32. }
  33. else
  34. {
  35. // for in-proc background JIT we need to explicitly copy LdElem and StElem info
  36. data->ldElemData = AnewArray(alloc, LdElemIDL, data->profiledLdElemCount);
  37. memcpy_s(
  38. data->ldElemData,
  39. data->profiledLdElemCount * sizeof(LdElemIDL),
  40. profileInfo->GetLdElemInfo(),
  41. functionBody->GetProfiledLdElemCount() * sizeof(Js::LdElemInfo)
  42. );
  43. data->stElemData = AnewArray(alloc, StElemIDL, data->profiledStElemCount);
  44. memcpy_s(
  45. data->stElemData,
  46. data->profiledStElemCount * sizeof(StElemIDL),
  47. profileInfo->GetStElemInfo(),
  48. functionBody->GetProfiledStElemCount() * sizeof(Js::StElemInfo)
  49. );
  50. }
  51. CompileAssert(sizeof(ArrayCallSiteIDL) == sizeof(Js::ArrayCallSiteInfo));
  52. data->profiledArrayCallSiteCount = functionBody->GetProfiledArrayCallSiteCount();
  53. data->arrayCallSiteData = (ArrayCallSiteIDL*)profileInfo->GetArrayCallSiteInfo();
  54. data->arrayCallSiteDataAddr = (intptr_t)profileInfo->GetArrayCallSiteInfo();
  55. CompileAssert(sizeof(FldIDL) == sizeof(Js::FldInfo));
  56. data->inlineCacheCount = functionBody->GetProfiledFldCount();
  57. data->fldData = (FldIDL*)profileInfo->GetFldInfo();
  58. data->fldDataAddr = (intptr_t)profileInfo->GetFldInfo();
  59. CompileAssert(sizeof(ThisIDL) == sizeof(Js::ThisInfo));
  60. data->thisData = *reinterpret_cast<ThisIDL*>(&profileInfo->GetThisInfo());
  61. CompileAssert(sizeof(CallSiteIDL) == sizeof(Js::CallSiteInfo));
  62. data->profiledCallSiteCount = functionBody->GetProfiledCallSiteCount();
  63. data->callSiteData = reinterpret_cast<CallSiteIDL*>(profileInfo->GetCallSiteInfo());
  64. CompileAssert(sizeof(BVUnitIDL) == sizeof(BVUnit));
  65. data->loopFlags = (BVFixedIDL*)profileInfo->GetLoopFlags();
  66. CompileAssert(sizeof(ValueType) == sizeof(uint16));
  67. data->profiledSlotCount = functionBody->GetProfiledSlotCount();
  68. data->slotData = reinterpret_cast<uint16*>(profileInfo->GetSlotInfo());
  69. data->profiledReturnTypeCount = functionBody->GetProfiledReturnTypeCount();
  70. data->returnTypeData = reinterpret_cast<uint16*>(profileInfo->GetReturnTypeInfo());
  71. data->profiledDivOrRemCount = functionBody->GetProfiledDivOrRemCount();
  72. data->divideTypeInfo = reinterpret_cast<uint16*>(profileInfo->GetDivideTypeInfo());
  73. data->profiledSwitchCount = functionBody->GetProfiledSwitchCount();
  74. data->switchTypeInfo = reinterpret_cast<uint16*>(profileInfo->GetSwitchTypeInfo());
  75. data->profiledInParamsCount = functionBody->GetProfiledInParamsCount();
  76. data->parameterInfo = reinterpret_cast<uint16*>(profileInfo->GetParameterInfo());
  77. data->loopCount = functionBody->GetLoopCount();
  78. data->loopImplicitCallFlags = reinterpret_cast<byte*>(profileInfo->GetLoopImplicitCallFlags());
  79. data->implicitCallFlags = static_cast<byte>(profileInfo->GetImplicitCallFlags());
  80. data->flags = 0;
  81. data->flags |= profileInfo->IsAggressiveIntTypeSpecDisabled(false) ? Flags_disableAggressiveIntTypeSpec : 0;
  82. data->flags |= profileInfo->IsAggressiveIntTypeSpecDisabled(true) ? Flags_disableAggressiveIntTypeSpec_jitLoopBody : 0;
  83. data->flags |= profileInfo->IsAggressiveMulIntTypeSpecDisabled(false) ? Flags_disableAggressiveMulIntTypeSpec : 0;
  84. data->flags |= profileInfo->IsAggressiveMulIntTypeSpecDisabled(true) ? Flags_disableAggressiveMulIntTypeSpec_jitLoopBody : 0;
  85. data->flags |= profileInfo->IsDivIntTypeSpecDisabled(false) ? Flags_disableDivIntTypeSpec : 0;
  86. data->flags |= profileInfo->IsDivIntTypeSpecDisabled(true) ? Flags_disableDivIntTypeSpec_jitLoopBody : 0;
  87. data->flags |= profileInfo->IsLossyIntTypeSpecDisabled() ? Flags_disableLossyIntTypeSpec : 0;
  88. data->flags |= profileInfo->IsTrackCompoundedIntOverflowDisabled() ? Flags_disableTrackCompoundedIntOverflow : 0;
  89. data->flags |= profileInfo->IsFloatTypeSpecDisabled() ? Flags_disableFloatTypeSpec : 0;
  90. data->flags |= profileInfo->IsArrayCheckHoistDisabled(false) ? Flags_disableArrayCheckHoist : 0;
  91. data->flags |= profileInfo->IsArrayCheckHoistDisabled(true) ? Flags_disableArrayCheckHoist_jitLoopBody : 0;
  92. data->flags |= profileInfo->IsArrayMissingValueCheckHoistDisabled(false) ? Flags_disableArrayMissingValueCheckHoist : 0;
  93. data->flags |= profileInfo->IsArrayMissingValueCheckHoistDisabled(true) ? Flags_disableArrayMissingValueCheckHoist_jitLoopBody : 0;
  94. data->flags |= profileInfo->IsJsArraySegmentHoistDisabled(false) ? Flags_disableJsArraySegmentHoist : 0;
  95. data->flags |= profileInfo->IsJsArraySegmentHoistDisabled(true) ? Flags_disableJsArraySegmentHoist_jitLoopBody : 0;
  96. data->flags |= profileInfo->IsArrayLengthHoistDisabled(false) ? Flags_disableArrayLengthHoist : 0;
  97. data->flags |= profileInfo->IsArrayLengthHoistDisabled(true) ? Flags_disableArrayLengthHoist_jitLoopBody : 0;
  98. data->flags |= profileInfo->IsTypedArrayTypeSpecDisabled(false) ? Flags_disableTypedArrayTypeSpec : 0;
  99. data->flags |= profileInfo->IsTypedArrayTypeSpecDisabled(true) ? Flags_disableTypedArrayTypeSpec_jitLoopBody : 0;
  100. data->flags |= profileInfo->IsLdLenIntSpecDisabled() ? Flags_disableLdLenIntSpec : 0;
  101. data->flags |= profileInfo->IsBoundCheckHoistDisabled(false) ? Flags_disableBoundCheckHoist : 0;
  102. data->flags |= profileInfo->IsBoundCheckHoistDisabled(true) ? Flags_disableBoundCheckHoist_jitLoopBody : 0;
  103. data->flags |= profileInfo->IsLoopCountBasedBoundCheckHoistDisabled(false) ? Flags_disableLoopCountBasedBoundCheckHoist : 0;
  104. data->flags |= profileInfo->IsLoopCountBasedBoundCheckHoistDisabled(true) ? Flags_disableLoopCountBasedBoundCheckHoist_jitLoopBody : 0;
  105. data->flags |= profileInfo->IsFloorInliningDisabled() ? Flags_disableFloorInlining : 0;
  106. data->flags |= profileInfo->IsNoProfileBailoutsDisabled() ? Flags_disableNoProfileBailouts : 0;
  107. data->flags |= profileInfo->IsSwitchOptDisabled() ? Flags_disableSwitchOpt : 0;
  108. data->flags |= profileInfo->IsEquivalentObjTypeSpecDisabled() ? Flags_disableEquivalentObjTypeSpec : 0;
  109. data->flags |= profileInfo->IsObjTypeSpecDisabledInJitLoopBody() ? Flags_disableObjTypeSpec_jitLoopBody : 0;
  110. data->flags |= profileInfo->IsMemOpDisabled() ? Flags_disableMemOp : 0;
  111. data->flags |= profileInfo->IsCheckThisDisabled() ? Flags_disableCheckThis : 0;
  112. data->flags |= profileInfo->HasLdFldCallSiteInfo() ? Flags_hasLdFldCallSiteInfo : 0;
  113. data->flags |= profileInfo->IsStackArgOptDisabled() ? Flags_disableStackArgOpt : 0;
  114. data->flags |= profileInfo->IsLoopImplicitCallInfoDisabled() ? Flags_disableLoopImplicitCallInfo : 0;
  115. data->flags |= profileInfo->IsPowIntIntTypeSpecDisabled() ? Flags_disablePowIntIntTypeSpec : 0;
  116. data->flags |= profileInfo->IsTagCheckDisabled() ? Flags_disableTagCheck : 0;
  117. }
  118. void
  119. JITTimeProfileInfo::DisableAggressiveIntTypeSpec(bool isLoopBody)
  120. {
  121. m_profileData.flags |= isLoopBody ? Flags_disableAggressiveIntTypeSpec_jitLoopBody : Flags_disableAggressiveIntTypeSpec;
  122. }
  123. void
  124. JITTimeProfileInfo::DisableArrayCheckHoist(bool isLoopBody)
  125. {
  126. m_profileData.flags |= isLoopBody ? Flags_disableArrayCheckHoist_jitLoopBody : Flags_disableArrayCheckHoist;
  127. }
  128. void
  129. JITTimeProfileInfo::DisableStackArgOpt()
  130. {
  131. m_profileData.flags |= Flags_disableStackArgOpt;
  132. }
  133. void
  134. JITTimeProfileInfo::DisableSwitchOpt()
  135. {
  136. m_profileData.flags |= Flags_disableSwitchOpt;
  137. }
  138. void
  139. JITTimeProfileInfo::DisableTrackCompoundedIntOverflow()
  140. {
  141. m_profileData.flags |= Flags_disableTrackCompoundedIntOverflow;
  142. }
  143. const Js::LdElemInfo *
  144. JITTimeProfileInfo::GetLdElemInfo(Js::ProfileId ldElemId) const
  145. {
  146. return &(reinterpret_cast<Js::LdElemInfo*>(m_profileData.ldElemData)[ldElemId]);
  147. }
  148. const Js::StElemInfo *
  149. JITTimeProfileInfo::GetStElemInfo(Js::ProfileId stElemId) const
  150. {
  151. return &(reinterpret_cast<Js::StElemInfo*>(m_profileData.stElemData)[stElemId]);
  152. }
  153. Js::ArrayCallSiteInfo *
  154. JITTimeProfileInfo::GetArrayCallSiteInfo(Js::ProfileId index) const
  155. {
  156. Assert(index < GetProfiledArrayCallSiteCount());
  157. return &(reinterpret_cast<Js::ArrayCallSiteInfo*>(m_profileData.arrayCallSiteData)[index]);
  158. }
  159. intptr_t
  160. JITTimeProfileInfo::GetArrayCallSiteInfoAddr(Js::ProfileId index) const
  161. {
  162. Assert(index < GetProfiledArrayCallSiteCount());
  163. return m_profileData.arrayCallSiteDataAddr + index * sizeof(ArrayCallSiteIDL);
  164. }
  165. Js::FldInfo *
  166. JITTimeProfileInfo::GetFldInfo(uint fieldAccessId) const
  167. {
  168. Assert(fieldAccessId < GetProfiledFldCount());
  169. return &(reinterpret_cast<Js::FldInfo*>(m_profileData.fldData)[fieldAccessId]);
  170. }
  171. intptr_t
  172. JITTimeProfileInfo::GetFldInfoAddr(uint fieldAccessId) const
  173. {
  174. Assert(fieldAccessId < GetProfiledFldCount());
  175. return m_profileData.fldDataAddr + fieldAccessId;
  176. }
  177. ValueType
  178. JITTimeProfileInfo::GetSlotLoad(Js::ProfileId slotLoadId) const
  179. {
  180. Assert(slotLoadId < GetProfiledSlotCount());
  181. return reinterpret_cast<ValueType*>(m_profileData.slotData)[slotLoadId];
  182. }
  183. Js::ThisInfo
  184. JITTimeProfileInfo::GetThisInfo() const
  185. {
  186. return *reinterpret_cast<const Js::ThisInfo*>(&m_profileData.thisData);
  187. }
  188. ValueType
  189. JITTimeProfileInfo::GetReturnType(Js::OpCode opcode, Js::ProfileId callSiteId) const
  190. {
  191. if (opcode < Js::OpCode::ProfiledReturnTypeCallI || (opcode > Js::OpCode::ProfiledReturnTypeCallIFlags && opcode < Js::OpCode::ProfiledReturnTypeCallIExtended) || opcode > Js::OpCode::ProfiledReturnTypeCallIExtendedFlags)
  192. {
  193. Assert(Js::DynamicProfileInfo::IsProfiledCallOp(opcode));
  194. Assert(callSiteId < GetProfiledCallSiteCount());
  195. return GetCallSiteInfo()[callSiteId].returnType;
  196. }
  197. Assert(Js::DynamicProfileInfo::IsProfiledReturnTypeOp(opcode));
  198. Assert(callSiteId < GetProfiledReturnTypeCount());
  199. return reinterpret_cast<ValueType*>(m_profileData.returnTypeData)[callSiteId];
  200. }
  201. ValueType
  202. JITTimeProfileInfo::GetDivProfileInfo(Js::ProfileId divideId) const
  203. {
  204. Assert(divideId < GetProfiledDivOrRemCount());
  205. return reinterpret_cast<ValueType*>(m_profileData.divideTypeInfo)[divideId];
  206. }
  207. ValueType
  208. JITTimeProfileInfo::GetSwitchProfileInfo(Js::ProfileId switchId) const
  209. {
  210. Assert(switchId < GetProfiledSwitchCount());
  211. return reinterpret_cast<ValueType*>(m_profileData.switchTypeInfo)[switchId];
  212. }
  213. ValueType
  214. JITTimeProfileInfo::GetParameterInfo(Js::ArgSlot index) const
  215. {
  216. Assert(index < GetProfiledInParamsCount());
  217. return reinterpret_cast<ValueType*>(m_profileData.parameterInfo)[index];
  218. }
  219. Js::ImplicitCallFlags
  220. JITTimeProfileInfo::GetLoopImplicitCallFlags(uint loopNum) const
  221. {
  222. // TODO: michhol OOP JIT, investigate vaibility of reenabling this assert
  223. // Assert(Js::DynamicProfileInfo::EnableImplicitCallFlags(functionBody));
  224. Assert(loopNum < GetLoopCount());
  225. // Mask out the dispose implicit call. We would bailout on reentrant dispose,
  226. // but it shouldn't affect optimization.
  227. return (Js::ImplicitCallFlags)(m_profileData.loopImplicitCallFlags[loopNum] & Js::ImplicitCall_All);
  228. }
  229. Js::ImplicitCallFlags
  230. JITTimeProfileInfo::GetImplicitCallFlags() const
  231. {
  232. return static_cast<Js::ImplicitCallFlags>(m_profileData.implicitCallFlags);
  233. }
  234. Js::LoopFlags
  235. JITTimeProfileInfo::GetLoopFlags(uint loopNum) const
  236. {
  237. Assert(GetLoopFlags() != nullptr);
  238. return GetLoopFlags()->GetRange<Js::LoopFlags>(loopNum * Js::LoopFlags::COUNT, Js::LoopFlags::COUNT);
  239. }
  240. uint16
  241. JITTimeProfileInfo::GetConstantArgInfo(Js::ProfileId callSiteId) const
  242. {
  243. return GetCallSiteInfo()[callSiteId].isArgConstant;
  244. }
  245. bool
  246. JITTimeProfileInfo::IsModulusOpByPowerOf2(Js::ProfileId profileId) const
  247. {
  248. return GetDivProfileInfo(profileId).IsLikelyTaggedInt();
  249. }
  250. bool
  251. JITTimeProfileInfo::IsAggressiveIntTypeSpecDisabled(const bool isJitLoopBody) const
  252. {
  253. if (isJitLoopBody)
  254. {
  255. return TestFlag(Flags_disableAggressiveIntTypeSpec_jitLoopBody);
  256. }
  257. else
  258. {
  259. return TestFlag(Flags_disableAggressiveIntTypeSpec);
  260. }
  261. }
  262. bool
  263. JITTimeProfileInfo::IsSwitchOptDisabled() const
  264. {
  265. return TestFlag(Flags_disableSwitchOpt);
  266. }
  267. bool
  268. JITTimeProfileInfo::IsEquivalentObjTypeSpecDisabled() const
  269. {
  270. return TestFlag(Flags_disableEquivalentObjTypeSpec);
  271. }
  272. bool
  273. JITTimeProfileInfo::IsObjTypeSpecDisabledInJitLoopBody() const
  274. {
  275. return TestFlag(Flags_disableObjTypeSpec_jitLoopBody);
  276. }
  277. bool
  278. JITTimeProfileInfo::IsAggressiveMulIntTypeSpecDisabled(const bool isJitLoopBody) const
  279. {
  280. if (isJitLoopBody)
  281. {
  282. return TestFlag(Flags_disableAggressiveMulIntTypeSpec_jitLoopBody);
  283. }
  284. else
  285. {
  286. return TestFlag(Flags_disableAggressiveMulIntTypeSpec);
  287. }
  288. }
  289. bool
  290. JITTimeProfileInfo::IsDivIntTypeSpecDisabled(const bool isJitLoopBody) const
  291. {
  292. if (isJitLoopBody)
  293. {
  294. return TestFlag(Flags_disableDivIntTypeSpec_jitLoopBody);
  295. }
  296. else
  297. {
  298. return TestFlag(Flags_disableDivIntTypeSpec);
  299. }
  300. }
  301. bool
  302. JITTimeProfileInfo::IsLossyIntTypeSpecDisabled() const
  303. {
  304. return TestFlag(Flags_disableLossyIntTypeSpec);
  305. }
  306. bool
  307. JITTimeProfileInfo::IsMemOpDisabled() const
  308. {
  309. return TestFlag(Flags_disableMemOp);
  310. }
  311. bool
  312. JITTimeProfileInfo::IsTrackCompoundedIntOverflowDisabled() const
  313. {
  314. return TestFlag(Flags_disableTrackCompoundedIntOverflow);
  315. }
  316. bool
  317. JITTimeProfileInfo::IsFloatTypeSpecDisabled() const
  318. {
  319. return TestFlag(Flags_disableFloatTypeSpec);
  320. }
  321. bool
  322. JITTimeProfileInfo::IsCheckThisDisabled() const
  323. {
  324. return TestFlag(Flags_disableCheckThis);
  325. }
  326. bool
  327. JITTimeProfileInfo::IsArrayCheckHoistDisabled(const bool isJitLoopBody) const
  328. {
  329. if (isJitLoopBody)
  330. {
  331. return TestFlag(Flags_disableArrayCheckHoist_jitLoopBody);
  332. }
  333. else
  334. {
  335. return TestFlag(Flags_disableArrayCheckHoist);
  336. }
  337. }
  338. bool
  339. JITTimeProfileInfo::IsArrayMissingValueCheckHoistDisabled(const bool isJitLoopBody) const
  340. {
  341. if (isJitLoopBody)
  342. {
  343. return TestFlag(Flags_disableArrayMissingValueCheckHoist_jitLoopBody);
  344. }
  345. else
  346. {
  347. return TestFlag(Flags_disableArrayMissingValueCheckHoist);
  348. }
  349. }
  350. bool
  351. JITTimeProfileInfo::IsJsArraySegmentHoistDisabled(const bool isJitLoopBody) const
  352. {
  353. if (isJitLoopBody)
  354. {
  355. return TestFlag(Flags_disableJsArraySegmentHoist_jitLoopBody);
  356. }
  357. else
  358. {
  359. return TestFlag(Flags_disableJsArraySegmentHoist);
  360. }
  361. }
  362. bool
  363. JITTimeProfileInfo::IsArrayLengthHoistDisabled(const bool isJitLoopBody) const
  364. {
  365. if (isJitLoopBody)
  366. {
  367. return TestFlag(Flags_disableArrayLengthHoist_jitLoopBody);
  368. }
  369. else
  370. {
  371. return TestFlag(Flags_disableArrayLengthHoist);
  372. }
  373. }
  374. bool
  375. JITTimeProfileInfo::IsTypedArrayTypeSpecDisabled(const bool isJitLoopBody) const
  376. {
  377. if (isJitLoopBody)
  378. {
  379. return TestFlag(Flags_disableTypedArrayTypeSpec_jitLoopBody);
  380. }
  381. else
  382. {
  383. return TestFlag(Flags_disableTypedArrayTypeSpec);
  384. }
  385. }
  386. bool
  387. JITTimeProfileInfo::IsLdLenIntSpecDisabled() const
  388. {
  389. return TestFlag(Flags_disableLdLenIntSpec);
  390. }
  391. bool
  392. JITTimeProfileInfo::IsBoundCheckHoistDisabled(const bool isJitLoopBody) const
  393. {
  394. if (isJitLoopBody)
  395. {
  396. return TestFlag(Flags_disableBoundCheckHoist_jitLoopBody);
  397. }
  398. else
  399. {
  400. return TestFlag(Flags_disableBoundCheckHoist);
  401. }
  402. }
  403. bool
  404. JITTimeProfileInfo::IsLoopCountBasedBoundCheckHoistDisabled(const bool isJitLoopBody) const
  405. {
  406. if (isJitLoopBody)
  407. {
  408. return TestFlag(Flags_disableLoopCountBasedBoundCheckHoist_jitLoopBody);
  409. }
  410. else
  411. {
  412. return TestFlag(Flags_disableLoopCountBasedBoundCheckHoist);
  413. }
  414. }
  415. bool
  416. JITTimeProfileInfo::IsStackArgOptDisabled() const
  417. {
  418. return TestFlag(Flags_disableStackArgOpt);
  419. }
  420. bool
  421. JITTimeProfileInfo::IsLoopImplicitCallInfoDisabled() const
  422. {
  423. return TestFlag(Flags_disableLoopImplicitCallInfo);
  424. }
  425. bool
  426. JITTimeProfileInfo::IsPowIntIntTypeSpecDisabled() const
  427. {
  428. return TestFlag(Flags_disablePowIntIntTypeSpec);
  429. }
  430. bool
  431. JITTimeProfileInfo::IsFloorInliningDisabled() const
  432. {
  433. return TestFlag(Flags_disableFloorInlining);
  434. }
  435. bool
  436. JITTimeProfileInfo::IsNoProfileBailoutsDisabled() const
  437. {
  438. return TestFlag(Flags_disableNoProfileBailouts);
  439. }
  440. bool
  441. JITTimeProfileInfo::IsTagCheckDisabled() const
  442. {
  443. return TestFlag(Flags_disableTagCheck);
  444. }
  445. bool
  446. JITTimeProfileInfo::HasLdFldCallSiteInfo() const
  447. {
  448. return TestFlag(Flags_hasLdFldCallSiteInfo);
  449. }
  450. Js::ProfileId
  451. JITTimeProfileInfo::GetProfiledArrayCallSiteCount() const
  452. {
  453. return static_cast<Js::ProfileId>(m_profileData.profiledArrayCallSiteCount);
  454. }
  455. Js::ProfileId
  456. JITTimeProfileInfo::GetProfiledCallSiteCount() const
  457. {
  458. return static_cast<Js::ProfileId>(m_profileData.profiledCallSiteCount);
  459. }
  460. Js::ProfileId
  461. JITTimeProfileInfo::GetProfiledReturnTypeCount() const
  462. {
  463. return static_cast<Js::ProfileId>(m_profileData.profiledReturnTypeCount);
  464. }
  465. Js::ProfileId
  466. JITTimeProfileInfo::GetProfiledDivOrRemCount() const
  467. {
  468. return static_cast<Js::ProfileId>(m_profileData.profiledDivOrRemCount);
  469. }
  470. Js::ProfileId
  471. JITTimeProfileInfo::GetProfiledSwitchCount() const
  472. {
  473. return static_cast<Js::ProfileId>(m_profileData.profiledSwitchCount);
  474. }
  475. Js::ProfileId
  476. JITTimeProfileInfo::GetProfiledSlotCount() const
  477. {
  478. return static_cast<Js::ProfileId>(m_profileData.profiledSlotCount);
  479. }
  480. Js::ArgSlot
  481. JITTimeProfileInfo::GetProfiledInParamsCount() const
  482. {
  483. return static_cast<Js::ArgSlot>(m_profileData.profiledInParamsCount);
  484. }
  485. uint
  486. JITTimeProfileInfo::GetProfiledFldCount() const
  487. {
  488. return m_profileData.inlineCacheCount;
  489. }
  490. uint
  491. JITTimeProfileInfo::GetLoopCount() const
  492. {
  493. return m_profileData.loopCount;
  494. }
  495. Js::CallSiteInfo *
  496. JITTimeProfileInfo::GetCallSiteInfo() const
  497. {
  498. return reinterpret_cast<Js::CallSiteInfo*>(m_profileData.callSiteData);
  499. }
  500. bool
  501. JITTimeProfileInfo::TestFlag(ProfileDataFlags flag) const
  502. {
  503. return (m_profileData.flags & flag) != 0;
  504. }
  505. BVFixed *
  506. JITTimeProfileInfo::GetLoopFlags() const
  507. {
  508. return (BVFixed*)m_profileData.loopFlags;
  509. }