From a1a4771ac1de95f2410c7fb8dfaf4a5986e5ebc6 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 23 Jan 2023 19:37:53 -0300 Subject: Remove use of GetFunctionPointerForDelegate to get JIT cache function pointer (#4337) * Remove use of GetFunctionPointerForDelegate to get JIT cache function pointer * Rename FuncPtr to FuncPointer --- ARMeilleure/Translation/Translator.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ARMeilleure/Translation/Translator.cs') diff --git a/ARMeilleure/Translation/Translator.cs b/ARMeilleure/Translation/Translator.cs index cbf6baa0..0c05b2b4 100644 --- a/ARMeilleure/Translation/Translator.cs +++ b/ARMeilleure/Translation/Translator.cs @@ -211,7 +211,7 @@ namespace ARMeilleure.Translation if (oldFunc != func) { - JitCache.Unmap(func.FuncPtr); + JitCache.Unmap(func.FuncPointer); func = oldFunc; } @@ -230,7 +230,7 @@ namespace ARMeilleure.Translation { if (FunctionTable.IsValid(guestAddress) && (Optimizations.AllowLcqInFunctionTable || func.HighCq)) { - Volatile.Write(ref FunctionTable.GetValue(guestAddress), (ulong)func.FuncPtr); + Volatile.Write(ref FunctionTable.GetValue(guestAddress), (ulong)func.FuncPointer); } } @@ -292,11 +292,11 @@ namespace ARMeilleure.Translation _ptc.WriteCompiledFunction(address, funcSize, hash, highCq, compiledFunc); } - GuestFunction func = compiledFunc.Map(); + GuestFunction func = compiledFunc.MapWithPointer(out IntPtr funcPointer); Allocators.ResetAll(); - return new TranslatedFunction(func, counter, funcSize, highCq); + return new TranslatedFunction(func, funcPointer, counter, funcSize, highCq); } private void BackgroundTranslate() @@ -537,7 +537,7 @@ namespace ARMeilleure.Translation foreach (var func in functions) { - JitCache.Unmap(func.FuncPtr); + JitCache.Unmap(func.FuncPointer); func.CallCounter?.Dispose(); } @@ -546,7 +546,7 @@ namespace ARMeilleure.Translation while (_oldFuncs.TryDequeue(out var kv)) { - JitCache.Unmap(kv.Value.FuncPtr); + JitCache.Unmap(kv.Value.FuncPointer); kv.Value.CallCounter?.Dispose(); } -- cgit v1.2.3