From 655dd1ca2f413f991cdf1dfab93eb511bd0dc924 Mon Sep 17 00:00:00 2001 From: SSimco <37044560+SSimco@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:22:39 +0300 Subject: [PATCH] Cleanup code --- src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.cpp b/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.cpp index 5a6e73c6..cf65253a 100644 --- a/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.cpp @@ -21,8 +21,6 @@ #include "BackendAArch64/BackendAArch64.h" #endif -std::vector jumpTableInitialized; - struct PPCInvalidationRange { MPTR startAddress; @@ -50,9 +48,6 @@ bool ppcRecompilerEnabled = false; // this function does never block and can fail if the recompiler lock cannot be acquired immediately void PPCRecompiler_visitAddressNoBlock(uint32 enterAddress) { - if (!jumpTableInitialized[enterAddress / 4]) - return; - // quick read-only check without lock if (ppcRecompilerInstanceData->ppcRecompilerDirectJumpTable[enterAddress / 4] != PPCRecompiler_leaveRecompilerCode_unvisited) return; @@ -111,9 +106,6 @@ void PPCRecompiler_attemptEnterWithoutRecompile(PPCInterpreter_t* hCPU, uint32 e cemu_assert_debug(hCPU->instructionPointer == enterAddress); if (ppcRecompilerEnabled == false) return; - if(!jumpTableInitialized[enterAddress / 4]) - return; - auto funcPtr = ppcRecompilerInstanceData->ppcRecompilerDirectJumpTable[enterAddress / 4]; if (funcPtr != PPCRecompiler_leaveRecompilerCode_unvisited && funcPtr != PPCRecompiler_leaveRecompilerCode_visited) { @@ -129,8 +121,6 @@ void PPCRecompiler_attemptEnter(PPCInterpreter_t* hCPU, uint32 enterAddress) return; if (hCPU->remainingCycles <= 0) return; - if(!jumpTableInitialized[enterAddress / 4]) - return; auto funcPtr = ppcRecompilerInstanceData->ppcRecompilerDirectJumpTable[enterAddress / 4]; if (funcPtr == PPCRecompiler_leaveRecompilerCode_unvisited) @@ -260,8 +250,6 @@ PPCRecFunction_t* PPCRecompiler_recompileFunction(PPCFunctionBoundaryTracker::PP entryPointsOut.emplace_back(ppcEnterOffset, x64Offset); } - cemuLog_log(LogType::Force, "[Recompiler] Successfully compiled {:08x} - {:08x} Segments: {} Entrypoints: {}", ppcRecFunc->ppcAddress, ppcRecFunc->ppcAddress + ppcRecFunc->ppcSize, ppcImlGenContext.segmentList2.size(), entryPointsOut.size()); - return ppcRecFunc; } @@ -508,7 +496,6 @@ void PPCRecompiler_reserveLookupTableBlock(uint32 offset) for(uint32 i=0; ippcRecompilerDirectJumpTable[offset/4+i] = PPCRecompiler_leaveRecompilerCode_unvisited; - jumpTableInitialized[offset / 4 + i] = true; } } @@ -687,7 +674,6 @@ void PPCRecompiler_init() MemMapper::FreeReservation(ppcRecompilerInstanceData, sizeof(PPCRecompilerInstanceData_t)); ppcRecompilerInstanceData = nullptr; } - jumpTableInitialized = std::vector(PPC_REC_ALIGN_TO_4MB(PPC_REC_CODE_AREA_SIZE / 4), false); debug_printf("Allocating %dMB for recompiler instance data...\n", (sint32)(sizeof(PPCRecompilerInstanceData_t) / 1024 / 1024)); ppcRecompilerInstanceData = (PPCRecompilerInstanceData_t*)MemMapper::ReserveMemory(nullptr, sizeof(PPCRecompilerInstanceData_t), MemMapper::PAGE_PERMISSION::P_RW); MemMapper::AllocateMemory(&(ppcRecompilerInstanceData->_x64XMM_xorNegateMaskBottom), sizeof(PPCRecompilerInstanceData_t) - offsetof(PPCRecompilerInstanceData_t, _x64XMM_xorNegateMaskBottom), MemMapper::PAGE_PERMISSION::P_RW, true); @@ -775,5 +761,4 @@ void PPCRecompiler_Shutdown() // mark as unmapped ppcRecompiler_reservedBlockMask[i] = false; } - jumpTableInitialized = {}; } \ No newline at end of file