mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Jit: Add missing instruction address check from ARM jits
This commit is contained in:
@@ -100,8 +100,7 @@ static u32 JitMemCheck(u32 pc) {
|
||||
return coreState == CORE_RUNNING_CPU || coreState == CORE_NEXTFRAME ? 0 : 1;
|
||||
}
|
||||
|
||||
namespace MIPSComp
|
||||
{
|
||||
namespace MIPSComp {
|
||||
using namespace ArmGen;
|
||||
using namespace ArmJitConstants;
|
||||
|
||||
@@ -244,7 +243,10 @@ void ArmJit::CompileDelaySlot(int flags) {
|
||||
void ArmJit::Compile(u32 em_address) {
|
||||
PROFILE_THIS_SCOPE("jitc");
|
||||
|
||||
// INFO_LOG(Log::JIT, "Compiling at %08x", em_address);
|
||||
if (!Memory::IsValid4AlignedAddress(em_address)) {
|
||||
Core_ExecException(em_address, em_address, ExecExceptionType::JUMP);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) {
|
||||
ClearCache();
|
||||
|
||||
@@ -242,6 +242,12 @@ void Arm64Jit::CompileDelaySlot(int flags) {
|
||||
|
||||
void Arm64Jit::Compile(u32 em_address) {
|
||||
PROFILE_THIS_SCOPE("jitc");
|
||||
|
||||
if (!Memory::IsValid4AlignedAddress(em_address)) {
|
||||
Core_ExecException(em_address, em_address, ExecExceptionType::JUMP);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) {
|
||||
INFO_LOG(Log::JIT, "Space left: %d", (int)GetSpaceLeft());
|
||||
ClearCache();
|
||||
@@ -249,7 +255,6 @@ void Arm64Jit::Compile(u32 em_address) {
|
||||
|
||||
BeginWrite(JitBlockCache::MAX_BLOCK_INSTRUCTIONS * 16);
|
||||
|
||||
|
||||
// To debug really wacky JIT issues, it can be a good idea to bisect the block number,
|
||||
// and disable parts of the jit using jo.disableFlags for certain ranges of blocks.
|
||||
|
||||
|
||||
@@ -300,15 +300,16 @@ void Jit::EatInstruction(MIPSOpcode op) {
|
||||
|
||||
void Jit::Compile(u32 em_address) {
|
||||
PROFILE_THIS_SCOPE("jitc");
|
||||
if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) {
|
||||
ClearCache();
|
||||
}
|
||||
|
||||
if (!Memory::IsValidAddress(em_address) || (em_address & 3) != 0) {
|
||||
if (!Memory::IsValid4AlignedAddress(em_address)) {
|
||||
Core_ExecException(em_address, em_address, ExecExceptionType::JUMP);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) {
|
||||
ClearCache();
|
||||
}
|
||||
|
||||
// Sometimes we compile fairly large blocks, although it's uncommon.
|
||||
BeginWrite(JitBlockCache::MAX_BLOCK_INSTRUCTIONS * 16);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user