Permalink
Browse files

Can't call functions through known-nil pointers, even if they don't t…

…ouch local data - LLVM's optimizer might have done something stupid.
  • Loading branch information...
hrydgard committed Nov 30, 2017
1 parent b0c42f7 commit 0207739d76b475ae295af49eca42fe351cd387c5
@@ -106,21 +106,6 @@ void ArmJit::DoState(PointerWrap &p)
}
}
// This is here so the savestate matches between jit and non-jit.
void ArmJit::DoDummyState(PointerWrap &p)
{
auto s = p.Section("Jit", 1, 2);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
if (s >= 2) {
dummy = true;
p.Do(dummy);
}
}
void ArmJit::FlushAll()
{
gpr.FlushAll();
@@ -39,7 +39,6 @@ class ArmJit : public ArmGen::ARMXCodeBlock, public JitInterface, public MIPSFro
virtual ~ArmJit();
void DoState(PointerWrap &p) override;
void DoDummyState(PointerWrap &p) override;
const JitOptions &GetJitOptions() { return jo; }
@@ -98,20 +98,6 @@ void Arm64Jit::DoState(PointerWrap &p) {
}
}
// This is here so the savestate matches between jit and non-jit.
void Arm64Jit::DoDummyState(PointerWrap &p) {
auto s = p.Section("Jit", 1, 2);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
if (s >= 2) {
dummy = true;
p.Do(dummy);
}
}
void Arm64Jit::FlushAll()
{
gpr.FlushAll();
@@ -39,7 +39,6 @@ class Arm64Jit : public Arm64Gen::ARM64CodeBlock, public JitInterface, public MI
virtual ~Arm64Jit();
void DoState(PointerWrap &p) override;
void DoDummyState(PointerWrap &p) override;
const JitOptions &GetJitOptions() { return jo; }
@@ -50,20 +50,6 @@ void IRJit::DoState(PointerWrap &p) {
frontend_.DoState(p);
}
// This is here so the savestate matches between jit and non-jit.
void IRJit::DoDummyState(PointerWrap &p) {
auto s = p.Section("Jit", 1, 2);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
if (s >= 2) {
dummy = true;
p.Do(dummy);
}
}
void IRJit::ClearCache() {
ILOG("IRJit: Clearing the cache!");
blocks_.Clear();
@@ -127,7 +127,6 @@ class IRJit : public JitInterface {
virtual ~IRJit();
void DoState(PointerWrap &p) override;
void DoDummyState(PointerWrap &p) override;
const JitOptions &GetJitOptions() { return jo; }
@@ -21,6 +21,8 @@
#include "ext/udis86/udis86.h"
#include "Common/StringUtils.h"
#include "Common/ChunkFile.h"
#include "Core/Util/DisArm64.h"
#include "Core/Config.h"
@@ -46,6 +48,20 @@ namespace MIPSComp {
jit->Compile(currentMIPS->pc);
}
void DoDummyJitState(PointerWrap &p) {
// This is here so the savestate matches between jit and non-jit.
auto s = p.Section("Jit", 1, 2);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
if (s >= 2) {
dummy = true;
p.Do(dummy);
}
}
JitInterface *CreateNativeJit(MIPSState *mips) {
#if PPSSPP_ARCH(ARM)
return new MIPSComp::ArmJit(mips);
@@ -125,7 +125,6 @@ namespace MIPSComp {
virtual JitBlockCache *GetBlockCache() = 0;
virtual void InvalidateCacheAt(u32 em_address, int length = 4) = 0;
virtual void DoState(PointerWrap &p) = 0;
virtual void DoDummyState(PointerWrap &p) = 0;
virtual void RunLoopUntil(u64 globalticks) = 0;
virtual void Compile(u32 em_address) = 0;
virtual void ClearCache() = 0;
@@ -147,5 +146,7 @@ namespace MIPSComp {
extern JitInterface *jit;
void DoDummyJitState(PointerWrap &p);
JitInterface *CreateNativeJit(MIPSState *mips);
}
@@ -262,7 +262,7 @@ void MIPSState::DoState(PointerWrap &p) {
if (MIPSComp::jit)
MIPSComp::jit->DoState(p);
else
MIPSComp::jit->DoDummyState(p);
MIPSComp::DoDummyJitState(p);
p.DoArray(r, sizeof(r) / sizeof(r[0]));
p.DoArray(f, sizeof(f) / sizeof(f[0]));
@@ -66,21 +66,6 @@ void MipsJit::DoState(PointerWrap &p)
}
}
// This is here so the savestate matches between jit and non-jit.
void MipsJit::DoDummyState(PointerWrap &p)
{
auto s = p.Section("Jit", 1, 2);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
if (s >= 2) {
dummy = true;
p.Do(dummy);
}
}
void MipsJit::FlushAll()
{
//gpr.FlushAll();
@@ -38,7 +38,6 @@ class MipsJit : public MIPSGen::MIPSCodeBlock, public JitInterface, public MIPSF
MipsJit(MIPSState *mips);
void DoState(PointerWrap &p) override;
void DoDummyState(PointerWrap &p) override;
// Compiled ops should ignore delay slots
// the compiler will take care of them by itself
@@ -142,21 +142,6 @@ void Jit::DoState(PointerWrap &p) {
CBreakPoints::SetSkipFirst(0);
}
// This is here so the savestate matches between jit and non-jit.
void Jit::DoDummyState(PointerWrap &p) {
auto s = p.Section("Jit", 1, 2);
if (!s)
return;
bool dummy = false;
p.Do(dummy);
if (s >= 2) {
dummy = true;
p.Do(dummy);
}
}
void Jit::GetStateAndFlushAll(RegCacheState &state) {
gpr.GetState(state.gpr);
fpr.GetState(state.fpr);
@@ -52,7 +52,6 @@ class Jit : public Gen::XCodeBlock, public JitInterface, public MIPSFrontendInte
const JitOptions &GetJitOptions() { return jo; }
void DoState(PointerWrap &p) override;
void DoDummyState(PointerWrap &p) override;
// Compiled ops should ignore delay slots
// the compiler will take care of them by itself

0 comments on commit 0207739

Please sign in to comment.