System_Single_Binding.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Reflection;
  4. using ILRuntime.CLR.TypeSystem;
  5. using ILRuntime.CLR.Method;
  6. using ILRuntime.Runtime.Enviorment;
  7. using ILRuntime.Runtime.Intepreter;
  8. using ILRuntime.Runtime.Stack;
  9. using ILRuntime.Reflection;
  10. using ILRuntime.CLR.Utils;
  11. namespace ILRuntime.Runtime.Generated
  12. {
  13. unsafe class System_Single_Binding
  14. {
  15. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  16. {
  17. BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
  18. MethodBase method;
  19. Type[] args;
  20. Type type = typeof(System.Single);
  21. args = new Type[]{typeof(System.Object)};
  22. method = type.GetMethod("CompareTo", flag, null, args, null);
  23. app.RegisterCLRMethodRedirection(method, CompareTo_0);
  24. args = new Type[]{typeof(System.Object)};
  25. method = type.GetMethod("Equals", flag, null, args, null);
  26. app.RegisterCLRMethodRedirection(method, Equals_1);
  27. args = new Type[]{typeof(System.Single)};
  28. method = type.GetMethod("CompareTo", flag, null, args, null);
  29. app.RegisterCLRMethodRedirection(method, CompareTo_2);
  30. args = new Type[]{typeof(System.Single)};
  31. method = type.GetMethod("Equals", flag, null, args, null);
  32. app.RegisterCLRMethodRedirection(method, Equals_3);
  33. args = new Type[]{};
  34. method = type.GetMethod("GetHashCode", flag, null, args, null);
  35. app.RegisterCLRMethodRedirection(method, GetHashCode_4);
  36. args = new Type[]{typeof(System.Single)};
  37. method = type.GetMethod("IsInfinity", flag, null, args, null);
  38. app.RegisterCLRMethodRedirection(method, IsInfinity_5);
  39. args = new Type[]{typeof(System.Single)};
  40. method = type.GetMethod("IsNaN", flag, null, args, null);
  41. app.RegisterCLRMethodRedirection(method, IsNaN_6);
  42. args = new Type[]{typeof(System.Single)};
  43. method = type.GetMethod("IsNegativeInfinity", flag, null, args, null);
  44. app.RegisterCLRMethodRedirection(method, IsNegativeInfinity_7);
  45. args = new Type[]{typeof(System.Single)};
  46. method = type.GetMethod("IsPositiveInfinity", flag, null, args, null);
  47. app.RegisterCLRMethodRedirection(method, IsPositiveInfinity_8);
  48. args = new Type[]{typeof(System.String)};
  49. method = type.GetMethod("Parse", flag, null, args, null);
  50. app.RegisterCLRMethodRedirection(method, Parse_9);
  51. args = new Type[]{typeof(System.String), typeof(System.IFormatProvider)};
  52. method = type.GetMethod("Parse", flag, null, args, null);
  53. app.RegisterCLRMethodRedirection(method, Parse_10);
  54. args = new Type[]{typeof(System.String), typeof(System.Globalization.NumberStyles)};
  55. method = type.GetMethod("Parse", flag, null, args, null);
  56. app.RegisterCLRMethodRedirection(method, Parse_11);
  57. args = new Type[]{typeof(System.String), typeof(System.Globalization.NumberStyles), typeof(System.IFormatProvider)};
  58. method = type.GetMethod("Parse", flag, null, args, null);
  59. app.RegisterCLRMethodRedirection(method, Parse_12);
  60. args = new Type[]{typeof(System.String), typeof(System.Globalization.NumberStyles), typeof(System.IFormatProvider), typeof(System.Single).MakeByRefType()};
  61. method = type.GetMethod("TryParse", flag, null, args, null);
  62. app.RegisterCLRMethodRedirection(method, TryParse_13);
  63. args = new Type[]{typeof(System.String), typeof(System.Single).MakeByRefType()};
  64. method = type.GetMethod("TryParse", flag, null, args, null);
  65. app.RegisterCLRMethodRedirection(method, TryParse_14);
  66. args = new Type[]{};
  67. method = type.GetMethod("ToString", flag, null, args, null);
  68. app.RegisterCLRMethodRedirection(method, ToString_15);
  69. args = new Type[]{typeof(System.IFormatProvider)};
  70. method = type.GetMethod("ToString", flag, null, args, null);
  71. app.RegisterCLRMethodRedirection(method, ToString_16);
  72. args = new Type[]{typeof(System.String)};
  73. method = type.GetMethod("ToString", flag, null, args, null);
  74. app.RegisterCLRMethodRedirection(method, ToString_17);
  75. args = new Type[]{typeof(System.String), typeof(System.IFormatProvider)};
  76. method = type.GetMethod("ToString", flag, null, args, null);
  77. app.RegisterCLRMethodRedirection(method, ToString_18);
  78. args = new Type[]{};
  79. method = type.GetMethod("GetTypeCode", flag, null, args, null);
  80. app.RegisterCLRMethodRedirection(method, GetTypeCode_19);
  81. }
  82. static System.Single GetInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, List<object> __mStack)
  83. {
  84. ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
  85. System.Single instance_of_this_method;
  86. switch(ptr_of_this_method->ObjectType)
  87. {
  88. case ObjectTypes.FieldReference:
  89. {
  90. var instance_of_fieldReference = __mStack[ptr_of_this_method->Value];
  91. if(instance_of_fieldReference is ILTypeInstance)
  92. {
  93. instance_of_this_method = (System.Single)((ILTypeInstance)instance_of_fieldReference)[ptr_of_this_method->ValueLow];
  94. }
  95. else
  96. {
  97. var t = __domain.GetType(instance_of_fieldReference.GetType()) as CLRType;
  98. instance_of_this_method = (System.Single)t.GetField(ptr_of_this_method->ValueLow).GetValue(instance_of_fieldReference);
  99. }
  100. }
  101. break;
  102. case ObjectTypes.StaticFieldReference:
  103. {
  104. var t = __domain.GetType(ptr_of_this_method->Value);
  105. if(t is ILType)
  106. {
  107. instance_of_this_method = (System.Single)((ILType)t).StaticInstance[ptr_of_this_method->ValueLow];
  108. }
  109. else
  110. {
  111. instance_of_this_method = (System.Single)((CLRType)t).GetField(ptr_of_this_method->ValueLow).GetValue(null);
  112. }
  113. }
  114. break;
  115. case ObjectTypes.ArrayReference:
  116. {
  117. var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Single[];
  118. instance_of_this_method = instance_of_arrayReference[ptr_of_this_method->ValueLow];
  119. }
  120. break;
  121. default:
  122. instance_of_this_method = *(float*)&ptr_of_this_method->Value;
  123. break;
  124. }
  125. return instance_of_this_method;
  126. }
  127. static StackObject* CompareTo_0(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  128. {
  129. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  130. StackObject* ptr_of_this_method;
  131. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  132. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  133. System.Object value = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  134. __intp.Free(ptr_of_this_method);
  135. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  136. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  137. var result_of_this_method = instance_of_this_method.CompareTo(value);
  138. __ret->ObjectType = ObjectTypes.Integer;
  139. __ret->Value = result_of_this_method;
  140. return __ret + 1;
  141. }
  142. static StackObject* Equals_1(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  143. {
  144. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  145. StackObject* ptr_of_this_method;
  146. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  147. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  148. System.Object obj = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  149. __intp.Free(ptr_of_this_method);
  150. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  151. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  152. var result_of_this_method = instance_of_this_method.Equals(obj);
  153. __ret->ObjectType = ObjectTypes.Integer;
  154. __ret->Value = result_of_this_method ? 1 : 0;
  155. return __ret + 1;
  156. }
  157. static StackObject* CompareTo_2(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  158. {
  159. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  160. StackObject* ptr_of_this_method;
  161. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  162. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  163. System.Single value = *(float*)&ptr_of_this_method->Value;
  164. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  165. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  166. var result_of_this_method = instance_of_this_method.CompareTo(value);
  167. __ret->ObjectType = ObjectTypes.Integer;
  168. __ret->Value = result_of_this_method;
  169. return __ret + 1;
  170. }
  171. static StackObject* Equals_3(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  172. {
  173. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  174. StackObject* ptr_of_this_method;
  175. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  176. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  177. System.Single obj = *(float*)&ptr_of_this_method->Value;
  178. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  179. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  180. var result_of_this_method = instance_of_this_method.Equals(obj);
  181. __ret->ObjectType = ObjectTypes.Integer;
  182. __ret->Value = result_of_this_method ? 1 : 0;
  183. return __ret + 1;
  184. }
  185. static StackObject* GetHashCode_4(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  186. {
  187. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  188. StackObject* ptr_of_this_method;
  189. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  190. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  191. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  192. var result_of_this_method = instance_of_this_method.GetHashCode();
  193. __ret->ObjectType = ObjectTypes.Integer;
  194. __ret->Value = result_of_this_method;
  195. return __ret + 1;
  196. }
  197. static StackObject* IsInfinity_5(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  198. {
  199. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  200. StackObject* ptr_of_this_method;
  201. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  202. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  203. System.Single f = *(float*)&ptr_of_this_method->Value;
  204. var result_of_this_method = System.Single.IsInfinity(f);
  205. __ret->ObjectType = ObjectTypes.Integer;
  206. __ret->Value = result_of_this_method ? 1 : 0;
  207. return __ret + 1;
  208. }
  209. static StackObject* IsNaN_6(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  210. {
  211. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  212. StackObject* ptr_of_this_method;
  213. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  214. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  215. System.Single f = *(float*)&ptr_of_this_method->Value;
  216. var result_of_this_method = System.Single.IsNaN(f);
  217. __ret->ObjectType = ObjectTypes.Integer;
  218. __ret->Value = result_of_this_method ? 1 : 0;
  219. return __ret + 1;
  220. }
  221. static StackObject* IsNegativeInfinity_7(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  222. {
  223. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  224. StackObject* ptr_of_this_method;
  225. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  226. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  227. System.Single f = *(float*)&ptr_of_this_method->Value;
  228. var result_of_this_method = System.Single.IsNegativeInfinity(f);
  229. __ret->ObjectType = ObjectTypes.Integer;
  230. __ret->Value = result_of_this_method ? 1 : 0;
  231. return __ret + 1;
  232. }
  233. static StackObject* IsPositiveInfinity_8(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  234. {
  235. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  236. StackObject* ptr_of_this_method;
  237. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  238. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  239. System.Single f = *(float*)&ptr_of_this_method->Value;
  240. var result_of_this_method = System.Single.IsPositiveInfinity(f);
  241. __ret->ObjectType = ObjectTypes.Integer;
  242. __ret->Value = result_of_this_method ? 1 : 0;
  243. return __ret + 1;
  244. }
  245. static StackObject* Parse_9(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  246. {
  247. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  248. StackObject* ptr_of_this_method;
  249. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  250. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  251. System.String s = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  252. __intp.Free(ptr_of_this_method);
  253. var result_of_this_method = System.Single.Parse(s);
  254. __ret->ObjectType = ObjectTypes.Float;
  255. *(float*)&__ret->Value = result_of_this_method;
  256. return __ret + 1;
  257. }
  258. static StackObject* Parse_10(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  259. {
  260. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  261. StackObject* ptr_of_this_method;
  262. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  263. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  264. System.IFormatProvider provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  265. __intp.Free(ptr_of_this_method);
  266. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  267. System.String s = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  268. __intp.Free(ptr_of_this_method);
  269. var result_of_this_method = System.Single.Parse(s, provider);
  270. __ret->ObjectType = ObjectTypes.Float;
  271. *(float*)&__ret->Value = result_of_this_method;
  272. return __ret + 1;
  273. }
  274. static StackObject* Parse_11(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  275. {
  276. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  277. StackObject* ptr_of_this_method;
  278. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  279. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  280. System.Globalization.NumberStyles style = (System.Globalization.NumberStyles)typeof(System.Globalization.NumberStyles).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  281. __intp.Free(ptr_of_this_method);
  282. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  283. System.String s = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  284. __intp.Free(ptr_of_this_method);
  285. var result_of_this_method = System.Single.Parse(s, style);
  286. __ret->ObjectType = ObjectTypes.Float;
  287. *(float*)&__ret->Value = result_of_this_method;
  288. return __ret + 1;
  289. }
  290. static StackObject* Parse_12(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  291. {
  292. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  293. StackObject* ptr_of_this_method;
  294. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  295. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  296. System.IFormatProvider provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  297. __intp.Free(ptr_of_this_method);
  298. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  299. System.Globalization.NumberStyles style = (System.Globalization.NumberStyles)typeof(System.Globalization.NumberStyles).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  300. __intp.Free(ptr_of_this_method);
  301. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  302. System.String s = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  303. __intp.Free(ptr_of_this_method);
  304. var result_of_this_method = System.Single.Parse(s, style, provider);
  305. __ret->ObjectType = ObjectTypes.Float;
  306. *(float*)&__ret->Value = result_of_this_method;
  307. return __ret + 1;
  308. }
  309. static StackObject* TryParse_13(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  310. {
  311. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  312. StackObject* ptr_of_this_method;
  313. StackObject* __ret = ILIntepreter.Minus(__esp, 4);
  314. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  315. ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
  316. System.Single result = *(float*)&ptr_of_this_method->Value;
  317. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  318. System.IFormatProvider provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  319. __intp.Free(ptr_of_this_method);
  320. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  321. System.Globalization.NumberStyles style = (System.Globalization.NumberStyles)typeof(System.Globalization.NumberStyles).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  322. __intp.Free(ptr_of_this_method);
  323. ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
  324. System.String s = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  325. __intp.Free(ptr_of_this_method);
  326. var result_of_this_method = System.Single.TryParse(s, style, provider, out result);
  327. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  328. switch(ptr_of_this_method->ObjectType)
  329. {
  330. case ObjectTypes.StackObjectReference:
  331. {
  332. var dst = *(StackObject**)&ptr_of_this_method->Value;
  333. dst->ObjectType = ObjectTypes.Float;
  334. *(float*)&dst->Value = result;
  335. }
  336. break;
  337. case ObjectTypes.FieldReference:
  338. {
  339. var ___obj = __mStack[ptr_of_this_method->Value];
  340. if(___obj is ILTypeInstance)
  341. {
  342. ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = result;
  343. }
  344. else
  345. {
  346. var t = __domain.GetType(___obj.GetType()) as CLRType;
  347. t.GetField(ptr_of_this_method->ValueLow).SetValue(___obj, result);
  348. }
  349. }
  350. break;
  351. case ObjectTypes.StaticFieldReference:
  352. {
  353. var t = __domain.GetType(ptr_of_this_method->Value);
  354. if(t is ILType)
  355. {
  356. ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = result;
  357. }
  358. else
  359. {
  360. ((CLRType)t).GetField(ptr_of_this_method->ValueLow).SetValue(null, result);
  361. }
  362. }
  363. break;
  364. case ObjectTypes.ArrayReference:
  365. {
  366. var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Single[];
  367. instance_of_arrayReference[ptr_of_this_method->ValueLow] = result;
  368. }
  369. break;
  370. }
  371. __ret->ObjectType = ObjectTypes.Integer;
  372. __ret->Value = result_of_this_method ? 1 : 0;
  373. return __ret + 1;
  374. }
  375. static StackObject* TryParse_14(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  376. {
  377. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  378. StackObject* ptr_of_this_method;
  379. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  380. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  381. ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
  382. System.Single result = *(float*)&ptr_of_this_method->Value;
  383. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  384. System.String s = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  385. __intp.Free(ptr_of_this_method);
  386. var result_of_this_method = System.Single.TryParse(s, out result);
  387. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  388. switch(ptr_of_this_method->ObjectType)
  389. {
  390. case ObjectTypes.StackObjectReference:
  391. {
  392. var dst = *(StackObject**)&ptr_of_this_method->Value;
  393. dst->ObjectType = ObjectTypes.Float;
  394. *(float*)&dst->Value = result;
  395. }
  396. break;
  397. case ObjectTypes.FieldReference:
  398. {
  399. var ___obj = __mStack[ptr_of_this_method->Value];
  400. if(___obj is ILTypeInstance)
  401. {
  402. ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = result;
  403. }
  404. else
  405. {
  406. var t = __domain.GetType(___obj.GetType()) as CLRType;
  407. t.GetField(ptr_of_this_method->ValueLow).SetValue(___obj, result);
  408. }
  409. }
  410. break;
  411. case ObjectTypes.StaticFieldReference:
  412. {
  413. var t = __domain.GetType(ptr_of_this_method->Value);
  414. if(t is ILType)
  415. {
  416. ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = result;
  417. }
  418. else
  419. {
  420. ((CLRType)t).GetField(ptr_of_this_method->ValueLow).SetValue(null, result);
  421. }
  422. }
  423. break;
  424. case ObjectTypes.ArrayReference:
  425. {
  426. var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Single[];
  427. instance_of_arrayReference[ptr_of_this_method->ValueLow] = result;
  428. }
  429. break;
  430. }
  431. __ret->ObjectType = ObjectTypes.Integer;
  432. __ret->Value = result_of_this_method ? 1 : 0;
  433. return __ret + 1;
  434. }
  435. static StackObject* ToString_15(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  436. {
  437. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  438. StackObject* ptr_of_this_method;
  439. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  440. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  441. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  442. var result_of_this_method = instance_of_this_method.ToString();
  443. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  444. }
  445. static StackObject* ToString_16(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  446. {
  447. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  448. StackObject* ptr_of_this_method;
  449. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  450. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  451. System.IFormatProvider provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  452. __intp.Free(ptr_of_this_method);
  453. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  454. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  455. var result_of_this_method = instance_of_this_method.ToString(provider);
  456. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  457. }
  458. static StackObject* ToString_17(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  459. {
  460. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  461. StackObject* ptr_of_this_method;
  462. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  463. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  464. System.String format = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  465. __intp.Free(ptr_of_this_method);
  466. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  467. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  468. var result_of_this_method = instance_of_this_method.ToString(format);
  469. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  470. }
  471. static StackObject* ToString_18(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  472. {
  473. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  474. StackObject* ptr_of_this_method;
  475. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  476. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  477. System.IFormatProvider provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  478. __intp.Free(ptr_of_this_method);
  479. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  480. System.String format = (System.String)typeof(System.String).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  481. __intp.Free(ptr_of_this_method);
  482. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  483. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  484. var result_of_this_method = instance_of_this_method.ToString(format, provider);
  485. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  486. }
  487. static StackObject* GetTypeCode_19(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  488. {
  489. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  490. StackObject* ptr_of_this_method;
  491. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  492. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  493. System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);
  494. var result_of_this_method = instance_of_this_method.GetTypeCode();
  495. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  496. }
  497. }
  498. }