System_String_Binding.cs 14 KB

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