Minor fixes, mostly comments

This commit is contained in:
Henrik Rydgard 2015-10-10 10:03:34 +02:00
parent b2b5f3424f
commit d628b9b57b
6 changed files with 22 additions and 18 deletions

View File

@ -74,9 +74,7 @@ using namespace ArmJitConstants;
void ArmJit::GenerateFixedCode() {
const u8 *start = GetCodePtr();
// LR == SCRATCHREG2.... Maybe we could find some other register to use to avoid having to
// push LR?
// LR == SCRATCHREG2 on ARM32 so it needs to be pushed.
restoreRoundingMode = AlignCode16(); {
PUSH(1, R_LR);
VMRS(SCRATCHREG2);
@ -86,7 +84,7 @@ void ArmJit::GenerateFixedCode() {
POP(1, R_PC);
}
// Must preserve SCRATCHREG1 (R0)
// Must preserve SCRATCHREG1 (R0), destroys SCRATCHREG2 (LR)
applyRoundingMode = AlignCode16(); {
PUSH(2, SCRATCHREG1, R_LR);
LDR(SCRATCHREG2, CTXREG, offsetof(MIPSState, fcr31));
@ -125,7 +123,7 @@ void ArmJit::GenerateFixedCode() {
POP(2, SCRATCHREG1, R_PC);
}
// Must preserve SCRATCHREG1 (R0)
// Must preserve SCRATCHREG1 (R0), destroys SCRATCHREG2 (LR)
updateRoundingMode = AlignCode16(); {
PUSH(2, SCRATCHREG1, R_LR);
LDR(SCRATCHREG2, CTXREG, offsetof(MIPSState, fcr31));

View File

@ -387,7 +387,7 @@ void ArmJit::AddContinuedBlock(u32 dest)
bool ArmJit::DescribeCodePtr(const u8 *ptr, std::string &name)
{
// TODO: Not used by anything yet.
// TODO: Not used by anything yet (except the modified VerySleepy on Windows)
return false;
}

View File

@ -350,7 +350,7 @@ void Arm64Jit::AddContinuedBlock(u32 dest) {
}
bool Arm64Jit::DescribeCodePtr(const u8 *ptr, std::string &name) {
// TODO: Not used by anything yet.
// TODO: Not used by anything yet (except the modified VerySleepy on Windows)
return false;
}

View File

@ -215,6 +215,8 @@ void Jit::GenerateFixedCode(JitOptions &jo) {
RestoreRoundingMode(true);
ABI_PopAllCalleeSavedRegsAndAdjustStack();
RET();
endOfPregeneratedCode = GetCodePtr();
}
} // namespace

View File

@ -444,9 +444,9 @@ bool Jit::DescribeCodePtr(const u8 *ptr, std::string &name) {
u32 jitAddr = blocks.GetAddressFromBlockPtr(ptr);
// Returns 0 when it's valid, but unknown.
if (jitAddr == 0)
if (jitAddr == 0) {
name = "UnknownOrDeletedBlock";
else if (jitAddr != (u32)-1) {
} else if (jitAddr != (u32)-1) {
char temp[1024];
const std::string label = symbolMap.GetDescription(jitAddr);
if (!label.empty())
@ -454,18 +454,20 @@ bool Jit::DescribeCodePtr(const u8 *ptr, std::string &name) {
else
snprintf(temp, sizeof(temp), "%08x", jitAddr);
name = temp;
}
else if (IsInSpace(ptr))
name = "RunLoopUntil";
else if (thunks.IsInSpace(ptr))
} else if (IsInSpace(ptr)) {
if (ptr < endOfPregeneratedCode) {
name = "PreGenCode";
} else {
name = "Unknown";
}
} else if (thunks.IsInSpace(ptr)) {
name = "Thunk";
else if (safeMemFuncs.IsInSpace(ptr))
} else if (safeMemFuncs.IsInSpace(ptr)) {
name = "JitSafeMem";
else if (IsInSpace(ptr))
name = "Unknown";
// Not anywhere in jit, then.
else
} else {
// Not anywhere in jit, then.
return false;
}
// If we got here, one of the above cases matched.
return true;

View File

@ -318,6 +318,8 @@ private:
const u8 *applyRoundingMode;
const u8 *updateRoundingMode;
const u8 *endOfPregeneratedCode;
friend class JitSafeMem;
friend class JitSafeMemFuncs;
};