Check downcount in jit after a syscall.

This commit is contained in:
Unknown W. Brackets 2013-01-23 22:24:20 -08:00
parent b1bbbc44fc
commit c1757ee166
2 changed files with 11 additions and 0 deletions

View File

@ -115,6 +115,10 @@ void Jit::GenerateFixedCode()
dispatcherCheckCoreState = GetCodePtr();
// The result of slice decrementation should be in flags if somebody jumped here
// IMPORTANT - We jump on negative, not carry!!!
FixupBranch bailCoreState = B_CC(CC_MI);
ARMABI_MOVI2R(R0, (u32)&coreState);
LDR(R0, R0);
CMP(R0, 0);
@ -158,6 +162,7 @@ void Jit::GenerateFixedCode()
B(dispatcherNoCheck); // no point in special casing this
SetJumpTarget(bail);
SetJumpTarget(bailCoreState);
ARMABI_MOVI2R(R0, (u32)&coreState);
LDR(R0, R0);

View File

@ -81,11 +81,16 @@ void AsmRoutineManager::Generate(MIPSState *mips, MIPSComp::Jit *jit)
dispatcherCheckCoreState = GetCodePtr();
// The result of slice decrementation should be in flags if somebody jumped here
// IMPORTANT - We jump on negative, not carry!!!
FixupBranch bailCoreState = J_CC(CC_S, true);
CMP(32, M((void*)&coreState), Imm32(0));
FixupBranch badCoreState = J_CC(CC_NZ, true);
FixupBranch skipToRealDispatch2 = J(); //skip the sync and compare first time
dispatcher = GetCodePtr();
// The result of slice decrementation should be in flags if somebody jumped here
// IMPORTANT - We jump on negative, not carry!!!
FixupBranch bail = J_CC(CC_S, true);
@ -134,6 +139,7 @@ void AsmRoutineManager::Generate(MIPSState *mips, MIPSComp::Jit *jit)
JMP(dispatcherNoCheck); // Let's just dispatch again, we'll enter the block since we know it's there.
SetJumpTarget(bail);
SetJumpTarget(bailCoreState);
CMP(32, M((void*)&coreState), Imm32(0));
J_CC(CC_Z, outerLoop, true);