Apply suggestions from code review

Address gdkchan's feedback

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
This commit is contained in:
FICTURE7
2021-04-13 10:41:41 +04:00
committed by FICTURE7
parent 68bff558db
commit f443167da8
4 changed files with 33 additions and 16 deletions

View File

@ -540,8 +540,11 @@ namespace ARMeilleure.Translation.PTC
}
}
internal static void LoadTranslations(ConcurrentDictionary<ulong, TranslatedFunction> funcs, IMemoryManager memory,
JumpTable jumpTable, EntryTable<uint> countTable)
internal static void LoadTranslations(
ConcurrentDictionary<ulong, TranslatedFunction> funcs,
IMemoryManager memory,
JumpTable jumpTable,
EntryTable<uint> countTable)
{
if (AreCarriersEmpty())
{
@ -680,8 +683,13 @@ namespace ARMeilleure.Translation.PTC
return relocEntries;
}
private static bool PatchCode(Span<byte> code, RelocEntry[] relocEntries, IntPtr pageTablePointer,
JumpTable jumpTable, EntryTable<uint> countTable, out Counter<uint> callCounter)
private static bool PatchCode(
Span<byte> code,
RelocEntry[] relocEntries,
IntPtr pageTablePointer,
JumpTable jumpTable,
EntryTable<uint> countTable,
out Counter<uint> callCounter)
{
callCounter = null;
@ -747,8 +755,12 @@ namespace ARMeilleure.Translation.PTC
return new UnwindInfo(pushEntries, prologueSize);
}
private static TranslatedFunction FastTranslate(byte[] code, Counter<uint> callCounter, ulong guestSize,
UnwindInfo unwindInfo, bool highCq)
private static TranslatedFunction FastTranslate(
byte[] code,
Counter<uint> callCounter,
ulong guestSize,
UnwindInfo unwindInfo,
bool highCq)
{
CompiledFunction cFunc = new CompiledFunction(code, unwindInfo);
@ -797,8 +809,11 @@ namespace ARMeilleure.Translation.PTC
}
}
internal static void MakeAndSaveTranslations(ConcurrentDictionary<ulong, TranslatedFunction> funcs, IMemoryManager memory,
JumpTable jumpTable, EntryTable<uint> countTable)
internal static void MakeAndSaveTranslations(
ConcurrentDictionary<ulong, TranslatedFunction> funcs,
IMemoryManager memory,
JumpTable jumpTable,
EntryTable<uint> countTable)
{
var profiledFuncsToTranslate = PtcProfiler.GetProfiledFuncsToTranslate(funcs);
@ -1085,4 +1100,4 @@ namespace ARMeilleure.Translation.PTC
}
}
}
}
}