| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Runtime.InteropServices;
- using ILRuntime.CLR.TypeSystem;
- using ILRuntime.CLR.Method;
- using ILRuntime.Runtime.Enviorment;
- using ILRuntime.Runtime.Intepreter;
- using ILRuntime.Runtime.Stack;
- using ILRuntime.Reflection;
- using ILRuntime.CLR.Utils;
- namespace ILRuntime.Runtime.Generated
- {
- unsafe class ETModel_AsyncETVoidMethodBuilder_Binding
- {
- public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
- {
- BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
- MethodBase method;
- Type[] args;
- Type type = typeof(ETModel.AsyncETVoidMethodBuilder);
- args = new Type[]{};
- method = type.GetMethod("Create", flag, null, args, null);
- app.RegisterCLRMethodRedirection(method, Create_0);
- Dictionary<string, List<MethodInfo>> genericMethods = new Dictionary<string, List<MethodInfo>>();
- List<MethodInfo> lst = null;
- foreach(var m in type.GetMethods())
- {
- if(m.IsGenericMethodDefinition)
- {
- if (!genericMethods.TryGetValue(m.Name, out lst))
- {
- lst = new List<MethodInfo>();
- genericMethods[m.Name] = lst;
- }
- lst.Add(m);
- }
- }
- args = new Type[]{typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)};
- if (genericMethods.TryGetValue("Start", out lst))
- {
- foreach(var m in lst)
- {
- if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
- {
- method = m.MakeGenericMethod(args);
- app.RegisterCLRMethodRedirection(method, Start_1);
- break;
- }
- }
- }
- args = new Type[]{};
- method = type.GetMethod("get_Task", flag, null, args, null);
- app.RegisterCLRMethodRedirection(method, get_Task_2);
- args = new Type[]{typeof(ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)};
- if (genericMethods.TryGetValue("AwaitUnsafeOnCompleted", out lst))
- {
- foreach(var m in lst)
- {
- if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter).MakeByRefType(), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
- {
- method = m.MakeGenericMethod(args);
- app.RegisterCLRMethodRedirection(method, AwaitUnsafeOnCompleted_3);
- break;
- }
- }
- }
- args = new Type[]{typeof(System.Exception)};
- method = type.GetMethod("SetException", flag, null, args, null);
- app.RegisterCLRMethodRedirection(method, SetException_4);
- args = new Type[]{};
- method = type.GetMethod("SetResult", flag, null, args, null);
- app.RegisterCLRMethodRedirection(method, SetResult_5);
- args = new Type[]{typeof(ETModel.ETTask.Awaiter), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)};
- if (genericMethods.TryGetValue("AwaitUnsafeOnCompleted", out lst))
- {
- foreach(var m in lst)
- {
- if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.ETTask.Awaiter).MakeByRefType(), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
- {
- method = m.MakeGenericMethod(args);
- app.RegisterCLRMethodRedirection(method, AwaitUnsafeOnCompleted_6);
- break;
- }
- }
- }
- args = new Type[]{typeof(ETModel.ETTask<ETModel.IResponse>.Awaiter), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)};
- if (genericMethods.TryGetValue("AwaitUnsafeOnCompleted", out lst))
- {
- foreach(var m in lst)
- {
- if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.ETTask<ETModel.IResponse>.Awaiter).MakeByRefType(), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
- {
- method = m.MakeGenericMethod(args);
- app.RegisterCLRMethodRedirection(method, AwaitUnsafeOnCompleted_7);
- break;
- }
- }
- }
- app.RegisterCLRCreateDefaultInstance(type, () => new ETModel.AsyncETVoidMethodBuilder());
- }
- static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref ETModel.AsyncETVoidMethodBuilder instance_of_this_method)
- {
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- switch(ptr_of_this_method->ObjectType)
- {
- case ObjectTypes.Object:
- {
- __mStack[ptr_of_this_method->Value] = instance_of_this_method;
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
- }
- else
- {
- var t = __domain.GetType(___obj.GetType()) as CLRType;
- t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
- }
- }
- break;
- case ObjectTypes.StaticFieldReference:
- {
- var t = __domain.GetType(ptr_of_this_method->Value);
- if(t is ILType)
- {
- ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
- }
- else
- {
- ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.AsyncETVoidMethodBuilder[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
- }
- break;
- }
- }
- static StackObject* Create_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
- StackObject* __ret = ILIntepreter.Minus(__esp, 0);
- var result_of_this_method = ETModel.AsyncETVoidMethodBuilder.Create();
- return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
- }
- static StackObject* Start_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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);
- ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor @stateMachine = (ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- instance_of_this_method.Start<ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor>(ref @stateMachine);
- 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);
- object ___obj = @stateMachine;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @stateMachine);
- }
- }
- 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] = @stateMachine;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @stateMachine);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return __ret;
- }
- static StackObject* get_Task_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- var result_of_this_method = instance_of_this_method.Task;
- ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
- }
- static StackObject* AwaitUnsafeOnCompleted_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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);
- ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor @stateMachine = (ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter @awaiter = (ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter)typeof(ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- instance_of_this_method.AwaitUnsafeOnCompleted<ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter, ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor>(ref @awaiter, ref @stateMachine);
- 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);
- object ___obj = @stateMachine;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @stateMachine);
- }
- }
- 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] = @stateMachine;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @stateMachine);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- switch(ptr_of_this_method->ObjectType)
- {
- case ObjectTypes.StackObjectReference:
- {
- var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
- object ___obj = @awaiter;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @awaiter;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @awaiter);
- }
- }
- 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] = @awaiter;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @awaiter);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @awaiter;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return __ret;
- }
- static StackObject* SetException_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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.Exception @exception = (System.Exception)typeof(System.Exception).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- instance_of_this_method.SetException(@exception);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return __ret;
- }
- static StackObject* SetResult_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- instance_of_this_method.SetResult();
- ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return __ret;
- }
- static StackObject* AwaitUnsafeOnCompleted_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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);
- ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor @stateMachine = (ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- ETModel.ETTask.Awaiter @awaiter = (ETModel.ETTask.Awaiter)typeof(ETModel.ETTask.Awaiter).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- instance_of_this_method.AwaitUnsafeOnCompleted<ETModel.ETTask.Awaiter, ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor>(ref @awaiter, ref @stateMachine);
- 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);
- object ___obj = @stateMachine;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @stateMachine);
- }
- }
- 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] = @stateMachine;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @stateMachine);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- switch(ptr_of_this_method->ObjectType)
- {
- case ObjectTypes.StackObjectReference:
- {
- var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
- object ___obj = @awaiter;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @awaiter;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @awaiter);
- }
- }
- 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] = @awaiter;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @awaiter);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.ETTask.Awaiter[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @awaiter;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return __ret;
- }
- static StackObject* AwaitUnsafeOnCompleted_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
- {
- ILRuntime.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);
- ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor @stateMachine = (ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor)typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- ETModel.ETTask<ETModel.IResponse>.Awaiter @awaiter = (ETModel.ETTask<ETModel.IResponse>.Awaiter)typeof(ETModel.ETTask<ETModel.IResponse>.Awaiter).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));
- ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
- ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
- ETModel.AsyncETVoidMethodBuilder instance_of_this_method = (ETModel.AsyncETVoidMethodBuilder)typeof(ETModel.AsyncETVoidMethodBuilder).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
- instance_of_this_method.AwaitUnsafeOnCompleted<ETModel.ETTask<ETModel.IResponse>.Awaiter, ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor>(ref @awaiter, ref @stateMachine);
- 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);
- object ___obj = @stateMachine;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @stateMachine);
- }
- }
- 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] = @stateMachine;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @stateMachine);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @stateMachine;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
- switch(ptr_of_this_method->ObjectType)
- {
- case ObjectTypes.StackObjectReference:
- {
- var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
- object ___obj = @awaiter;
- if (___dst->ObjectType >= ObjectTypes.Object)
- {
- if (___obj is CrossBindingAdaptorType)
- ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
- __mStack[___dst->Value] = ___obj;
- }
- else
- {
- ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
- }
- }
- break;
- case ObjectTypes.FieldReference:
- {
- var ___obj = __mStack[ptr_of_this_method->Value];
- if(___obj is ILTypeInstance)
- {
- ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @awaiter;
- }
- else
- {
- var ___type = __domain.GetType(___obj.GetType()) as CLRType;
- ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @awaiter);
- }
- }
- 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] = @awaiter;
- }
- else
- {
- ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @awaiter);
- }
- }
- break;
- case ObjectTypes.ArrayReference:
- {
- var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ETModel.ETTask<ETModel.IResponse>.Awaiter[];
- instance_of_arrayReference[ptr_of_this_method->ValueLow] = @awaiter;
- }
- break;
- }
- __intp.Free(ptr_of_this_method);
- ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
- WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
- __intp.Free(ptr_of_this_method);
- return __ret;
- }
- }
- }
|