Merge pull request #12336 from AdmiralCurtiss/lazymemory-ringbuffer

Common/MemArenaWin: Rewrite LazyMemoryRegion by repeatedly mapping the same block of memory for unwritten regions.
This commit is contained in:
Admiral H. Curtiss 2023-12-10 13:00:09 +01:00 committed by GitHub
commit f284bfca45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 245 additions and 56 deletions

View file

@ -121,9 +121,14 @@ void JitBaseBlockCache::FinalizeBlock(JitBlock& block, bool block_link,
{
size_t index = FastLookupIndexForAddress(block.effectiveAddress, block.feature_flags);
if (m_entry_points_ptr)
{
m_entry_points_arena.EnsureMemoryPageWritable(index * sizeof(u8*));
m_entry_points_ptr[index] = block.normalEntry;
}
else
{
m_fast_block_map_fallback[index] = █
}
block.fast_block_map_index = index;
block.physical_addresses = physical_addresses;
@ -485,9 +490,14 @@ JitBlock* JitBaseBlockCache::MoveBlockIntoFastCache(u32 addr, CPUEmuFeatureFlags
// And create a new one
size_t index = FastLookupIndexForAddress(addr, feature_flags);
if (m_entry_points_ptr)
{
m_entry_points_arena.EnsureMemoryPageWritable(index * sizeof(u8*));
m_entry_points_ptr[index] = block->normalEntry;
}
else
{
m_fast_block_map_fallback[index] = block;
}
block->fast_block_map_index = index;
return block;