[Core/Debugger/FileLoaders/FileSystems/MIPS] Using reserve if possible

This commit is contained in:
Herman Semenov
2023-12-15 13:59:19 +03:00
parent 773bbbd648
commit b871e76d05
14 changed files with 20 additions and 3 deletions
+4 -2
View File
@@ -147,7 +147,7 @@ void X64JitBackend::CompIR_Breakpoint(IRInst inst) {
}
bool isWrite = MIPSAnalyst::IsOpMemoryWrite(checkedPC);
const auto memchecks = CBreakPoints::GetMemCheckRanges(isWrite);
const auto &memchecks = CBreakPoints::GetMemCheckRanges(isWrite);
// We can trivially skip if there are no checks for this type (i.e. read vs write.)
if (memchecks.empty())
break;
@@ -159,7 +159,8 @@ void X64JitBackend::CompIR_Breakpoint(IRInst inst) {
FlushAll();
std::vector<FixupBranch> hitChecks;
for (auto it : memchecks) {
hitChecks.reserve(memchecks.size());
for (const auto &it : memchecks) {
if (it.end != 0) {
CMP(32, R(SCRATCH1), Imm32(it.start - size));
FixupBranch skipNext = J_CC(CC_BE);
@@ -382,6 +383,7 @@ void X64JitBackend::CompIR_ValidateAddress(IRInst inst) {
AND(32, R(SCRATCH1), Imm32(0x3FFFFFFF));
std::vector<FixupBranch> validJumps;
validJumps.reserve(3);
FixupBranch unaligned;
if (alignment != 1) {