JITTimeProfileInfo.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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. data->flags |= profileInfo->IsOptimizeTryFinallyDisabled() ? Flags_disableOptimizeTryFinally : 0;
  118. }
  119. const Js::LdElemInfo *
  120. JITTimeProfileInfo::GetLdElemInfo(Js::ProfileId ldElemId) const
  121. {
  122. return &(reinterpret_cast<Js::LdElemInfo*>(m_profileData.ldElemData)[ldElemId]);
  123. }
  124. const Js::StElemInfo *
  125. JITTimeProfileInfo::GetStElemInfo(Js::ProfileId stElemId) const
  126. {
  127. return &(reinterpret_cast<Js::StElemInfo*>(m_profileData.stElemData)[stElemId]);
  128. }
  129. Js::ArrayCallSiteInfo *
  130. JITTimeProfileInfo::GetArrayCallSiteInfo(Js::ProfileId index) const
  131. {
  132. Assert(index < GetProfiledArrayCallSiteCount());
  133. return &(reinterpret_cast<Js::ArrayCallSiteInfo*>(m_profileData.arrayCallSiteData)[index]);
  134. }
  135. intptr_t
  136. JITTimeProfileInfo::GetArrayCallSiteInfoAddr(Js::ProfileId index) const
  137. {
  138. Assert(index < GetProfiledArrayCallSiteCount());
  139. return m_profileData.arrayCallSiteDataAddr + index * sizeof(ArrayCallSiteIDL);
  140. }
  141. Js::FldInfo *
  142. JITTimeProfileInfo::GetFldInfo(uint fieldAccessId) const
  143. {
  144. Assert(fieldAccessId < GetProfiledFldCount());
  145. return &(reinterpret_cast<Js::FldInfo*>(m_profileData.fldData)[fieldAccessId]);
  146. }
  147. intptr_t
  148. JITTimeProfileInfo::GetFldInfoAddr(uint fieldAccessId) const
  149. {
  150. Assert(fieldAccessId < GetProfiledFldCount());
  151. return m_profileData.fldDataAddr + fieldAccessId * sizeof(Js::FldInfo);
  152. }
  153. ValueType
  154. JITTimeProfileInfo::GetSlotLoad(Js::ProfileId slotLoadId) const
  155. {
  156. Assert(slotLoadId < GetProfiledSlotCount());
  157. return reinterpret_cast<ValueType*>(m_profileData.slotData)[slotLoadId];
  158. }
  159. Js::ThisInfo
  160. JITTimeProfileInfo::GetThisInfo() const
  161. {
  162. return *reinterpret_cast<const Js::ThisInfo*>(&m_profileData.thisData);
  163. }
  164. ValueType
  165. JITTimeProfileInfo::GetReturnType(Js::OpCode opcode, Js::ProfileId callSiteId) const
  166. {
  167. if (opcode < Js::OpCode::ProfiledReturnTypeCallI || (opcode > Js::OpCode::ProfiledReturnTypeCallIFlags && opcode < Js::OpCode::ProfiledReturnTypeCallIExtended) || opcode > Js::OpCode::ProfiledReturnTypeCallIExtendedFlags)
  168. {
  169. Assert(Js::DynamicProfileInfo::IsProfiledCallOp(opcode));
  170. Assert(callSiteId < GetProfiledCallSiteCount());
  171. return GetCallSiteInfo()[callSiteId].returnType;
  172. }
  173. Assert(Js::DynamicProfileInfo::IsProfiledReturnTypeOp(opcode));
  174. Assert(callSiteId < GetProfiledReturnTypeCount());
  175. return reinterpret_cast<ValueType*>(m_profileData.returnTypeData)[callSiteId];
  176. }
  177. ValueType
  178. JITTimeProfileInfo::GetDivProfileInfo(Js::ProfileId divideId) const
  179. {
  180. Assert(divideId < GetProfiledDivOrRemCount());
  181. return reinterpret_cast<ValueType*>(m_profileData.divideTypeInfo)[divideId];
  182. }
  183. ValueType
  184. JITTimeProfileInfo::GetSwitchProfileInfo(Js::ProfileId switchId) const
  185. {
  186. Assert(switchId < GetProfiledSwitchCount());
  187. return reinterpret_cast<ValueType*>(m_profileData.switchTypeInfo)[switchId];
  188. }
  189. ValueType
  190. JITTimeProfileInfo::GetParameterInfo(Js::ArgSlot index) const
  191. {
  192. Assert(index < GetProfiledInParamsCount());
  193. return reinterpret_cast<ValueType*>(m_profileData.parameterInfo)[index];
  194. }
  195. Js::ImplicitCallFlags
  196. JITTimeProfileInfo::GetLoopImplicitCallFlags(uint loopNum) const
  197. {
  198. // TODO: michhol OOP JIT, investigate vaibility of reenabling this assert
  199. // Assert(Js::DynamicProfileInfo::EnableImplicitCallFlags(functionBody));
  200. Assert(loopNum < GetLoopCount());
  201. // Mask out the dispose implicit call. We would bailout on reentrant dispose,
  202. // but it shouldn't affect optimization.
  203. return (Js::ImplicitCallFlags)(m_profileData.loopImplicitCallFlags[loopNum] & Js::ImplicitCall_All);
  204. }
  205. Js::ImplicitCallFlags
  206. JITTimeProfileInfo::GetImplicitCallFlags() const
  207. {
  208. return static_cast<Js::ImplicitCallFlags>(m_profileData.implicitCallFlags);
  209. }
  210. Js::LoopFlags
  211. JITTimeProfileInfo::GetLoopFlags(uint loopNum) const
  212. {
  213. Assert(GetLoopFlags() != nullptr);
  214. return GetLoopFlags()->GetRange<Js::LoopFlags>(loopNum * Js::LoopFlags::COUNT, Js::LoopFlags::COUNT);
  215. }
  216. uint16
  217. JITTimeProfileInfo::GetConstantArgInfo(Js::ProfileId callSiteId) const
  218. {
  219. return GetCallSiteInfo()[callSiteId].isArgConstant;
  220. }
  221. bool
  222. JITTimeProfileInfo::IsModulusOpByPowerOf2(Js::ProfileId profileId) const
  223. {
  224. return GetDivProfileInfo(profileId).IsLikelyTaggedInt();
  225. }
  226. bool
  227. JITTimeProfileInfo::IsAggressiveIntTypeSpecDisabled(const bool isJitLoopBody) const
  228. {
  229. if (isJitLoopBody)
  230. {
  231. return TestFlag(Flags_disableAggressiveIntTypeSpec_jitLoopBody);
  232. }
  233. else
  234. {
  235. return TestFlag(Flags_disableAggressiveIntTypeSpec);
  236. }
  237. }
  238. bool
  239. JITTimeProfileInfo::IsSwitchOptDisabled() const
  240. {
  241. return TestFlag(Flags_disableSwitchOpt);
  242. }
  243. bool
  244. JITTimeProfileInfo::IsEquivalentObjTypeSpecDisabled() const
  245. {
  246. return TestFlag(Flags_disableEquivalentObjTypeSpec);
  247. }
  248. bool
  249. JITTimeProfileInfo::IsObjTypeSpecDisabledInJitLoopBody() const
  250. {
  251. return TestFlag(Flags_disableObjTypeSpec_jitLoopBody);
  252. }
  253. bool
  254. JITTimeProfileInfo::IsAggressiveMulIntTypeSpecDisabled(const bool isJitLoopBody) const
  255. {
  256. if (isJitLoopBody)
  257. {
  258. return TestFlag(Flags_disableAggressiveMulIntTypeSpec_jitLoopBody);
  259. }
  260. else
  261. {
  262. return TestFlag(Flags_disableAggressiveMulIntTypeSpec);
  263. }
  264. }
  265. bool
  266. JITTimeProfileInfo::IsDivIntTypeSpecDisabled(const bool isJitLoopBody) const
  267. {
  268. if (isJitLoopBody)
  269. {
  270. return TestFlag(Flags_disableDivIntTypeSpec_jitLoopBody);
  271. }
  272. else
  273. {
  274. return TestFlag(Flags_disableDivIntTypeSpec);
  275. }
  276. }
  277. bool
  278. JITTimeProfileInfo::IsLossyIntTypeSpecDisabled() const
  279. {
  280. return TestFlag(Flags_disableLossyIntTypeSpec);
  281. }
  282. bool
  283. JITTimeProfileInfo::IsMemOpDisabled() const
  284. {
  285. return TestFlag(Flags_disableMemOp);
  286. }
  287. bool
  288. JITTimeProfileInfo::IsTrackCompoundedIntOverflowDisabled() const
  289. {
  290. return TestFlag(Flags_disableTrackCompoundedIntOverflow);
  291. }
  292. bool
  293. JITTimeProfileInfo::IsFloatTypeSpecDisabled() const
  294. {
  295. return TestFlag(Flags_disableFloatTypeSpec);
  296. }
  297. bool
  298. JITTimeProfileInfo::IsCheckThisDisabled() const
  299. {
  300. return TestFlag(Flags_disableCheckThis);
  301. }
  302. bool
  303. JITTimeProfileInfo::IsArrayCheckHoistDisabled(const bool isJitLoopBody) const
  304. {
  305. if (isJitLoopBody)
  306. {
  307. return TestFlag(Flags_disableArrayCheckHoist_jitLoopBody);
  308. }
  309. else
  310. {
  311. return TestFlag(Flags_disableArrayCheckHoist);
  312. }
  313. }
  314. bool
  315. JITTimeProfileInfo::IsArrayMissingValueCheckHoistDisabled(const bool isJitLoopBody) const
  316. {
  317. if (isJitLoopBody)
  318. {
  319. return TestFlag(Flags_disableArrayMissingValueCheckHoist_jitLoopBody);
  320. }
  321. else
  322. {
  323. return TestFlag(Flags_disableArrayMissingValueCheckHoist);
  324. }
  325. }
  326. bool
  327. JITTimeProfileInfo::IsJsArraySegmentHoistDisabled(const bool isJitLoopBody) const
  328. {
  329. if (isJitLoopBody)
  330. {
  331. return TestFlag(Flags_disableJsArraySegmentHoist_jitLoopBody);
  332. }
  333. else
  334. {
  335. return TestFlag(Flags_disableJsArraySegmentHoist);
  336. }
  337. }
  338. bool
  339. JITTimeProfileInfo::IsArrayLengthHoistDisabled(const bool isJitLoopBody) const
  340. {
  341. if (isJitLoopBody)
  342. {
  343. return TestFlag(Flags_disableArrayLengthHoist_jitLoopBody);
  344. }
  345. else
  346. {
  347. return TestFlag(Flags_disableArrayLengthHoist);
  348. }
  349. }
  350. bool
  351. JITTimeProfileInfo::IsTypedArrayTypeSpecDisabled(const bool isJitLoopBody) const
  352. {
  353. if (isJitLoopBody)
  354. {
  355. return TestFlag(Flags_disableTypedArrayTypeSpec_jitLoopBody);
  356. }
  357. else
  358. {
  359. return TestFlag(Flags_disableTypedArrayTypeSpec);
  360. }
  361. }
  362. bool
  363. JITTimeProfileInfo::IsLdLenIntSpecDisabled() const
  364. {
  365. return TestFlag(Flags_disableLdLenIntSpec);
  366. }
  367. bool
  368. JITTimeProfileInfo::IsBoundCheckHoistDisabled(const bool isJitLoopBody) const
  369. {
  370. if (isJitLoopBody)
  371. {
  372. return TestFlag(Flags_disableBoundCheckHoist_jitLoopBody);
  373. }
  374. else
  375. {
  376. return TestFlag(Flags_disableBoundCheckHoist);
  377. }
  378. }
  379. bool
  380. JITTimeProfileInfo::IsLoopCountBasedBoundCheckHoistDisabled(const bool isJitLoopBody) const
  381. {
  382. if (isJitLoopBody)
  383. {
  384. return TestFlag(Flags_disableLoopCountBasedBoundCheckHoist_jitLoopBody);
  385. }
  386. else
  387. {
  388. return TestFlag(Flags_disableLoopCountBasedBoundCheckHoist);
  389. }
  390. }
  391. bool
  392. JITTimeProfileInfo::IsStackArgOptDisabled() const
  393. {
  394. return TestFlag(Flags_disableStackArgOpt);
  395. }
  396. bool
  397. JITTimeProfileInfo::IsLoopImplicitCallInfoDisabled() const
  398. {
  399. return TestFlag(Flags_disableLoopImplicitCallInfo);
  400. }
  401. bool
  402. JITTimeProfileInfo::IsPowIntIntTypeSpecDisabled() const
  403. {
  404. return TestFlag(Flags_disablePowIntIntTypeSpec);
  405. }
  406. bool
  407. JITTimeProfileInfo::IsFloorInliningDisabled() const
  408. {
  409. return TestFlag(Flags_disableFloorInlining);
  410. }
  411. bool
  412. JITTimeProfileInfo::IsNoProfileBailoutsDisabled() const
  413. {
  414. return TestFlag(Flags_disableNoProfileBailouts);
  415. }
  416. bool
  417. JITTimeProfileInfo::IsTagCheckDisabled() const
  418. {
  419. return TestFlag(Flags_disableTagCheck);
  420. }
  421. bool
  422. JITTimeProfileInfo::IsOptimizeTryFinallyDisabled() const
  423. {
  424. return TestFlag(Flags_disableOptimizeTryFinally);
  425. }
  426. bool
  427. JITTimeProfileInfo::HasLdFldCallSiteInfo() const
  428. {
  429. return TestFlag(Flags_hasLdFldCallSiteInfo);
  430. }
  431. Js::ProfileId
  432. JITTimeProfileInfo::GetProfiledArrayCallSiteCount() const
  433. {
  434. return static_cast<Js::ProfileId>(m_profileData.profiledArrayCallSiteCount);
  435. }
  436. Js::ProfileId
  437. JITTimeProfileInfo::GetProfiledCallSiteCount() const
  438. {
  439. return static_cast<Js::ProfileId>(m_profileData.profiledCallSiteCount);
  440. }
  441. Js::ProfileId
  442. JITTimeProfileInfo::GetProfiledReturnTypeCount() const
  443. {
  444. return static_cast<Js::ProfileId>(m_profileData.profiledReturnTypeCount);
  445. }
  446. Js::ProfileId
  447. JITTimeProfileInfo::GetProfiledDivOrRemCount() const
  448. {
  449. return static_cast<Js::ProfileId>(m_profileData.profiledDivOrRemCount);
  450. }
  451. Js::ProfileId
  452. JITTimeProfileInfo::GetProfiledSwitchCount() const
  453. {
  454. return static_cast<Js::ProfileId>(m_profileData.profiledSwitchCount);
  455. }
  456. Js::ProfileId
  457. JITTimeProfileInfo::GetProfiledSlotCount() const
  458. {
  459. return static_cast<Js::ProfileId>(m_profileData.profiledSlotCount);
  460. }
  461. Js::ArgSlot
  462. JITTimeProfileInfo::GetProfiledInParamsCount() const
  463. {
  464. return static_cast<Js::ArgSlot>(m_profileData.profiledInParamsCount);
  465. }
  466. uint
  467. JITTimeProfileInfo::GetProfiledFldCount() const
  468. {
  469. return m_profileData.inlineCacheCount;
  470. }
  471. uint
  472. JITTimeProfileInfo::GetLoopCount() const
  473. {
  474. return m_profileData.loopCount;
  475. }
  476. Js::CallSiteInfo *
  477. JITTimeProfileInfo::GetCallSiteInfo() const
  478. {
  479. return reinterpret_cast<Js::CallSiteInfo*>(m_profileData.callSiteData);
  480. }
  481. bool
  482. JITTimeProfileInfo::TestFlag(ProfileDataFlags flag) const
  483. {
  484. return (m_profileData.flags & flag) != 0;
  485. }
  486. BVFixed *
  487. JITTimeProfileInfo::GetLoopFlags() const
  488. {
  489. return (BVFixed*)m_profileData.loopFlags;
  490. }