From 277d87e3ef021011306252b3d511cbaddd5abe89 Mon Sep 17 00:00:00 2001 From: Matthijs ter Woord Date: Tue, 5 May 2015 10:44:54 +0200 Subject: [PATCH] Code cleanup. --- source/Cosmos.IL2CPU/AppAssembler.cs | 9 +++++---- source/Cosmos.IL2CPU/ILScanner.cs | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/Cosmos.IL2CPU/AppAssembler.cs b/source/Cosmos.IL2CPU/AppAssembler.cs index 36b0a3041..d4abf867b 100644 --- a/source/Cosmos.IL2CPU/AppAssembler.cs +++ b/source/Cosmos.IL2CPU/AppAssembler.cs @@ -522,6 +522,7 @@ namespace Cosmos.IL2CPU private void AfterEmitInstructions(MethodInfo aMethod, List aCurrentGroup) { // do optimizations + //if (Assembler.Stack.Count > 0) //{ // if (mDebugStackErrors) @@ -966,10 +967,6 @@ namespace Cosmos.IL2CPU } } - if (!xType.IsInterface) - { - Push(aGetTypeID(xType)); - } int? xBaseIndex = null; if (xType.BaseType == null) { @@ -1001,6 +998,10 @@ namespace Cosmos.IL2CPU } if (!xType.IsInterface) { + if (!xType.IsInterface) + { + Push(aGetTypeID(xType)); + } Move("VMT__TYPE_ID_HOLDER__" + DataMember.FilterStringForIncorrectChars(LabelName.GetFullName(xType) + " ASM_IS__" + xType.Assembly.GetName().Name), (int)aGetTypeID(xType)); Cosmos.Assembler.Assembler.CurrentInstance.DataMembers.Add( new DataMember("VMT__TYPE_ID_HOLDER__" + DataMember.FilterStringForIncorrectChars(LabelName.GetFullName(xType) + " ASM_IS__" + xType.Assembly.GetName().Name), new int[] { (int)aGetTypeID(xType) })); diff --git a/source/Cosmos.IL2CPU/ILScanner.cs b/source/Cosmos.IL2CPU/ILScanner.cs index b7d3b229b..d5b0ced6b 100644 --- a/source/Cosmos.IL2CPU/ILScanner.cs +++ b/source/Cosmos.IL2CPU/ILScanner.cs @@ -387,7 +387,9 @@ namespace Cosmos.IL2CPU var xParamTypes = new Type[xParams.Length]; // Dont use foreach, enum generaly keeps order but // isn't guaranteed. - string xMethodFullName = LabelName.GenerateFullName(aMethod); + //string xMethodFullName = LabelName.GenerateFullName(aMethod); + + for (int i = 0; i < xParams.Length; i++) { xParamTypes[i] = xParams[i].ParameterType;