mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-31 18:53:03 +00:00
Output less code per memcheck.
Somehow this also fixed a bug with memchecks that didn't hit, but I don't know why. Reverting and making them far jumps doesn't help.... strange. Anyway, this should be less code which is good.
This commit is contained in:
parent
c64f6c3f39
commit
5271f36d78
@ -712,6 +712,10 @@ void JitMemCheck(u32 addr, int size, int isWrite)
|
|||||||
if (CBreakPoints::CheckSkipFirst() == currentMIPS->pc)
|
if (CBreakPoints::CheckSkipFirst() == currentMIPS->pc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Did we already hit one?
|
||||||
|
if (coreState != CORE_RUNNING)
|
||||||
|
return;
|
||||||
|
|
||||||
MemCheck *check = CBreakPoints::GetMemCheck(addr, size);
|
MemCheck *check = CBreakPoints::GetMemCheck(addr, size);
|
||||||
if (check)
|
if (check)
|
||||||
check->Action(addr, isWrite == 1, size, currentMIPS->pc);
|
check->Action(addr, isWrite == 1, size, currentMIPS->pc);
|
||||||
@ -738,7 +742,8 @@ void Jit::JitSafeMem::MemCheckImm(ReadType type)
|
|||||||
|
|
||||||
void Jit::JitSafeMem::MemCheckAsm(ReadType type)
|
void Jit::JitSafeMem::MemCheckAsm(ReadType type)
|
||||||
{
|
{
|
||||||
auto memchecks = CBreakPoints::GetMemChecks();
|
const auto memchecks = CBreakPoints::GetMemChecks();
|
||||||
|
bool possible = false;
|
||||||
for (auto it = memchecks.begin(), end = memchecks.end(); it != end; ++it)
|
for (auto it = memchecks.begin(), end = memchecks.end(); it != end; ++it)
|
||||||
{
|
{
|
||||||
if (!(it->cond & MEMCHECK_READ) && type == MEM_READ)
|
if (!(it->cond & MEMCHECK_READ) && type == MEM_READ)
|
||||||
@ -746,6 +751,8 @@ void Jit::JitSafeMem::MemCheckAsm(ReadType type)
|
|||||||
if (!(it->cond & MEMCHECK_WRITE) && type == MEM_WRITE)
|
if (!(it->cond & MEMCHECK_WRITE) && type == MEM_WRITE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
possible = true;
|
||||||
|
|
||||||
FixupBranch skipNext, skipNextRange;
|
FixupBranch skipNext, skipNextRange;
|
||||||
if (it->end != 0)
|
if (it->end != 0)
|
||||||
{
|
{
|
||||||
@ -766,14 +773,17 @@ void Jit::JitSafeMem::MemCheckAsm(ReadType type)
|
|||||||
jit_->ABI_CallFunctionACC(jit_->thunks.ProtectFunction((void *)&JitMemCheck, 3), R(xaddr_), size_, type == MEM_WRITE ? 1 : 0);
|
jit_->ABI_CallFunctionACC(jit_->thunks.ProtectFunction((void *)&JitMemCheck, 3), R(xaddr_), size_, type == MEM_WRITE ? 1 : 0);
|
||||||
jit_->POP(xaddr_);
|
jit_->POP(xaddr_);
|
||||||
|
|
||||||
jit_->CMP(32, M((void*)&coreState), Imm32(0));
|
|
||||||
skipChecks_.push_back(jit_->J_CC(CC_NE, true));
|
|
||||||
jit_->js.afterOp |= JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE;
|
|
||||||
|
|
||||||
jit_->SetJumpTarget(skipNext);
|
jit_->SetJumpTarget(skipNext);
|
||||||
if (it->end != 0)
|
if (it->end != 0)
|
||||||
jit_->SetJumpTarget(skipNextRange);
|
jit_->SetJumpTarget(skipNextRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (possible)
|
||||||
|
{
|
||||||
|
jit_->CMP(32, M((void*)&coreState), Imm32(0));
|
||||||
|
skipChecks_.push_back(jit_->J_CC(CC_NE, true));
|
||||||
|
jit_->js.afterOp |= JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit::Comp_DoNothing(u32 op) { }
|
void Jit::Comp_DoNothing(u32 op) { }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user