mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
JitBase: Avoid System::GetInstance() and ppcState.
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
#include "Core/MemTools.h"
|
||||
#include "Core/PowerPC/JitCommon/JitBase.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
// include order is important
|
||||
#include <gtest/gtest.h> // NOLINT
|
||||
@ -25,6 +26,8 @@ enum
|
||||
class PageFaultFakeJit : public JitBase
|
||||
{
|
||||
public:
|
||||
explicit PageFaultFakeJit(Core::System& system) : JitBase(system) {}
|
||||
|
||||
// CPUCoreBase methods
|
||||
void Init() override {}
|
||||
void Shutdown() override {}
|
||||
@ -72,7 +75,7 @@ TEST(PageFault, PageFault)
|
||||
EXPECT_NE(data, nullptr);
|
||||
Common::WriteProtectMemory(data, PAGE_GRAN, false);
|
||||
|
||||
PageFaultFakeJit pfjit;
|
||||
PageFaultFakeJit pfjit(Core::System::GetInstance());
|
||||
JitInterface::SetJit(&pfjit);
|
||||
pfjit.m_data = data;
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "Core/PowerPC/Jit64/Jit.h"
|
||||
#include "Core/PowerPC/Jit64Common/Jit64AsmCommon.h"
|
||||
#include "Core/PowerPC/Jit64Common/Jit64PowerPCState.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "../TestValues.h"
|
||||
|
||||
@ -22,7 +23,7 @@ namespace
|
||||
class TestCommonAsmRoutines : public CommonAsmRoutines
|
||||
{
|
||||
public:
|
||||
TestCommonAsmRoutines() : CommonAsmRoutines(jit)
|
||||
explicit TestCommonAsmRoutines(Core::System& system) : CommonAsmRoutines(jit), jit(system)
|
||||
{
|
||||
using namespace Gen;
|
||||
|
||||
@ -51,7 +52,7 @@ public:
|
||||
|
||||
TEST(Jit64, ConvertDoubleToSingle)
|
||||
{
|
||||
TestCommonAsmRoutines routines;
|
||||
TestCommonAsmRoutines routines(Core::System::GetInstance());
|
||||
|
||||
for (const u64 input : double_test_values)
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "Core/PowerPC/Jit64/Jit.h"
|
||||
#include "Core/PowerPC/Jit64Common/Jit64AsmCommon.h"
|
||||
#include "Core/PowerPC/Jit64Common/Jit64PowerPCState.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "../TestValues.h"
|
||||
|
||||
@ -22,7 +23,7 @@ namespace
|
||||
class TestCommonAsmRoutines : public CommonAsmRoutines
|
||||
{
|
||||
public:
|
||||
TestCommonAsmRoutines() : CommonAsmRoutines(jit)
|
||||
explicit TestCommonAsmRoutines(Core::System& system) : CommonAsmRoutines(jit), jit(system)
|
||||
{
|
||||
using namespace Gen;
|
||||
|
||||
@ -58,7 +59,7 @@ public:
|
||||
|
||||
TEST(Jit64, Frsqrte)
|
||||
{
|
||||
TestCommonAsmRoutines routines;
|
||||
TestCommonAsmRoutines routines(Core::System::GetInstance());
|
||||
|
||||
UReg_FPSCR fpscr;
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "Common/FPURoundMode.h"
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "../TestValues.h"
|
||||
|
||||
@ -30,7 +31,7 @@ struct Pair
|
||||
class TestConversion : private JitArm64
|
||||
{
|
||||
public:
|
||||
TestConversion()
|
||||
explicit TestConversion(Core::System& system) : JitArm64(system)
|
||||
{
|
||||
const Common::ScopedJITPageWriteAndNoExecute enable_jit_page_writes;
|
||||
|
||||
@ -119,7 +120,7 @@ private:
|
||||
|
||||
TEST(JitArm64, ConvertDoubleToSingle)
|
||||
{
|
||||
TestConversion test;
|
||||
TestConversion test(Core::System::GetInstance());
|
||||
|
||||
for (const u64 input : double_test_values)
|
||||
{
|
||||
@ -154,7 +155,7 @@ TEST(JitArm64, ConvertDoubleToSingle)
|
||||
|
||||
TEST(JitArm64, ConvertSingleToDouble)
|
||||
{
|
||||
TestConversion test;
|
||||
TestConversion test(Core::System::GetInstance());
|
||||
|
||||
for (const u32 input : single_test_values)
|
||||
{
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "../TestValues.h"
|
||||
|
||||
@ -22,7 +23,7 @@ using namespace Arm64Gen;
|
||||
class TestFPRF : public JitArm64
|
||||
{
|
||||
public:
|
||||
TestFPRF()
|
||||
explicit TestFPRF(Core::System& system) : JitArm64(system)
|
||||
{
|
||||
const Common::ScopedJITPageWriteAndNoExecute enable_jit_page_writes;
|
||||
|
||||
@ -67,7 +68,7 @@ static u32 RunUpdateFPRF(const std::function<void()>& f)
|
||||
|
||||
TEST(JitArm64, FPRF)
|
||||
{
|
||||
TestFPRF test;
|
||||
TestFPRF test(Core::System::GetInstance());
|
||||
|
||||
for (const u64 double_input : double_test_values)
|
||||
{
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "../TestValues.h"
|
||||
|
||||
@ -21,7 +22,7 @@ using namespace Arm64Gen;
|
||||
class TestFres : public JitArm64
|
||||
{
|
||||
public:
|
||||
TestFres()
|
||||
explicit TestFres(Core::System& system) : JitArm64(system)
|
||||
{
|
||||
const Common::ScopedJITPageWriteAndNoExecute enable_jit_page_writes;
|
||||
|
||||
@ -50,7 +51,7 @@ public:
|
||||
|
||||
TEST(JitArm64, Fres)
|
||||
{
|
||||
TestFres test;
|
||||
TestFres test(Core::System::GetInstance());
|
||||
|
||||
for (const u64 ivalue : double_test_values)
|
||||
{
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
|
||||
#include "Core/PowerPC/JitArm64/Jit.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "../TestValues.h"
|
||||
|
||||
@ -21,7 +22,7 @@ using namespace Arm64Gen;
|
||||
class TestFrsqrte : public JitArm64
|
||||
{
|
||||
public:
|
||||
TestFrsqrte()
|
||||
explicit TestFrsqrte(Core::System& system) : JitArm64(system)
|
||||
{
|
||||
const Common::ScopedJITPageWriteAndNoExecute enable_jit_page_writes;
|
||||
|
||||
@ -50,7 +51,7 @@ public:
|
||||
|
||||
TEST(JitArm64, Frsqrte)
|
||||
{
|
||||
TestFrsqrte test;
|
||||
TestFrsqrte test(Core::System::GetInstance());
|
||||
|
||||
for (const u64 ivalue : double_test_values)
|
||||
{
|
||||
|
Reference in New Issue
Block a user