AOTIR: Stop passing a mutex around. It's already guarded

This commit is contained in:
Ryan Houdek committed 2023-05-11 03:56:33 -07:00
1 parent ed69eb9f6f
commit 2fc529d5b7
3 files changed
+5 -9

No files matched your search

+2 -6
View File
@@ -3,7 +3,6 @@
#include <shared_mutex>
#include <FEXCore/IR/IR.h>
#include <FEXHeaderUtils/ScopedSignalMask.h>
namespace FEXCore {
class CodeLoader;
@@ -52,9 +51,8 @@ namespace FEXCore::HLE {
class SourcecodeResolver;
struct AOTIRCacheEntryLookupResult {
AOTIRCacheEntryLookupResult(FEXCore::IR::AOTIRCacheEntry *Entry, uintptr_t VAFileStart, FHU::ScopedSignalMaskWithSharedLock &&lk)
: Entry(Entry), VAFileStart(VAFileStart), lk(std::move(lk))
{
AOTIRCacheEntryLookupResult(FEXCore::IR::AOTIRCacheEntry *Entry, uintptr_t VAFileStart)
: Entry(Entry), VAFileStart(VAFileStart) {
}
@@ -64,8 +62,6 @@ namespace FEXCore::HLE {
uintptr_t VAFileStart;
friend class SyscallHandler;
protected:
FHU::ScopedSignalMaskWithSharedLock lk;
};
class SyscallHandler {
+1 -2
View File
@@ -158,9 +158,8 @@ class DummySyscallHandler: public FEXCore::HLE::SyscallHandler, public FEXCore::
}
// These are no-ops implementations of the SyscallHandler API
std::shared_mutex StubMutex;
FEXCore::HLE::AOTIRCacheEntryLookupResult LookupAOTIRCacheEntry(uint64_t GuestAddr) override {
return {0, 0, FHU::ScopedSignalMaskWithSharedLock {StubMutex}};
return {0, 0};
}
};
@@ -15,6 +15,7 @@ $end_info$
#include "LinuxSyscalls/Syscalls.h"
#include <FEXHeaderUtils/TypeDefines.h>
#include <FEXHeaderUtils/ScopedSignalMask.h>
#include <FEXCore/Debug/InternalThreadState.h>
#include <FEXCore/Utils/LogManager.h>
#include <FEXCore/Utils/MathUtils.h>
@@ -164,7 +165,7 @@ void SyscallHandler::MarkGuestExecutableRange(uint64_t Start, uint64_t Length) {
// Used for AOT
FEXCore::HLE::AOTIRCacheEntryLookupResult SyscallHandler::LookupAOTIRCacheEntry(uint64_t GuestAddr) {
FHU::ScopedSignalMaskWithSharedLock lk(_SyscallHandler->VMATracking.Mutex);
auto rv = FEXCore::HLE::AOTIRCacheEntryLookupResult(nullptr, 0, std::move(lk));
auto rv = FEXCore::HLE::AOTIRCacheEntryLookupResult(nullptr, 0);
// Get the first mapping after GuestAddr, or end
// GuestAddr is inclusive