private void ShowInstructionStats()
{
if (CpuProcessor.CpuConfig.ShowInstructionStats)
{
bool HasNew = false;
foreach (var Pair in InstructionStats.OrderByDescending(Item => Item.Value))
{
if (NewInstruction.ContainsKey(Pair.Key))
{
HasNew = true;
}
}
if (!CpuProcessor.CpuConfig.ShowInstructionStatsJustNew || HasNew)
{
Console.Error.WriteLine("-------------------------- {0:X}-{1:X} ", MinPC, MaxPC);
ConsoleUtils.SaveRestoreConsoleColor(ConsoleColor.White, () =>
{
foreach (var Pair in InstructionStats.OrderByDescending(Item => Item.Value))
{
var IsNew = NewInstruction.ContainsKey(Pair.Key);
if (!CpuProcessor.CpuConfig.ShowInstructionStatsJustNew || IsNew)
{
Console.Error.Write("{0} : {1}", Pair.Key, Pair.Value);
if (IsNew) Console.Error.Write(" <-- NEW!");
Console.Error.WriteLine("");
}
}
});
}
}
//if (DoLog)
//{
// Console.WriteLine("----------------------------");
// foreach (var Instruction in MipsMethodEmiter.SafeILGenerator.GetEmittedInstructions()) Console.WriteLine(Instruction);
//}
}