Fix a bug in DSP Jit where branches had a blockSize of zero.

Add some useful checking to J_CC/SetJumpTarget.
Refactor increment/decrement and reuse code with increase/decrease.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5816 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
j4ck.fr0st
2010-06-30 16:17:20 +00:00
parent 599a4c974d
commit 89c4068663
4 changed files with 109 additions and 109 deletions

View File

@ -194,6 +194,8 @@ const u8 *DSPEmitter::Compile(int start_addr) {
SetJumpTarget(rLoopCounterExit);
}
blockSize[start_addr]++;
// End the block if we're at a loop end.
if (opcode->branch ||
(DSPAnalyzer::code_flags[addr] & DSPAnalyzer::CODE_LOOP_END) ||
@ -201,8 +203,6 @@ const u8 *DSPEmitter::Compile(int start_addr) {
break;
}
addr += opcode->size;
blockSize[start_addr]++;
}
// ABI_RestoreStack(0);
@ -210,6 +210,13 @@ const u8 *DSPEmitter::Compile(int start_addr) {
RET();
blocks[start_addr] = (CompiledCode)entryPoint;
if (blockSize[start_addr] == 0)
{
// just a safeguard, should never happen anymore.
// if it does we might get stuck over in RunForCycles.
ERROR_LOG(DSPLLE, "Block at 0x%04x has zero size", start_addr);
blockSize[start_addr] = 1;
}
return entryPoint;
}