mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-05 04:52:32 -07:00
Make EntryTable<T> expandable
* EntryTable is now expandable instead of being a fixed slab. * Remove EntryTable<T>.TryAllocate * Remove Counter<T>.TryCreate Address LDj3SNuD's feedback
This commit is contained in:
@@ -57,7 +57,7 @@ namespace ARMeilleure.Translation
|
||||
_backgroundTranslatorEvent = new AutoResetEvent(false);
|
||||
_backgroundTranslatorLock = new ReaderWriterLock();
|
||||
|
||||
CountTable = new EntryTable<uint>(CountTableCapacity);
|
||||
CountTable = new EntryTable<uint>();
|
||||
|
||||
JitCache.Initialize(allocator);
|
||||
|
||||
@@ -174,6 +174,8 @@ namespace ARMeilleure.Translation
|
||||
_jumpTable.Dispose();
|
||||
_jumpTable = null;
|
||||
|
||||
CountTable.Dispose();
|
||||
|
||||
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
|
||||
}
|
||||
}
|
||||
@@ -393,14 +395,11 @@ namespace ARMeilleure.Translation
|
||||
return context.GetControlFlowGraph();
|
||||
}
|
||||
|
||||
internal static void EmitRejitCheck(ArmEmitterContext context, out Counter<uint> counter)
|
||||
internal static Counter<uint> EmitRejitCheck(ArmEmitterContext context, out Counter<uint> counter)
|
||||
{
|
||||
const int MinsCallForRejit = 100;
|
||||
|
||||
if (!Counter<uint>.TryCreate(context.CountTable, out counter))
|
||||
{
|
||||
return;
|
||||
}
|
||||
counter = new Counter<uint>(context.CountTable);
|
||||
|
||||
Operand lblEnd = Label();
|
||||
|
||||
@@ -413,6 +412,8 @@ namespace ARMeilleure.Translation
|
||||
context.Call(typeof(NativeInterface).GetMethod(nameof(NativeInterface.EnqueueForRejit)), Const(context.EntryAddress));
|
||||
|
||||
context.MarkLabel(lblEnd);
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
internal static void EmitSynchronization(EmitterContext context)
|
||||
|
Reference in New Issue
Block a user