JitCommon: Restructure the profiler calls.

This commit is contained in:
degasus
2017-08-12 22:18:22 +02:00
parent 95ce860265
commit 958b75b707
5 changed files with 52 additions and 55 deletions

View File

@ -119,12 +119,12 @@ void GetProfileResults(ProfileStats* prof_stats)
QueryPerformanceFrequency((LARGE_INTEGER*)&prof_stats->countsPerSec);
g_jit->GetBlockCache()->RunOnBlocks([&prof_stats](const JitBlock& block) {
// Rough heuristic. Mem instructions should cost more.
u64 cost = block.originalSize * (block.runCount / 4);
u64 timecost = block.ticCounter;
const auto& data = block.profile_data;
u64 cost = data.downcountCounter;
u64 timecost = data.ticCounter;
// Todo: tweak.
if (block.runCount >= 1)
prof_stats->block_stats.emplace_back(block.effectiveAddress, cost, timecost, block.runCount,
if (data.runCount >= 1)
prof_stats->block_stats.emplace_back(block.effectiveAddress, cost, timecost, data.runCount,
block.codeSize);
prof_stats->cost_sum += cost;
prof_stats->timecost_sum += timecost;