diff --git a/Core/MIPS/IR/IRCompBranch.cpp b/Core/MIPS/IR/IRCompBranch.cpp index 4827d1a92a..c3127ba2d8 100644 --- a/Core/MIPS/IR/IRCompBranch.cpp +++ b/Core/MIPS/IR/IRCompBranch.cpp @@ -359,7 +359,6 @@ void IRFrontend::Comp_Jump(MIPSOpcode op) { // Might be a stubbed address or something? if (space_ ? !space_->IsValidAddress(targetAddr) : !Memory::IsValidAddress(targetAddr)) { - // If preloading, flush - this block will likely be fixed later. // Usually code that never runs, like a call through an import that isn't linked yet. DEBUG_LOG(Log::JIT, "Compiled jump to %08x (probably benign)", targetAddr); // TODO: Mark this block dirty or something? May be indication it will be changed by imports. diff --git a/Core/MIPS/IR/IRJit.cpp b/Core/MIPS/IR/IRJit.cpp index ac220b20d2..97f7b04232 100644 --- a/Core/MIPS/IR/IRJit.cpp +++ b/Core/MIPS/IR/IRJit.cpp @@ -318,7 +318,6 @@ void IRJit::TimedClearCache() { g_jitCompileTimes.clears++; } -// WARNING! This can be called from IRInterpret / the JIT, through the function preload stuff! IRJit::CompileResult IRJit::CompileBlock(u32 em_address, std::vector &instructions, u32 &mipsBytes) { _dbg_assert_(compilerEnabled_); @@ -585,7 +584,6 @@ std::vector JitBlockTable::FindInvalidatedBlockNumbers(u32 address, u32 len } void JitBlockTable::FinalizeBlock(int blockIndex) { - // TODO: What's different about preload blocks? JitBlock &block = blocks_[blockIndex]; block.Finalize(*space_); @@ -627,24 +625,6 @@ u32 JitBlockTable::AddressToPage(u32 addr) const { return (addr & 0x3FFFFFFF) >> 10; } -int JitBlockTable::FindPreloadBlock(u32 em_address) { - u32 page = AddressToPage(em_address); - auto iter = byPage_.find(page); - if (iter == byPage_.end()) - return -1; - - const std::vector &blocksInPage = iter->second; - for (int i : blocksInPage) { - if (blocks_[i].GetOriginalStart() == em_address) { - if (blocks_[i].HashMatches()) { - return i; - } - } - } - - return -1; -} - int JitBlockTable::GetBlockNumberFromStartAddress(u32 em_address) const { u32 page = AddressToPage(em_address); @@ -666,8 +646,7 @@ int JitBlockTable::GetBlockNumberFromStartAddress(u32 em_address) const { } void JitBlock::Finalize(const Memory::AddressSpace &space) { - // Check it wasn't invalidated, in case this is after preload. - // TODO: Allow reusing blocks when the code matches hash_ again, instead. + // Check it wasn't invalidated. if (origAddr_ && space.IsValid4AlignedAddress(origAddr_)) { origFirstOpcode_ = space.IsMediaEngine() ? MIPSOpcode(space.ReadUnchecked_U32(origAddr_)) : Memory::ReadUnchecked_Instruction(origAddr_); _dbg_assert_(entry_ != 0); diff --git a/Core/MIPS/IR/IRJit.h b/Core/MIPS/IR/IRJit.h index 562e08bb82..f92b3e940f 100644 --- a/Core/MIPS/IR/IRJit.h +++ b/Core/MIPS/IR/IRJit.h @@ -65,9 +65,6 @@ public: void UpdateHash() { hash_ = CalculateHash(); } - bool HashMatches() const { - return origAddr_ && hash_ == CalculateHash(); - } bool OverlapsRange(u32 addr, u32 size) const; void GetRange(u32 *start, u32 *size) const { @@ -144,7 +141,6 @@ public: } } - int FindPreloadBlock(u32 em_address); int GetBlockNumberFromStartAddress(u32 em_address) const;