From 34ef82629de2f9354255e719dfa148e18a44c4e2 Mon Sep 17 00:00:00 2001 From: mterwoord_cp <7cd3fd84a0151ea055c2f79e4d2eef9576fe9afesxUZAwxD> Date: Mon, 14 Sep 2009 15:04:29 +0000 Subject: [PATCH] --- .../Indy.IL2CPU.X86.Plugs/MS/System/StringImpl.cs | 2 +- source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/Compiler/Indy.IL2CPU.X86.Plugs/MS/System/StringImpl.cs b/source/Compiler/Indy.IL2CPU.X86.Plugs/MS/System/StringImpl.cs index 497edf6b7..8c92a6317 100644 --- a/source/Compiler/Indy.IL2CPU.X86.Plugs/MS/System/StringImpl.cs +++ b/source/Compiler/Indy.IL2CPU.X86.Plugs/MS/System/StringImpl.cs @@ -22,7 +22,7 @@ namespace Indy.IL2CPU.X86.Plugs.CustomImplementations.MS.System { } } - [PlugMethod(Signature = "System_Void__System_String__ctor_System_Char___")] + //[PlugMethod(Signature = "System_Void__System_String__ctor_System_Char___")] public static unsafe void Ctor(String aThis, [FieldAccess(Name = "$$Storage$$")] ref Char[] aStorage, Char[] aChars, [FieldAccess(Name = "System.Int32 System.String.m_stringLength")]ref int aStringLength, [FieldAccess(Name = "System.Int32 System.String.m_arrayLength")] ref int aArrayLength, diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index 084c23bff..48a1644e6 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -457,7 +457,7 @@ namespace Cosmos.IL2CPU { } } if (xNeedsPlug) { - throw new Exception("Plug needed. " + aMethod.DeclaringType + "." + aMethod.Name); + throw new Exception("Plug needed. "+ MethodInfoLabelGenerator.GenerateFullName(aMethod)); } //TODO: As we scan each method, we could update or put in a new list @@ -594,6 +594,10 @@ namespace Cosmos.IL2CPU { PlugMethodAttribute xAttrib = null; foreach (var xImpl in aImpls) { + // TODO: cleanup this loop, next statement shouldnt be neccessary + if (xResult != null) { + break; + } // Plugs methods must be static, and public // Search for non signature matches first since signature searches are slower xResult = xImpl.GetMethod(aMethod.Name, BindingFlags.Static | BindingFlags.Public @@ -607,6 +611,9 @@ namespace Cosmos.IL2CPU { , null, xParamTypes, null); } if (xResult == null) { + if (aTargetType == typeof(string) && aMethod.Name == ".ctor") { + Console.Write(""); + } // Search by signature foreach (var xSigMethod in xImpl.GetMethods(BindingFlags.Static | BindingFlags.Public)) { var xParams = xSigMethod.GetParameters(); @@ -682,6 +689,7 @@ namespace Cosmos.IL2CPU { } if (xTargetMethod == aMethod) { xResult = xSigMethod; + break; } } }