JitArm64: Fastmem: fixup map & lookup

This commit is contained in:
degasus 2015-08-14 15:38:50 +02:00 committed by Ryan Houdek
parent bb39ba1f3a
commit 878f919f63
3 changed files with 17 additions and 5 deletions

View File

@ -155,6 +155,8 @@ public:
const Ref operator[](size_t bit) const { return (*const_cast<BitSet*>(this))[bit]; }
bool operator==(BitSet other) const { return m_val == other.m_val; }
bool operator!=(BitSet other) const { return m_val != other.m_val; }
bool operator<(BitSet other) const { return m_val < other.m_val; }
bool operator>(BitSet other) const { return m_val > other.m_val; }
BitSet operator|(BitSet other) const { return BitSet(m_val | other.m_val); }
BitSet operator&(BitSet other) const { return BitSet(m_val & other.m_val); }
BitSet operator^(BitSet other) const { return BitSet(m_val ^ other.m_val); }

View File

@ -185,11 +185,18 @@ private:
u32 flags;
bool operator< (const SlowmemHandler& rhs) const
{
return !(dest_reg == rhs.dest_reg &&
addr_reg == rhs.addr_reg &&
gprs == rhs.gprs &&
fprs == rhs.fprs &&
flags == rhs.flags);
if (dest_reg < rhs.dest_reg) return true;
if (dest_reg > rhs.dest_reg) return false;
if (addr_reg < rhs.addr_reg) return true;
if (addr_reg > rhs.addr_reg) return false;
if (gprs < rhs.gprs) return true;
if (gprs > rhs.gprs) return false;
if (fprs < rhs.fprs) return true;
if (fprs > rhs.fprs) return false;
if (flags < rhs.flags) return true;
if (flags > rhs.flags) return false;
return false;
}
};

View File

@ -374,6 +374,9 @@ bool JitArm64::HandleFault(uintptr_t access_address, SContext* ctx)
std::map<const u8*, std::pair<SlowmemHandler, const u8*>>::iterator slow_handler_iter = m_fault_to_handler.find((const u8*)ctx->CTX_PC);
if (slow_handler_iter == m_fault_to_handler.end())
return false;
BackPatchInfo& info = m_backpatch_info[flags];
ARM64XEmitter emitter((u8*)(ctx->CTX_PC - info.m_fastmem_trouble_inst_offset * 4));
u64 new_pc = (u64)emitter.GetCodePtr();