aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Translation/TranslatedFunction.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-12-16 17:07:42 -0300
committerGitHub <noreply@github.com>2020-12-16 17:07:42 -0300
commit61634dd415fb71b3ae85871a0873d00195b0900c (patch)
tree233134f41a93d22d96f78b269047a1a050e87aba /ARMeilleure/Translation/TranslatedFunction.cs
parent11222516c4b5042cd8da6fdd72f53ee736139b66 (diff)
Clear JIT cache on exit (#1518)
* Initial cache memory allocator implementation * Get rid of CallFlag * Perform cache cleanup on exit * Basic cache invalidation * Thats not how conditionals works in C# it seems * Set PTC version to PR number * Address PR feedback * Update InstEmitFlowHelper.cs * Flag clear on address is no longer needed * Do not include exit block in function size calculation * Dispose jump table * For future use * InternalVersion = 1519 (force retest). Co-authored-by: LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>
Diffstat (limited to 'ARMeilleure/Translation/TranslatedFunction.cs')
-rw-r--r--ARMeilleure/Translation/TranslatedFunction.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/ARMeilleure/Translation/TranslatedFunction.cs b/ARMeilleure/Translation/TranslatedFunction.cs
index 36fae50a..54c050f6 100644
--- a/ARMeilleure/Translation/TranslatedFunction.cs
+++ b/ARMeilleure/Translation/TranslatedFunction.cs
@@ -4,23 +4,24 @@ using System.Threading;
namespace ARMeilleure.Translation
{
- sealed class TranslatedFunction
+ class TranslatedFunction
{
private const int MinCallsForRejit = 100;
private readonly GuestFunction _func; // Ensure that this delegate will not be garbage collected.
- private int _callCount = 0;
+ private int _callCount;
- public bool HighCq { get; }
+ public ulong GuestSize { get; }
+ public bool HighCq { get; }
public IntPtr FuncPtr { get; }
- public TranslatedFunction(GuestFunction func, bool highCq)
+ public TranslatedFunction(GuestFunction func, ulong guestSize, bool highCq)
{
_func = func;
-
- HighCq = highCq;
- FuncPtr = Marshal.GetFunctionPointerForDelegate<GuestFunction>(func);
+ GuestSize = guestSize;
+ HighCq = highCq;
+ FuncPtr = Marshal.GetFunctionPointerForDelegate(func);
}
public ulong Execute(State.ExecutionContext context)