-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/jiogao/ILRuntime
- Loading branch information
Showing
34 changed files
with
823 additions
and
1,580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
ILRuntimeTest/AutoGenerate/ILRuntimeTest_TestFramework_TestClass4_Binding.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
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 ILRuntimeTest_TestFramework_TestClass4_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(ILRuntimeTest.TestFramework.TestClass4); | ||
args = new Type[]{typeof(ILRuntimeTest.TestFramework.TestStruct[]).MakeByRefType()}; | ||
method = type.GetMethod("TestArrayOut", flag, null, args, null); | ||
app.RegisterCLRMethodRedirection(method, TestArrayOut_0); | ||
|
||
args = new Type[]{}; | ||
method = type.GetConstructor(flag, null, args, null); | ||
app.RegisterCLRMethodRedirection(method, Ctor_0); | ||
|
||
} | ||
|
||
|
||
static StackObject* TestArrayOut_0(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); | ||
ILRuntimeTest.TestFramework.TestStruct[] @arr = (ILRuntimeTest.TestFramework.TestStruct[])typeof(ILRuntimeTest.TestFramework.TestStruct[]).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack)); | ||
|
||
ptr_of_this_method = ILIntepreter.Minus(__esp, 2); | ||
ILRuntimeTest.TestFramework.TestClass4 instance_of_this_method = (ILRuntimeTest.TestFramework.TestClass4)typeof(ILRuntimeTest.TestFramework.TestClass4).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); | ||
|
||
instance_of_this_method.TestArrayOut(out @arr); | ||
|
||
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 = @arr; | ||
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] = @arr; | ||
} | ||
else | ||
{ | ||
var ___type = __domain.GetType(___obj.GetType()) as CLRType; | ||
___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @arr); | ||
} | ||
} | ||
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] = @arr; | ||
} | ||
else | ||
{ | ||
((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @arr); | ||
} | ||
} | ||
break; | ||
case ObjectTypes.ArrayReference: | ||
{ | ||
var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ILRuntimeTest.TestFramework.TestStruct[][]; | ||
instance_of_arrayReference[ptr_of_this_method->ValueLow] = @arr; | ||
} | ||
break; | ||
} | ||
|
||
__intp.Free(ptr_of_this_method); | ||
ptr_of_this_method = ILIntepreter.Minus(__esp, 2); | ||
__intp.Free(ptr_of_this_method); | ||
return __ret; | ||
} | ||
|
||
|
||
static StackObject* Ctor_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 = new ILRuntimeTest.TestFramework.TestClass4(); | ||
|
||
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.