Fixed a bug in JIT/JITIL. The size_of_merged_addresses variable was being used before it was initialised in certain cases (Rogue Leader).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6246 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
b80e207a8a
commit
26c7a5303d
|
@ -140,7 +140,7 @@ static void LoadSpeedhacks(const char *section, std::map<u32, int> &hacks, IniFi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetSpeedhackCycles(u32 addr)
|
int GetSpeedhackCycles(const u32 addr)
|
||||||
{
|
{
|
||||||
std::map<u32, int>::const_iterator iter = speedHacks.find(addr);
|
std::map<u32, int>::const_iterator iter = speedHacks.find(addr);
|
||||||
if (iter == speedHacks.end())
|
if (iter == speedHacks.end())
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct Patch
|
||||||
bool active;
|
bool active;
|
||||||
};
|
};
|
||||||
|
|
||||||
int GetSpeedhackCycles(u32 addr);
|
int GetSpeedhackCycles(const u32 addr);
|
||||||
void LoadPatchSection(const char *section, std::vector<Patch> &patches, IniFile &ini);
|
void LoadPatchSection(const char *section, std::vector<Patch> &patches, IniFile &ini);
|
||||||
void LoadPatches(const char *gameID);
|
void LoadPatches(const char *gameID);
|
||||||
void ApplyFramePatches();
|
void ApplyFramePatches();
|
||||||
|
|
|
@ -434,12 +434,12 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
js.block_flags = 0;
|
js.block_flags = 0;
|
||||||
js.cancel = false;
|
js.cancel = false;
|
||||||
|
|
||||||
//Analyze the block, collect all instructions it is made of (including inlining,
|
// Analyze the block, collect all instructions it is made of (including inlining,
|
||||||
//if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
|
// if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
|
||||||
u32 nextPC = em_address;
|
u32 nextPC = em_address;
|
||||||
u32 merged_addresses[32];
|
u32 merged_addresses[32];
|
||||||
const int capacity_of_merged_addresses = sizeof(merged_addresses) / sizeof(merged_addresses[0]);
|
const int capacity_of_merged_addresses = sizeof(merged_addresses) / sizeof(merged_addresses[0]);
|
||||||
int size_of_merged_addresses;
|
int size_of_merged_addresses = 0;
|
||||||
if (!memory_exception)
|
if (!memory_exception)
|
||||||
{
|
{
|
||||||
// If there is a memory exception inside a block (broken_block==true), compile up to that instruction.
|
// If there is a memory exception inside a block (broken_block==true), compile up to that instruction.
|
||||||
|
@ -448,7 +448,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
|
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
|
||||||
|
|
||||||
const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr
|
const u8 *start = AlignCode4(); // TODO: Test if this or AlignCode16 make a difference from GetCodePtr
|
||||||
b->checkedEntry = start;
|
b->checkedEntry = start;
|
||||||
b->runCount = 0;
|
b->runCount = 0;
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
if (js.fpa.any)
|
if (js.fpa.any)
|
||||||
{
|
{
|
||||||
//This block uses FPU - needs to add FP exception bailout
|
// This block uses FPU - needs to add FP exception bailout
|
||||||
TEST(32, M(&PowerPC::ppcState.msr), Imm32(1 << 13)); //Test FP enabled bit
|
TEST(32, M(&PowerPC::ppcState.msr), Imm32(1 << 13)); //Test FP enabled bit
|
||||||
FixupBranch b1 = J_CC(CC_NZ);
|
FixupBranch b1 = J_CC(CC_NZ);
|
||||||
MOV(32, M(&PC), Imm32(js.blockStart));
|
MOV(32, M(&PC), Imm32(js.blockStart));
|
||||||
|
@ -492,8 +492,8 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
MOV(32, M(&PC), Imm32(js.blockStart));
|
MOV(32, M(&PC), Imm32(js.blockStart));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Start up the register allocators
|
// Start up the register allocators
|
||||||
//They use the information in gpa/fpa to preload commonly used registers.
|
// They use the information in gpa/fpa to preload commonly used registers.
|
||||||
gpr.Start(js.gpa);
|
gpr.Start(js.gpa);
|
||||||
fpr.Start(js.fpa);
|
fpr.Start(js.fpa);
|
||||||
|
|
||||||
|
|
|
@ -426,12 +426,12 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
js.curBlock = b;
|
js.curBlock = b;
|
||||||
js.cancel = false;
|
js.cancel = false;
|
||||||
|
|
||||||
//Analyze the block, collect all instructions it is made of (including inlining,
|
// Analyze the block, collect all instructions it is made of (including inlining,
|
||||||
//if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
|
// if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
|
||||||
b->exitAddress[0] = em_address;
|
b->exitAddress[0] = em_address;
|
||||||
u32 merged_addresses[32];
|
u32 merged_addresses[32];
|
||||||
const int capacity_of_merged_addresses = sizeof(merged_addresses) / sizeof(merged_addresses[0]);
|
const int capacity_of_merged_addresses = sizeof(merged_addresses) / sizeof(merged_addresses[0]);
|
||||||
int size_of_merged_addresses;
|
int size_of_merged_addresses = 0;
|
||||||
if (!memory_exception)
|
if (!memory_exception)
|
||||||
{
|
{
|
||||||
// If there is a memory exception inside a block (broken_block==true), compile up to that instruction.
|
// If there is a memory exception inside a block (broken_block==true), compile up to that instruction.
|
||||||
|
@ -439,7 +439,7 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
}
|
}
|
||||||
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
|
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
|
||||||
|
|
||||||
const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr
|
const u8 *start = AlignCode4(); // TODO: Test if this or AlignCode16 make a difference from GetCodePtr
|
||||||
b->checkedEntry = start;
|
b->checkedEntry = start;
|
||||||
b->runCount = 0;
|
b->runCount = 0;
|
||||||
|
|
||||||
|
@ -453,11 +453,11 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
b->normalEntry = normalEntry;
|
b->normalEntry = normalEntry;
|
||||||
|
|
||||||
if (ImHereDebug)
|
if (ImHereDebug)
|
||||||
ABI_CallFunction((void *)&ImHere); //Used to get a trace of the last few blocks before a crash, sometimes VERY useful
|
ABI_CallFunction((void *)&ImHere); // Used to get a trace of the last few blocks before a crash, sometimes VERY useful
|
||||||
|
|
||||||
if (js.fpa.any)
|
if (js.fpa.any)
|
||||||
{
|
{
|
||||||
//This block uses FPU - needs to add FP exception bailout
|
// This block uses FPU - needs to add FP exception bailout
|
||||||
TEST(32, M(&PowerPC::ppcState.msr), Imm32(1 << 13)); //Test FP enabled bit
|
TEST(32, M(&PowerPC::ppcState.msr), Imm32(1 << 13)); //Test FP enabled bit
|
||||||
FixupBranch b1 = J_CC(CC_NZ);
|
FixupBranch b1 = J_CC(CC_NZ);
|
||||||
MOV(32, M(&PC), Imm32(js.blockStart));
|
MOV(32, M(&PC), Imm32(js.blockStart));
|
||||||
|
|
Loading…
Reference in New Issue