mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 08:39:51 +00:00
jit-ir: Clear emuhacks on block destroy.
This commit is contained in:
parent
51bcb02921
commit
b74df87db0
@ -149,6 +149,9 @@ bool IRJit::ReplaceJalTo(u32 dest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IRBlockCache::Clear() {
|
void IRBlockCache::Clear() {
|
||||||
|
for (size_t i = 0; i < blocks_.size(); ++i) {
|
||||||
|
blocks_[i].Destroy(i);
|
||||||
|
}
|
||||||
blocks_.clear();
|
blocks_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,6 +165,17 @@ void IRBlock::Finalize(int number) {
|
|||||||
Memory::Write_Opcode_JIT(origAddr_, opcode);
|
Memory::Write_Opcode_JIT(origAddr_, opcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IRBlock::Destroy(int number) {
|
||||||
|
if (origAddr_) {
|
||||||
|
MIPSOpcode opcode = MIPSOpcode(MIPS_EMUHACK_OPCODE | number);
|
||||||
|
if (Memory::ReadUnchecked_U32(origAddr_) == opcode.encoding)
|
||||||
|
Memory::Write_Opcode_JIT(origAddr_, origFirstOpcode_);
|
||||||
|
|
||||||
|
// Let's mark this invalid so we don't try to clear it again.
|
||||||
|
origAddr_ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MIPSOpcode IRJit::GetOriginalOp(MIPSOpcode op) {
|
MIPSOpcode IRJit::GetOriginalOp(MIPSOpcode op) {
|
||||||
IRBlock *b = blocks_.GetBlock(op.encoding & 0xFFFFFF);
|
IRBlock *b = blocks_.GetBlock(op.encoding & 0xFFFFFF);
|
||||||
return b->GetOriginalFirstOp();
|
return b->GetOriginalFirstOp();
|
||||||
|
@ -99,6 +99,7 @@ public:
|
|||||||
MIPSOpcode GetOriginalFirstOp() const { return origFirstOpcode_; }
|
MIPSOpcode GetOriginalFirstOp() const { return origFirstOpcode_; }
|
||||||
|
|
||||||
void Finalize(int number);
|
void Finalize(int number);
|
||||||
|
void Destroy(int number);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IRInst *instr_;
|
IRInst *instr_;
|
||||||
|
Loading…
Reference in New Issue
Block a user