mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-11 05:58:54 +02:00
instanced jit cache
- jit caches are no longer static. - JitUnwindWindows now supports multiple jit caches. - Jit caches should no longer cause crashes due to entry offset collisions. - cpu tests now run concurrently. Co-authored-by: LotP1 <68976644+LotP1@users.noreply.github.com>
This commit is contained in:
committed by
KeatonTheBot
co-authored by
LotP1
parent
297df259c3
commit
a82a721df6
@@ -4,6 +4,7 @@ using ARMeilleure.CodeGen.Unwinding;
|
||||
using ARMeilleure.Common;
|
||||
using ARMeilleure.Memory;
|
||||
using ARMeilleure.State;
|
||||
using ARMeilleure.Translation.Cache;
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
@@ -31,7 +32,7 @@ namespace ARMeilleure.Translation.PTC
|
||||
private const string OuterHeaderMagicString = "PTCohd\0\0";
|
||||
private const string InnerHeaderMagicString = "PTCihd\0\0";
|
||||
|
||||
private const uint InternalVersion = 7010; //! To be incremented manually for each change to the ARMeilleure project.
|
||||
private const uint InternalVersion = 7016; //! To be incremented manually for each change to the ARMeilleure project.
|
||||
|
||||
private const string ActualDir = "0";
|
||||
private const string BackupDir = "1";
|
||||
@@ -49,6 +50,8 @@ namespace ARMeilleure.Translation.PTC
|
||||
|
||||
public PtcProfiler Profiler { get; }
|
||||
|
||||
private readonly JitCache _jitCache;
|
||||
|
||||
// Carriers.
|
||||
private MemoryStream _infosStream;
|
||||
private List<byte[]> _codesList;
|
||||
@@ -79,7 +82,7 @@ namespace ARMeilleure.Translation.PTC
|
||||
private volatile int _translateTotalCount;
|
||||
public event Action<PtcLoadingState, int, int> PtcStateChanged;
|
||||
|
||||
public Ptc()
|
||||
public Ptc(JitCache jitCache)
|
||||
{
|
||||
Profiler = new PtcProfiler(this);
|
||||
|
||||
@@ -90,6 +93,8 @@ namespace ARMeilleure.Translation.PTC
|
||||
|
||||
_waitEvent = new ManualResetEvent(true);
|
||||
|
||||
_jitCache = jitCache;
|
||||
|
||||
_disposed = false;
|
||||
|
||||
TitleIdText = TitleIdTextDefault;
|
||||
@@ -725,7 +730,7 @@ namespace ARMeilleure.Translation.PTC
|
||||
return new UnwindInfo(pushEntries, prologueSize);
|
||||
}
|
||||
|
||||
private static TranslatedFunction FastTranslate(
|
||||
private TranslatedFunction FastTranslate(
|
||||
byte[] code,
|
||||
Counter<uint> callCounter,
|
||||
ulong guestSize,
|
||||
@@ -733,7 +738,7 @@ namespace ARMeilleure.Translation.PTC
|
||||
bool highCq)
|
||||
{
|
||||
CompiledFunction cFunc = new(code, unwindInfo, RelocInfo.Empty);
|
||||
GuestFunction gFunc = cFunc.MapWithPointer<GuestFunction>(out nint gFuncPointer);
|
||||
GuestFunction gFunc = cFunc.MapWithPointer<GuestFunction>(_jitCache, out nint gFuncPointer);
|
||||
|
||||
return new TranslatedFunction(gFunc, gFuncPointer, callCounter, guestSize, highCq);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user