Skip to content

Commit ad54488

Browse files
[1.6>1.7] [MERGE #3411 @agarwal-sandeep] Fix -stats:rejit for chakra full
Merge pull request #3411 from agarwal-sandeep:fixstatsrejit
2 parents 36fc51b + 618a50e commit ad54488

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

lib/Runtime/Base/ScriptContext.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5559,6 +5559,9 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie
55595559

55605560
}
55615561
}
5562+
5563+
this->ClearBailoutReasonCountsMap();
5564+
this->ClearRejitReasonCountsArray();
55625565
#endif
55635566

55645567
#ifdef FIELD_ACCESS_STATS
@@ -5731,6 +5734,34 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie
57315734
}
57325735
#endif
57335736
}
5737+
void ScriptContext::ClearBailoutReasonCountsMap()
5738+
{
5739+
if (this->bailoutReasonCounts != nullptr)
5740+
{
5741+
this->bailoutReasonCounts->Clear();
5742+
}
5743+
if (this->bailoutReasonCountsCap != nullptr)
5744+
{
5745+
this->bailoutReasonCountsCap->Clear();
5746+
}
5747+
}
5748+
void ScriptContext::ClearRejitReasonCountsArray()
5749+
{
5750+
if (this->rejitReasonCounts != nullptr)
5751+
{
5752+
for (UINT16 i = 0; i < NumRejitReasons; i++)
5753+
{
5754+
this->rejitReasonCounts[i] = 0;
5755+
}
5756+
}
5757+
if (this->rejitReasonCountsCap != nullptr)
5758+
{
5759+
for (UINT16 i = 0; i < NumRejitReasons; i++)
5760+
{
5761+
this->rejitReasonCountsCap[i] = 0;
5762+
}
5763+
}
5764+
}
57345765
#endif
57355766

57365767
#ifdef ENABLE_BASIC_TELEMETRY

lib/Runtime/Base/ScriptContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ namespace Js
711711
BailoutStatsMap *bailoutReasonCountsCap;
712712
uint *rejitReasonCounts;
713713
uint *rejitReasonCountsCap;
714+
void ClearBailoutReasonCountsMap();
715+
void ClearRejitReasonCountsArray();
714716
#endif
715717
#ifdef ENABLE_BASIC_TELEMETRY
716718

0 commit comments

Comments
 (0)