Merge pull request #1218 from hthh/trampolinecaching

JIT: reuse trampolines when possible
This commit is contained in:
skidau
2014-10-07 13:26:23 +11:00
4 changed files with 100 additions and 11 deletions

View File

@ -223,3 +223,19 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo *info)
info->instructionSize = (int)(codePtr - startCodePtr);
return true;
}
bool InstructionInfo::operator==(const InstructionInfo &other) const
{
return operandSize == other.operandSize &&
instructionSize == other.instructionSize &&
regOperandReg == other.regOperandReg &&
otherReg == other.otherReg &&
scaledReg == other.scaledReg &&
zeroExtend == other.zeroExtend &&
signExtend == other.signExtend &&
hasImmediate == other.hasImmediate &&
isMemoryWrite == other.isMemoryWrite &&
byteSwap == other.byteSwap &&
immediate == other.immediate &&
displacement == other.displacement;
}

View File

@ -20,6 +20,8 @@ struct InstructionInfo
bool byteSwap;
u64 immediate;
s32 displacement;
bool operator==(const InstructionInfo &other) const;
};
struct ModRM