LLE JIT: Added simple block linking at immediate CALL's and JUMP's. The code checks if the block being jump to has already been compiled and jumps there if it has, bypassing the dispatcher. This results in a speed-up of around 7 - 10%.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6585 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau committed 2010-12-15 07:08:36 +00:00
1 parent e61133625a
commit c584bd5333
3 files changed
+40

No files matched your search

+8
View File
@@ -39,6 +39,7 @@ DSPEmitter::DSPEmitter() : storeIndex(-1), storeIndex2(-1)
AllocCodeSpace(COMPILED_CODE_SIZE);
blocks = new CompiledCode[MAX_BLOCKS];
blockLinks = new CompiledCode[MAX_BLOCKS];
blockSize = new u16[0x10000];
compileSR = 0;
@@ -52,6 +53,7 @@ DSPEmitter::DSPEmitter() : storeIndex(-1), storeIndex2(-1)
for(int i = 0x0000; i < MAX_BLOCKS; i++)
{
blocks[i] = (CompiledCode)stubEntryPoint;
blockLinks[i] = 0;
blockSize[i] = 0;
}
}
@@ -59,6 +61,7 @@ DSPEmitter::DSPEmitter() : storeIndex(-1), storeIndex2(-1)
DSPEmitter::~DSPEmitter()
{
delete[] blocks;
delete[] blockLinks;
delete[] blockSize;
FreeCodeSpace();
}
@@ -68,6 +71,7 @@ void DSPEmitter::ClearIRAM() {
for(int i = 0x0000; i < 0x1000; i++)
{
blocks[i] = (CompiledCode)stubEntryPoint;
blockLinks[i] = 0;
blockSize[i] = 0;
}
}
@@ -202,6 +206,9 @@ void DSPEmitter::Compile(int start_addr)
if (g_dsp.exceptions == 0)
return;
*/
blockLinkEntry = GetCodePtr();
ABI_CallFunction((void *)&DSPCore_CheckExternalInterrupt);
compilePC = start_addr;
@@ -327,6 +334,7 @@ void DSPEmitter::Compile(int start_addr)
}
blocks[start_addr] = (CompiledCode)entryPoint;
blockLinks[start_addr] = (CompiledCode)blockLinkEntry;
if (blockSize[start_addr] == 0)
{
// just a safeguard, should never happen anymore.