System_String_Binding.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6. using ILRuntime.CLR.TypeSystem;
  7. using ILRuntime.CLR.Method;
  8. using ILRuntime.Runtime.Enviorment;
  9. using ILRuntime.Runtime.Intepreter;
  10. using ILRuntime.Runtime.Stack;
  11. using ILRuntime.Reflection;
  12. using ILRuntime.CLR.Utils;
  13. namespace ILRuntime.Runtime.Generated
  14. {
  15. unsafe class System_String_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
  20. MethodBase method;
  21. Type[] args;
  22. Type type = typeof(System.String);
  23. args = new Type[]{typeof(System.Int32), typeof(System.Int32)};
  24. method = type.GetMethod("Substring", flag, null, args, null);
  25. app.RegisterCLRMethodRedirection(method, Substring_0);
  26. args = new Type[]{typeof(System.Int32)};
  27. method = type.GetMethod("get_Chars", flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, get_Chars_1);
  29. args = new Type[]{typeof(System.String), typeof(System.Object), typeof(System.Object)};
  30. method = type.GetMethod("Format", flag, null, args, null);
  31. app.RegisterCLRMethodRedirection(method, Format_2);
  32. args = new Type[]{typeof(System.String), typeof(System.Object)};
  33. method = type.GetMethod("Format", flag, null, args, null);
  34. app.RegisterCLRMethodRedirection(method, Format_3);
  35. args = new Type[]{};
  36. method = type.GetMethod("get_Length", flag, null, args, null);
  37. app.RegisterCLRMethodRedirection(method, get_Length_4);
  38. args = new Type[]{typeof(System.String[]), typeof(System.StringSplitOptions)};
  39. method = type.GetMethod("Split", flag, null, args, null);
  40. app.RegisterCLRMethodRedirection(method, Split_5);
  41. args = new Type[]{};
  42. method = type.GetMethod("Trim", flag, null, args, null);
  43. app.RegisterCLRMethodRedirection(method, Trim_6);
  44. args = new Type[]{typeof(System.String), typeof(System.String)};
  45. method = type.GetMethod("op_Equality", flag, null, args, null);
  46. app.RegisterCLRMethodRedirection(method, op_Equality_7);
  47. app.RegisterCLRCreateArrayInstance(type, s => new System.String[s]);
  48. }
  49. static StackObject* Substring_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  50. {
  51. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  52. StackObject* ptr_of_this_method;
  53. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  54. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  55. System.Int32 @length = ptr_of_this_method->Value;
  56. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  57. System.Int32 @startIndex = ptr_of_this_method->Value;
  58. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  59. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  60. __intp.Free(ptr_of_this_method);
  61. var result_of_this_method = instance_of_this_method.Substring(@startIndex, @length);
  62. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  63. }
  64. static StackObject* get_Chars_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  65. {
  66. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  67. StackObject* ptr_of_this_method;
  68. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  69. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  70. System.Int32 @index = ptr_of_this_method->Value;
  71. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  72. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  73. __intp.Free(ptr_of_this_method);
  74. var result_of_this_method = instance_of_this_method[index];
  75. __ret->ObjectType = ObjectTypes.Integer;
  76. __ret->Value = (int)result_of_this_method;
  77. return __ret + 1;
  78. }
  79. static StackObject* Format_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  80. {
  81. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  82. StackObject* ptr_of_this_method;
  83. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  84. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  85. System.Object @arg1 = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  86. __intp.Free(ptr_of_this_method);
  87. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  88. System.Object @arg0 = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  89. __intp.Free(ptr_of_this_method);
  90. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  91. System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  92. __intp.Free(ptr_of_this_method);
  93. var result_of_this_method = System.String.Format(@format, @arg0, @arg1);
  94. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  95. }
  96. static StackObject* Format_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  97. {
  98. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  99. StackObject* ptr_of_this_method;
  100. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  101. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  102. System.Object @arg0 = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  103. __intp.Free(ptr_of_this_method);
  104. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  105. System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  106. __intp.Free(ptr_of_this_method);
  107. var result_of_this_method = System.String.Format(@format, @arg0);
  108. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  109. }
  110. static StackObject* get_Length_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  111. {
  112. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  113. StackObject* ptr_of_this_method;
  114. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  115. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  116. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  117. __intp.Free(ptr_of_this_method);
  118. var result_of_this_method = instance_of_this_method.Length;
  119. __ret->ObjectType = ObjectTypes.Integer;
  120. __ret->Value = result_of_this_method;
  121. return __ret + 1;
  122. }
  123. static StackObject* Split_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  124. {
  125. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  126. StackObject* ptr_of_this_method;
  127. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  128. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  129. System.StringSplitOptions @options = (System.StringSplitOptions)typeof(System.StringSplitOptions).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  130. __intp.Free(ptr_of_this_method);
  131. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  132. System.String[] @separator = (System.String[])typeof(System.String[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  133. __intp.Free(ptr_of_this_method);
  134. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  135. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  136. __intp.Free(ptr_of_this_method);
  137. var result_of_this_method = instance_of_this_method.Split(@separator, @options);
  138. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  139. }
  140. static StackObject* Trim_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  141. {
  142. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  143. StackObject* ptr_of_this_method;
  144. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  145. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  146. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  147. __intp.Free(ptr_of_this_method);
  148. var result_of_this_method = instance_of_this_method.Trim();
  149. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  150. }
  151. static StackObject* op_Equality_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  152. {
  153. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  154. StackObject* ptr_of_this_method;
  155. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  156. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  157. System.String @b = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  158. __intp.Free(ptr_of_this_method);
  159. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  160. System.String @a = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  161. __intp.Free(ptr_of_this_method);
  162. var result_of_this_method = a == b;
  163. __ret->ObjectType = ObjectTypes.Integer;
  164. __ret->Value = result_of_this_method ? 1 : 0;
  165. return __ret + 1;
  166. }
  167. }
  168. }