JitCache: Use a pointer in block_map.

This commit is contained in:
degasus 2017-01-11 20:03:35 +01:00
parent 74a27d9742
commit 928ccbef53
2 changed files with 3 additions and 3 deletions

View File

@ -153,7 +153,7 @@ void JitBaseBlockCache::FinalizeBlock(JitBlock& b, bool block_link, const u8* co
for (u32 block = pAddr / 32; block <= (pAddr + (b.originalSize - 1) * 4) / 32; ++block)
valid_block.Set(block);
block_map[std::make_pair(pAddr + 4 * b.originalSize - 1, pAddr)] = block_num;
block_map[std::make_pair(pAddr + 4 * b.originalSize - 1, pAddr)] = &b;
if (block_link)
{
@ -233,7 +233,7 @@ void JitBaseBlockCache::InvalidateICache(u32 address, const u32 length, bool for
auto it = block_map.lower_bound(std::make_pair(pAddr, 0));
while (it != block_map.end() && it->first.second < pAddr + length)
{
DestroyBlock(blocks[it->second], true);
DestroyBlock(*it->second, true);
it = block_map.erase(it);
}

View File

@ -177,7 +177,7 @@ private:
// Map indexed by the physical memory location.
// It is used to invalidate blocks based on memory location.
std::map<std::pair<u32, u32>, u32> block_map; // (end_addr, start_addr) -> number
std::map<std::pair<u32, u32>, JitBlock*> block_map; // (end_addr, start_addr) -> block
// Map indexed by the physical address of the entry point.
// This is used to query the block based on the current PC in a slow way.