mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-26 21:42:11 +00:00
This commit is contained in:
parent
5f7757e3f0
commit
34ef82629d
2 changed files with 10 additions and 2 deletions
|
|
@ -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,
|
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_stringLength")]ref int aStringLength,
|
||||||
[FieldAccess(Name = "System.Int32 System.String.m_arrayLength")] ref int aArrayLength,
|
[FieldAccess(Name = "System.Int32 System.String.m_arrayLength")] ref int aArrayLength,
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ namespace Cosmos.IL2CPU {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (xNeedsPlug) {
|
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
|
//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;
|
PlugMethodAttribute xAttrib = null;
|
||||||
foreach (var xImpl in aImpls) {
|
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
|
// Plugs methods must be static, and public
|
||||||
// Search for non signature matches first since signature searches are slower
|
// Search for non signature matches first since signature searches are slower
|
||||||
xResult = xImpl.GetMethod(aMethod.Name, BindingFlags.Static | BindingFlags.Public
|
xResult = xImpl.GetMethod(aMethod.Name, BindingFlags.Static | BindingFlags.Public
|
||||||
|
|
@ -607,6 +611,9 @@ namespace Cosmos.IL2CPU {
|
||||||
, null, xParamTypes, null);
|
, null, xParamTypes, null);
|
||||||
}
|
}
|
||||||
if (xResult == null) {
|
if (xResult == null) {
|
||||||
|
if (aTargetType == typeof(string) && aMethod.Name == ".ctor") {
|
||||||
|
Console.Write("");
|
||||||
|
}
|
||||||
// Search by signature
|
// Search by signature
|
||||||
foreach (var xSigMethod in xImpl.GetMethods(BindingFlags.Static | BindingFlags.Public)) {
|
foreach (var xSigMethod in xImpl.GetMethods(BindingFlags.Static | BindingFlags.Public)) {
|
||||||
var xParams = xSigMethod.GetParameters();
|
var xParams = xSigMethod.GetParameters();
|
||||||
|
|
@ -682,6 +689,7 @@ namespace Cosmos.IL2CPU {
|
||||||
}
|
}
|
||||||
if (xTargetMethod == aMethod) {
|
if (xTargetMethod == aMethod) {
|
||||||
xResult = xSigMethod;
|
xResult = xSigMethod;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue