From abb4722da4d802a9879c0c580f6d03ed0396e2bf Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Sat, 5 Sep 2009 02:14:35 +0000 Subject: [PATCH] --- source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Ldfld.cs | 15 +++----- source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs | 40 ++++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Ldfld.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Ldfld.cs index e0407d6dc..303b4d13e 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Ldfld.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Ldfld.cs @@ -1,4 +1,10 @@ using System; +// using System.Collections.Generic; +// using System.IO; +// +// using CPU = Indy.IL2CPU.Assembler; +// using System.Reflection; +// using Indy.IL2CPU.Compiler; namespace Cosmos.IL2CPU.X86.IL { @@ -13,15 +19,6 @@ namespace Cosmos.IL2CPU.X86.IL throw new NotImplementedException(); } - - // using System; - // using System.Collections.Generic; - // using System.IO; - // - // - // using CPU = Indy.IL2CPU.Assembler; - // using System.Reflection; - // using Indy.IL2CPU.Compiler; // // namespace Indy.IL2CPU.IL.X86 { // [OpCode(OpCodeEnum.Ldfld)] diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index 009c07450..61219deb1 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -125,26 +125,28 @@ namespace Cosmos.IL2CPU } } - protected uint QueueMethod( MethodBase aMethod ) - { - if( !mMethodsSet.Contains( aMethod ) ) - { - mMethodsSet.Add( aMethod ); - mMethods.Add( aMethod ); - //TODO: Might still need this one, see after we get assembly output again - //Im hoping the operand walking we have now ill include this on its own. - //QueueType(aMethod.DeclaringType); + protected uint QueueMethod(MethodBase aMethod) { + uint xResult; + if (mMethodsSet.Contains(aMethod)) { + // todo: this is probably slow + xResult = (uint)(mMethods.IndexOf(aMethod)); + } else { + mMethodsSet.Add(aMethod); + xResult = (uint)mMethods.Count; + mMethods.Add(aMethod); + //TODO: Might still need this one, see after we get assembly output again + //Im hoping the operand walking we have now ill include this on its own. + //QueueType(aMethod.DeclaringType); - //var xMethodInfo = aMethod as MethodInfo; - //if (xMethodInfo != null) { - // QueueType(xMethodInfo.ReturnType); - //} - //foreach (var xParam in aMethod.GetParameters()) { - // QueueType(xParam.ParameterType); - //} - } - // todo: this is probably slow - return (uint)mMethods.IndexOf(aMethod); + //var xMethodInfo = aMethod as MethodInfo; + //if (xMethodInfo != null) { + // QueueType(xMethodInfo.ReturnType); + //} + //foreach (var xParam in aMethod.GetParameters()) { + // QueueType(xParam.ParameterType); + //} + } + return xResult; } //protected void QueueStaticField(FieldInfo aFieldInfo) {