System_String_Binding.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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.String), typeof(System.String)};
  30. method = type.GetMethod("Concat", flag, null, args, null);
  31. app.RegisterCLRMethodRedirection(method, Concat_2);
  32. args = new Type[]{typeof(System.String), typeof(System.String)};
  33. method = type.GetMethod("Concat", flag, null, args, null);
  34. app.RegisterCLRMethodRedirection(method, Concat_3);
  35. args = new Type[]{typeof(System.String), typeof(System.Object), typeof(System.Object)};
  36. method = type.GetMethod("Format", flag, null, args, null);
  37. app.RegisterCLRMethodRedirection(method, Format_4);
  38. args = new Type[]{};
  39. method = type.GetMethod("get_Length", flag, null, args, null);
  40. app.RegisterCLRMethodRedirection(method, get_Length_5);
  41. args = new Type[]{typeof(System.String), typeof(System.Object)};
  42. method = type.GetMethod("Format", flag, null, args, null);
  43. app.RegisterCLRMethodRedirection(method, Format_6);
  44. args = new Type[]{typeof(System.String[]), typeof(System.StringSplitOptions)};
  45. method = type.GetMethod("Split", flag, null, args, null);
  46. app.RegisterCLRMethodRedirection(method, Split_7);
  47. args = new Type[]{};
  48. method = type.GetMethod("Trim", flag, null, args, null);
  49. app.RegisterCLRMethodRedirection(method, Trim_8);
  50. args = new Type[]{typeof(System.String), typeof(System.String)};
  51. method = type.GetMethod("op_Equality", flag, null, args, null);
  52. app.RegisterCLRMethodRedirection(method, op_Equality_9);
  53. args = new Type[]{typeof(System.String), typeof(System.String), typeof(System.String), typeof(System.String)};
  54. method = type.GetMethod("Concat", flag, null, args, null);
  55. app.RegisterCLRMethodRedirection(method, Concat_10);
  56. app.RegisterCLRCreateArrayInstance(type, s => new System.String[s]);
  57. }
  58. static StackObject* Substring_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  59. {
  60. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  61. StackObject* ptr_of_this_method;
  62. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  63. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  64. System.Int32 @length = ptr_of_this_method->Value;
  65. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  66. System.Int32 @startIndex = ptr_of_this_method->Value;
  67. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  68. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  69. __intp.Free(ptr_of_this_method);
  70. var result_of_this_method = instance_of_this_method.Substring(@startIndex, @length);
  71. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  72. }
  73. static StackObject* get_Chars_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  74. {
  75. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  76. StackObject* ptr_of_this_method;
  77. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  78. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  79. System.Int32 @index = ptr_of_this_method->Value;
  80. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  81. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  82. __intp.Free(ptr_of_this_method);
  83. var result_of_this_method = instance_of_this_method[index];
  84. __ret->ObjectType = ObjectTypes.Integer;
  85. __ret->Value = (int)result_of_this_method;
  86. return __ret + 1;
  87. }
  88. static StackObject* Concat_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  89. {
  90. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  91. StackObject* ptr_of_this_method;
  92. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  93. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  94. System.String @str2 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  95. __intp.Free(ptr_of_this_method);
  96. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  97. System.String @str1 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  98. __intp.Free(ptr_of_this_method);
  99. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  100. System.String @str0 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  101. __intp.Free(ptr_of_this_method);
  102. var result_of_this_method = System.String.Concat(@str0, @str1, @str2);
  103. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  104. }
  105. static StackObject* Concat_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  106. {
  107. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  108. StackObject* ptr_of_this_method;
  109. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  110. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  111. System.String @str1 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  112. __intp.Free(ptr_of_this_method);
  113. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  114. System.String @str0 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  115. __intp.Free(ptr_of_this_method);
  116. var result_of_this_method = System.String.Concat(@str0, @str1);
  117. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  118. }
  119. static StackObject* Format_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  120. {
  121. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  122. StackObject* ptr_of_this_method;
  123. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  124. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  125. System.Object @arg1 = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  126. __intp.Free(ptr_of_this_method);
  127. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  128. System.Object @arg0 = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  129. __intp.Free(ptr_of_this_method);
  130. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  131. System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  132. __intp.Free(ptr_of_this_method);
  133. var result_of_this_method = System.String.Format(@format, @arg0, @arg1);
  134. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  135. }
  136. static StackObject* get_Length_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  137. {
  138. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  139. StackObject* ptr_of_this_method;
  140. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  141. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  142. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  143. __intp.Free(ptr_of_this_method);
  144. var result_of_this_method = instance_of_this_method.Length;
  145. __ret->ObjectType = ObjectTypes.Integer;
  146. __ret->Value = result_of_this_method;
  147. return __ret + 1;
  148. }
  149. static StackObject* Format_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  150. {
  151. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  152. StackObject* ptr_of_this_method;
  153. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  154. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  155. System.Object @arg0 = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  156. __intp.Free(ptr_of_this_method);
  157. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  158. System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  159. __intp.Free(ptr_of_this_method);
  160. var result_of_this_method = System.String.Format(@format, @arg0);
  161. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  162. }
  163. static StackObject* Split_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  164. {
  165. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  166. StackObject* ptr_of_this_method;
  167. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  168. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  169. System.StringSplitOptions @options = (System.StringSplitOptions)typeof(System.StringSplitOptions).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  170. __intp.Free(ptr_of_this_method);
  171. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  172. System.String[] @separator = (System.String[])typeof(System.String[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  173. __intp.Free(ptr_of_this_method);
  174. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  175. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  176. __intp.Free(ptr_of_this_method);
  177. var result_of_this_method = instance_of_this_method.Split(@separator, @options);
  178. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  179. }
  180. static StackObject* Trim_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  181. {
  182. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  183. StackObject* ptr_of_this_method;
  184. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  185. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  186. System.String instance_of_this_method = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  187. __intp.Free(ptr_of_this_method);
  188. var result_of_this_method = instance_of_this_method.Trim();
  189. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  190. }
  191. static StackObject* op_Equality_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  192. {
  193. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  194. StackObject* ptr_of_this_method;
  195. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  196. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  197. System.String @b = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  198. __intp.Free(ptr_of_this_method);
  199. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  200. System.String @a = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  201. __intp.Free(ptr_of_this_method);
  202. var result_of_this_method = a == b;
  203. __ret->ObjectType = ObjectTypes.Integer;
  204. __ret->Value = result_of_this_method ? 1 : 0;
  205. return __ret + 1;
  206. }
  207. static StackObject* Concat_10(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  208. {
  209. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  210. StackObject* ptr_of_this_method;
  211. StackObject* __ret = ILIntepreter.Minus(__esp, 4);
  212. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  213. System.String @str3 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  214. __intp.Free(ptr_of_this_method);
  215. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  216. System.String @str2 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  217. __intp.Free(ptr_of_this_method);
  218. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  219. System.String @str1 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  220. __intp.Free(ptr_of_this_method);
  221. ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
  222. System.String @str0 = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  223. __intp.Free(ptr_of_this_method);
  224. var result_of_this_method = System.String.Concat(@str0, @str1, @str2, @str3);
  225. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  226. }
  227. }
  228. }