Remove cold methods from the CPU cache (#224)

* Remove unused tracing functionality from the CPU

* GetNsoExecutable -> GetExecutable

* Unsigned comparison

* Re-add cpu tracing

* Config change

* Remove cold methods from the translation cache on the cpu

* Replace lock with try lock, pass new ATranslatorCache instead of ATranslator

* Rebase fixups
This commit is contained in:
gdkchan 2018-09-19 17:07:56 -03:00 committed by GitHub
parent 99b2692425
commit 6d65e53664
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 318 additions and 232 deletions

View file

@ -19,11 +19,7 @@ namespace ChocolArm64.Decoder
OpActivators = new ConcurrentDictionary<Type, OpActivator>();
}
public static ABlock DecodeBasicBlock(
AThreadState State,
ATranslator Translator,
AMemory Memory,
long Start)
public static ABlock DecodeBasicBlock(AThreadState State, AMemory Memory, long Start)
{
ABlock Block = new ABlock(Start);
@ -33,10 +29,10 @@ namespace ChocolArm64.Decoder
}
public static (ABlock[] Graph, ABlock Root) DecodeSubroutine(
AThreadState State,
ATranslator Translator,
AMemory Memory,
long Start)
ATranslatorCache Cache,
AThreadState State,
AMemory Memory,
long Start)
{
Dictionary<long, ABlock> Visited = new Dictionary<long, ABlock>();
Dictionary<long, ABlock> VisitedEnd = new Dictionary<long, ABlock>();
@ -79,7 +75,7 @@ namespace ChocolArm64.Decoder
{
if (Op.Emitter == AInstEmit.Bl)
{
HasCachedSub = Translator.HasCachedSub(Op.Imm);
HasCachedSub = Cache.HasSubroutine(Op.Imm);
}
else
{