using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; using UnityFusion.CLR.TypeSystem; using UnityFusion.CLR.Method; using UnityFusion.Runtime.Enviorment; using UnityFusion.Runtime.Intepreter; using UnityFusion.Runtime.Stack; using UnityFusion.Reflection; using UnityFusion.CLR.Utils; #if DEBUG && !DISABLE_UNITYFUSION_DEBUG using AutoList = System.Collections.Generic.List; #else using AutoList = UnityFusion.Other.UncheckedList; #endif namespace UnityFusion.Runtime.Generated { unsafe class System_Int32_Binding { public static void Register(UnityFusion.Runtime.Enviorment.AppDomain app) { BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; MethodBase method; FieldInfo field; Type[] args; Type type = typeof(System.Int32); args = new Type[]{typeof(System.Object)}; method = type.GetMethod("CompareTo", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CompareTo_0); args = new Type[]{typeof(System.Int32)}; method = type.GetMethod("CompareTo", flag, null, args, null); app.RegisterCLRMethodRedirection(method, CompareTo_1); args = new Type[]{typeof(System.Object)}; method = type.GetMethod("Equals", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Equals_2); args = new Type[]{typeof(System.Int32)}; method = type.GetMethod("Equals", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Equals_3); args = new Type[]{}; method = type.GetMethod("GetHashCode", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetHashCode_4); args = new Type[]{}; method = type.GetMethod("ToString", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ToString_5); args = new Type[]{typeof(System.String)}; method = type.GetMethod("ToString", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ToString_6); args = new Type[]{typeof(System.IFormatProvider)}; method = type.GetMethod("ToString", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ToString_7); args = new Type[]{typeof(System.String), typeof(System.IFormatProvider)}; method = type.GetMethod("ToString", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ToString_8); args = new Type[]{typeof(System.String)}; method = type.GetMethod("Parse", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Parse_9); args = new Type[]{typeof(System.String), typeof(System.Globalization.NumberStyles)}; method = type.GetMethod("Parse", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Parse_10); args = new Type[]{typeof(System.String), typeof(System.IFormatProvider)}; method = type.GetMethod("Parse", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Parse_11); args = new Type[]{typeof(System.String), typeof(System.Globalization.NumberStyles), typeof(System.IFormatProvider)}; method = type.GetMethod("Parse", flag, null, args, null); app.RegisterCLRMethodRedirection(method, Parse_12); args = new Type[]{typeof(System.String), typeof(System.Int32).MakeByRefType()}; method = type.GetMethod("TryParse", flag, null, args, null); app.RegisterCLRMethodRedirection(method, TryParse_13); args = new Type[]{typeof(System.String), typeof(System.Globalization.NumberStyles), typeof(System.IFormatProvider), typeof(System.Int32).MakeByRefType()}; method = type.GetMethod("TryParse", flag, null, args, null); app.RegisterCLRMethodRedirection(method, TryParse_14); args = new Type[]{}; method = type.GetMethod("GetTypeCode", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetTypeCode_15); field = type.GetField("MaxValue", flag); app.RegisterCLRFieldGetter(field, get_MaxValue_0); field = type.GetField("MinValue", flag); app.RegisterCLRFieldGetter(field, get_MinValue_1); app.RegisterCLRCreateArrayInstance(type, s => new System.Int32[s]); } static System.Int32 GetInstance(UnityFusion.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, AutoList __mStack) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); System.Int32 instance_of_this_method; switch(ptr_of_this_method->ObjectType) { case ObjectTypes.FieldReference: { var instance_of_fieldReference = __mStack[ptr_of_this_method->Value]; if(instance_of_fieldReference is ILTypeInstance) { instance_of_this_method = (System.Int32)typeof(System.Int32).CheckCLRTypes(((ILTypeInstance)instance_of_fieldReference)[ptr_of_this_method->ValueLow]); } else { var t = __domain.GetType(instance_of_fieldReference.GetType()) as CLRType; instance_of_this_method = (System.Int32)t.GetFieldValue(ptr_of_this_method->ValueLow, instance_of_fieldReference); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if(t is ILType) { instance_of_this_method = (System.Int32)typeof(System.Int32).CheckCLRTypes(((ILType)t).StaticInstance[ptr_of_this_method->ValueLow]); } else { instance_of_this_method = (System.Int32)((CLRType)t).GetFieldValue(ptr_of_this_method->ValueLow, null); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_this_method = instance_of_arrayReference[ptr_of_this_method->ValueLow]; } break; default: instance_of_this_method = ptr_of_this_method->Value; break; } return instance_of_this_method; } static StackObject* CompareTo_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Object @value = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.CompareTo(@value); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* CompareTo_1(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @value = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.CompareTo(@value); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* Equals_2(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Object @obj = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.Equals(@obj); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return __ret + 1; } static StackObject* Equals_3(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @obj = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.Equals(@obj); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return __ret + 1; } static StackObject* GetHashCode_4(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.GetHashCode(); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* ToString_5(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.ToString(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* ToString_6(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.ToString(@format); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* ToString_7(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.IFormatProvider @provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.ToString(@provider); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* ToString_8(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.IFormatProvider @provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String @format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.ToString(@format, @provider); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* Parse_9(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.String @s = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = System.Int32.Parse(@s); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* Parse_10(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Globalization.NumberStyles @style = (System.Globalization.NumberStyles)typeof(System.Globalization.NumberStyles).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String @s = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = System.Int32.Parse(@s, @style); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* Parse_11(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.IFormatProvider @provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String @s = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = System.Int32.Parse(@s, @provider); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* Parse_12(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.IFormatProvider @provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Globalization.NumberStyles @style = (System.Globalization.NumberStyles)typeof(System.Globalization.NumberStyles).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.String @s = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = System.Int32.Parse(@s, @style, @provider); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static StackObject* TryParse_13(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @result = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String @s = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); var result_of_this_method = System.Int32.TryParse(@s, out @result); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @result; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @result; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @result); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @result; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @result); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @result; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return __ret + 1; } static StackObject* TryParse_14(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @result = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.IFormatProvider @provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Globalization.NumberStyles @style = (System.Globalization.NumberStyles)typeof(System.Globalization.NumberStyles).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); System.String @s = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); var result_of_this_method = System.Int32.TryParse(@s, @style, @provider, out @result); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @result; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @result; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @result); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @result; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @result); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @result; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.FreeStackValueType(ptr_of_this_method); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); __intp.Free(ptr_of_this_method); __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return __ret + 1; } static StackObject* GetTypeCode_15(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); var result_of_this_method = instance_of_this_method.GetTypeCode(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static object get_MaxValue_0(ref object o) { return System.Int32.MaxValue; } static object get_MinValue_1(ref object o) { return System.Int32.MinValue; } } }