From 2b34fe04cba2fad38c830af9dc27d77a024e1792 Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Sun, 13 Sep 2009 15:16:08 +0000 Subject: [PATCH] --- source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs | 47 ++++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index 541b812fd..feca97390 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -477,30 +477,39 @@ namespace Cosmos.IL2CPU { private long mItemsHandled = 0; protected void ScanQueue() { while (mQueue.Count > 0) { - if ((mQueue.Count + mItemsHandled) != mItems.Count) { - Console.Write(""); - } - var xItem = mQueue.Dequeue(); - // Check for MethodBase first, they are more numerous - // and will reduce compares - if (xItem is MethodBase) { - ScanMethod((MethodBase)xItem, false); - } else if (xItem is Type) { - ScanType((Type)xItem); - } else { - throw new Exception("Unknown item found in queue."); - } - mItemsHandled++; - if ((mItemsHandled % 5000) == 0) { - Console.WriteLine("ItemsHandled: {0}", mItemsHandled); - } - if (mItemsHandled == 10000) { - throw new Exception("Debug Abort"); + while (mQueue.Count > 0) { + if ((mQueue.Count + mItemsHandled) != mItems.Count) { + Console.Write(""); + } + var xItem = mQueue.Dequeue(); + // Check for MethodBase first, they are more numerous + // and will reduce compares + if (xItem is MethodBase) { + ScanMethod((MethodBase)xItem, false); + } else if (xItem is Type) { + ScanType((Type)xItem); + } else { + throw new Exception("Unknown item found in queue."); + } + mItemsHandled++; + if ((mItemsHandled % 5000) == 0) { + Console.WriteLine("ItemsHandled: {0}", mItemsHandled); + } + if (mItemsHandled == 10000) { + throw new Exception("Debug Abort"); + } } + // We process all items until no more are added. + // Then we check virtuals again. If it adds more items + // Then we need to repeat the whole process. + CheckVirtuals(); } Console.WriteLine("ItemsHandled: {0}", mItemsHandled); } + protected void CheckVirtuals() { + } + protected void LogMapPoint(object aSrc, string aSrcType, object aItem) { // Keys cant be null. If null, we just say ILScanner is the source if (aSrc == null) {