Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@ad54488def] [1.6>1.7] [MERGE #3411 @aga…
Browse files Browse the repository at this point in the history
…rwal-sandeep] Fix -stats:rejit for chakra full

Merge pull request #3411 from agarwal-sandeep:fixstatsrejit
  • Loading branch information
chakrabot committed Jul 22, 2017
1 parent 79c597e commit 4c77b78
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions deps/chakrashim/core/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 deps/chakrashim/core/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 4c77b78

Please sign in to comment.