From 8bf2cf064118107f5bfe14c3ff5c4b05b02c6130 Mon Sep 17 00:00:00 2001 From: Fiora Date: Wed, 8 Oct 2014 19:02:02 -0700 Subject: [PATCH] Debug: fix disable block linking option Previously it did the opposite of what it was supposed to; when checked, it'd turn block linking on, and when unchecked, it'd turn it off. Also update JITIL's block linking disabling in debug mode to match the behavior of the regular JIT. --- Source/Core/Core/CoreParameter.cpp | 2 +- Source/Core/Core/CoreParameter.h | 2 +- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 4 ++-- Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp | 19 ++++--------------- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 6 +++--- Source/Core/DolphinWX/Debugger/CodeWindow.h | 2 +- Source/Core/DolphinWX/Globals.h | 2 +- Source/Core/DolphinWX/Main.cpp | 2 +- 8 files changed, 14 insertions(+), 25 deletions(-) diff --git a/Source/Core/Core/CoreParameter.cpp b/Source/Core/Core/CoreParameter.cpp index ab68a12a78..4163a33487 100644 --- a/Source/Core/Core/CoreParameter.cpp +++ b/Source/Core/Core/CoreParameter.cpp @@ -23,7 +23,7 @@ SCoreStartupParameter::SCoreStartupParameter() : bEnableDebugging(false), bAutomaticStart(false), bBootToPause(false), - bJITNoBlockCache(false), bJITBlockLinking(true), + bJITNoBlockCache(false), bJITNoBlockLinking(true), bJITOff(false), bJITLoadStoreOff(false), bJITLoadStorelXzOff(false), bJITLoadStorelwzOff(false), bJITLoadStorelbzxOff(false), diff --git a/Source/Core/Core/CoreParameter.h b/Source/Core/Core/CoreParameter.h index 898c949714..77d6a43c32 100644 --- a/Source/Core/Core/CoreParameter.h +++ b/Source/Core/Core/CoreParameter.h @@ -123,7 +123,7 @@ struct SCoreStartupParameter int iCPUCore; // JIT (shared between JIT and JITIL) - bool bJITNoBlockCache, bJITBlockLinking; + bool bJITNoBlockCache, bJITNoBlockLinking; bool bJITOff; bool bJITLoadStoreOff, bJITLoadStorelXzOff, bJITLoadStorelwzOff, bJITLoadStorelbzxOff; bool bJITLoadStoreFloatingOff; diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index e4bd5b6174..10ad1ee4c1 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -175,8 +175,8 @@ void Jit64::Init() { jo.optimizeStack = true; jo.enableBlocklink = true; - if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bJITBlockLinking || - SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockLinking || + SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU) { // TODO: support block linking with MMU jo.enableBlocklink = false; diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp index 145be0d064..5a82a796e2 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp @@ -244,23 +244,12 @@ namespace JitILProfiler void JitIL::Init() { jo.optimizeStack = true; - - if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging) + jo.enableBlocklink = true; + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockLinking || + SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU) { + // TODO: support block linking with MMU jo.enableBlocklink = false; - SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle = false; - } - else - { - if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bJITBlockLinking) - { - jo.enableBlocklink = false; - } - else - { - // Speed boost, but not 100% safe - jo.enableBlocklink = !SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU; - } } jo.fpAccurateFcmp = false; diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 5abbfc6bc8..4af423e134 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -397,7 +397,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); pCoreMenu->AppendSeparator(); - pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"), + pCoreMenu->Append(IDM_JITNOBLOCKLINKING, _("&JIT Block Linking off"), _("Provide safer execution by not linking the JIT blocks."), wxITEM_CHECK); @@ -596,9 +596,9 @@ bool CCodeWindow::JITNoBlockCache() return GetMenuBar()->IsChecked(IDM_JITNOBLOCKCACHE); } -bool CCodeWindow::JITBlockLinking() +bool CCodeWindow::JITNoBlockLinking() { - return GetMenuBar()->IsChecked(IDM_JITBLOCKLINKING); + return GetMenuBar()->IsChecked(IDM_JITNOBLOCKLINKING); } // Toolbar diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.h b/Source/Core/DolphinWX/Debugger/CodeWindow.h index 9ca428a37d..2b4dc25155 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.h +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.h @@ -59,7 +59,7 @@ class CCodeWindow bool BootToPause(); bool AutomaticStart(); bool JITNoBlockCache(); - bool JITBlockLinking(); + bool JITNoBlockLinking(); bool JumpToAddress(u32 address); void Update() override; diff --git a/Source/Core/DolphinWX/Globals.h b/Source/Core/DolphinWX/Globals.h index 3e331ddec1..324f960f73 100644 --- a/Source/Core/DolphinWX/Globals.h +++ b/Source/Core/DolphinWX/Globals.h @@ -191,7 +191,7 @@ enum // CPU Mode IDM_INTERPRETER, IDM_AUTOMATICSTART, IDM_BOOTTOPAUSE, - IDM_JITNOBLOCKCACHE, IDM_JITBLOCKLINKING, // JIT + IDM_JITNOBLOCKCACHE, IDM_JITNOBLOCKLINKING, // JIT IDM_JITOFF, IDM_JITLSOFF, IDM_JITLSLXZOFF, IDM_JITLSLWZOFF, IDM_JITLSLBZXOFF, IDM_JITLSPOFF, IDM_JITLSFOFF, diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 180a9cb5bb..51aa7104af 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -559,7 +559,7 @@ void Host_SetStartupDebuggingParameters() StartUp.bBootToPause = main_frame->g_pCodeWindow->BootToPause(); StartUp.bAutomaticStart = main_frame->g_pCodeWindow->AutomaticStart(); StartUp.bJITNoBlockCache = main_frame->g_pCodeWindow->JITNoBlockCache(); - StartUp.bJITBlockLinking = main_frame->g_pCodeWindow->JITBlockLinking(); + StartUp.bJITNoBlockLinking = main_frame->g_pCodeWindow->JITNoBlockLinking(); } else {