This commit is contained in:
kudzu_cp 2009-09-13 15:16:08 +00:00
parent b20b92b4cd
commit 2b34fe04cb

View file

@ -477,30 +477,39 @@ namespace Cosmos.IL2CPU {
private long mItemsHandled = 0; private long mItemsHandled = 0;
protected void ScanQueue() { protected void ScanQueue() {
while (mQueue.Count > 0) { while (mQueue.Count > 0) {
if ((mQueue.Count + mItemsHandled) != mItems.Count) { while (mQueue.Count > 0) {
Console.Write(""); if ((mQueue.Count + mItemsHandled) != mItems.Count) {
} Console.Write("");
var xItem = mQueue.Dequeue(); }
// Check for MethodBase first, they are more numerous var xItem = mQueue.Dequeue();
// and will reduce compares // Check for MethodBase first, they are more numerous
if (xItem is MethodBase) { // and will reduce compares
ScanMethod((MethodBase)xItem, false); if (xItem is MethodBase) {
} else if (xItem is Type) { ScanMethod((MethodBase)xItem, false);
ScanType((Type)xItem); } else if (xItem is Type) {
} else { ScanType((Type)xItem);
throw new Exception("Unknown item found in queue."); } else {
} throw new Exception("Unknown item found in queue.");
mItemsHandled++; }
if ((mItemsHandled % 5000) == 0) { mItemsHandled++;
Console.WriteLine("ItemsHandled: {0}", mItemsHandled); if ((mItemsHandled % 5000) == 0) {
} Console.WriteLine("ItemsHandled: {0}", mItemsHandled);
if (mItemsHandled == 10000) { }
throw new Exception("Debug Abort"); 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); Console.WriteLine("ItemsHandled: {0}", mItemsHandled);
} }
protected void CheckVirtuals() {
}
protected void LogMapPoint(object aSrc, string aSrcType, object aItem) { protected void LogMapPoint(object aSrc, string aSrcType, object aItem) {
// Keys cant be null. If null, we just say ILScanner is the source // Keys cant be null. If null, we just say ILScanner is the source
if (aSrc == null) { if (aSrc == null) {