Maintain a list of free code blocks, and allocate new blocks from the list rather than evicting at random.

Also maintain a list of memory pages with dirty code blocks that can be evicted. This allows the recompiler to evict dirty blocks in preference to freeing usable blocks when the free list is empty.
Increase the number of available code blocks on x86.
Increase the non-ARM code allocator memory to 128 MB.
This reduces the amount of code block churning when running software with a lot of code, eg Windows XP.
This commit is contained in:
SarahW 2019-01-19 21:54:14 +00:00
commit bf392ffd3a
7 changed files with 189 additions and 44 deletions

View file

@ -50,7 +50,8 @@ mem_block_t *codegen_allocator_allocate(mem_block_t *parent)
while (!mem_block_free_list)
{
codegen_delete_random_block();
if (!codegen_purge_purgable_list())
codegen_delete_random_block(1);
}
// fatal("codegen_allocator_allocate: free list empty!\n");