System_Object_Binding.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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_Object_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.Object);
  21. args = new Type[]{typeof(System.Object)};
  22. method = type.GetMethod("Equals", flag, null, args, null);
  23. app.RegisterCLRMethodRedirection(method, Equals_0);
  24. args = new Type[]{typeof(System.Object), typeof(System.Object)};
  25. method = type.GetMethod("Equals", flag, null, args, null);
  26. app.RegisterCLRMethodRedirection(method, Equals_1);
  27. args = new Type[]{};
  28. method = type.GetMethod("GetHashCode", flag, null, args, null);
  29. app.RegisterCLRMethodRedirection(method, GetHashCode_2);
  30. args = new Type[]{};
  31. method = type.GetMethod("GetType", flag, null, args, null);
  32. app.RegisterCLRMethodRedirection(method, GetType_3);
  33. args = new Type[]{};
  34. method = type.GetMethod("ToString", flag, null, args, null);
  35. app.RegisterCLRMethodRedirection(method, ToString_4);
  36. args = new Type[]{typeof(System.Object), typeof(System.Object)};
  37. method = type.GetMethod("ReferenceEquals", flag, null, args, null);
  38. app.RegisterCLRMethodRedirection(method, ReferenceEquals_5);
  39. args = new Type[]{};
  40. method = type.GetConstructor(flag, null, args, null);
  41. app.RegisterCLRMethodRedirection(method, Ctor_0);
  42. }
  43. static StackObject* Equals_0(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  44. {
  45. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  46. StackObject* ptr_of_this_method;
  47. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  48. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  49. System.Object obj = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  50. __intp.Free(ptr_of_this_method);
  51. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  52. System.Object instance_of_this_method;
  53. instance_of_this_method = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  54. __intp.Free(ptr_of_this_method);
  55. var result_of_this_method = instance_of_this_method.Equals(obj);
  56. __ret->ObjectType = ObjectTypes.Integer;
  57. __ret->Value = result_of_this_method ? 1 : 0;
  58. return __ret + 1;
  59. }
  60. static StackObject* Equals_1(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  61. {
  62. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  63. StackObject* ptr_of_this_method;
  64. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  65. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  66. System.Object objB = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  67. __intp.Free(ptr_of_this_method);
  68. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  69. System.Object objA = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  70. __intp.Free(ptr_of_this_method);
  71. var result_of_this_method = System.Object.Equals(objA, objB);
  72. __ret->ObjectType = ObjectTypes.Integer;
  73. __ret->Value = result_of_this_method ? 1 : 0;
  74. return __ret + 1;
  75. }
  76. static StackObject* GetHashCode_2(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  77. {
  78. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  79. StackObject* ptr_of_this_method;
  80. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  81. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  82. System.Object instance_of_this_method;
  83. instance_of_this_method = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  84. __intp.Free(ptr_of_this_method);
  85. var result_of_this_method = instance_of_this_method.GetHashCode();
  86. __ret->ObjectType = ObjectTypes.Integer;
  87. __ret->Value = result_of_this_method;
  88. return __ret + 1;
  89. }
  90. static StackObject* GetType_3(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  91. {
  92. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  93. StackObject* ptr_of_this_method;
  94. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  95. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  96. System.Object instance_of_this_method;
  97. instance_of_this_method = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  98. __intp.Free(ptr_of_this_method);
  99. var result_of_this_method = instance_of_this_method.GetType();
  100. object obj_result_of_this_method = result_of_this_method;
  101. if(obj_result_of_this_method is CrossBindingAdaptorType)
  102. {
  103. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  104. }
  105. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  106. }
  107. static StackObject* ToString_4(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  108. {
  109. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  110. StackObject* ptr_of_this_method;
  111. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  112. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  113. System.Object instance_of_this_method;
  114. instance_of_this_method = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  115. __intp.Free(ptr_of_this_method);
  116. var result_of_this_method = instance_of_this_method.ToString();
  117. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  118. }
  119. static StackObject* ReferenceEquals_5(ILIntepreter __intp, StackObject* __esp, List<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, 2);
  124. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  125. System.Object objB = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, 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 objA = (System.Object)typeof(System.Object).CheckCLRTypes(__domain, StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  129. __intp.Free(ptr_of_this_method);
  130. var result_of_this_method = System.Object.ReferenceEquals(objA, objB);
  131. __ret->ObjectType = ObjectTypes.Integer;
  132. __ret->Value = result_of_this_method ? 1 : 0;
  133. return __ret + 1;
  134. }
  135. static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, List<object> __mStack, CLRMethod __method, bool isNewObj)
  136. {
  137. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  138. StackObject* ptr_of_this_method;
  139. StackObject* __ret = ILIntepreter.Minus(__esp, 0);
  140. var result_of_this_method = new System.Object();
  141. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  142. }
  143. }
  144. }