Skip to content

Commit

Permalink
[1.6>1.7] [MERGE #3411 @agarwal-sandeep] Fix -stats:rejit for chakra …
Browse files Browse the repository at this point in the history
…full

Merge pull request #3411 from agarwal-sandeep:fixstatsrejit
  • Loading branch information
agarwal-sandeep committed Jul 22, 2017
2 parents 36fc51b + 618a50e commit ad54488
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/Runtime/Base/ScriptContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5559,6 +5559,9 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie

}
}

this->ClearBailoutReasonCountsMap();
this->ClearRejitReasonCountsArray();
#endif

#ifdef FIELD_ACCESS_STATS
Expand Down Expand Up @@ -5731,6 +5734,34 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie
}
#endif
}
void ScriptContext::ClearBailoutReasonCountsMap()
{
if (this->bailoutReasonCounts != nullptr)
{
this->bailoutReasonCounts->Clear();
}
if (this->bailoutReasonCountsCap != nullptr)
{
this->bailoutReasonCountsCap->Clear();
}
}
void ScriptContext::ClearRejitReasonCountsArray()
{
if (this->rejitReasonCounts != nullptr)
{
for (UINT16 i = 0; i < NumRejitReasons; i++)
{
this->rejitReasonCounts[i] = 0;
}
}
if (this->rejitReasonCountsCap != nullptr)
{
for (UINT16 i = 0; i < NumRejitReasons; i++)
{
this->rejitReasonCountsCap[i] = 0;
}
}
}
#endif

#ifdef ENABLE_BASIC_TELEMETRY
Expand Down
2 changes: 2 additions & 0 deletions lib/Runtime/Base/ScriptContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,8 @@ namespace Js
BailoutStatsMap *bailoutReasonCountsCap;
uint *rejitReasonCounts;
uint *rejitReasonCountsCap;
void ClearBailoutReasonCountsMap();
void ClearRejitReasonCountsArray();
#endif
#ifdef ENABLE_BASIC_TELEMETRY

Expand Down

0 comments on commit ad54488

Please sign in to comment.