2018-10-31 01:43:02 +00:00
|
|
|
using System.Reflection;
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
|
|
|
|
namespace ChocolArm64.Translation
|
|
|
|
{
|
|
|
|
struct ILOpCodeCall : IILEmit
|
|
|
|
{
|
2019-02-28 02:03:31 +00:00
|
|
|
public MethodInfo Info { get; }
|
2018-10-31 01:43:02 +00:00
|
|
|
|
2019-02-28 02:03:31 +00:00
|
|
|
public bool IsVirtual { get; }
|
2019-02-04 21:26:05 +00:00
|
|
|
|
|
|
|
public ILOpCodeCall(MethodInfo info, bool isVirtual)
|
2018-10-31 01:43:02 +00:00
|
|
|
{
|
2019-02-04 21:26:05 +00:00
|
|
|
Info = info;
|
|
|
|
IsVirtual = isVirtual;
|
2018-10-31 01:43:02 +00:00
|
|
|
}
|
|
|
|
|
2018-12-11 00:58:52 +00:00
|
|
|
public void Emit(ILMethodBuilder context)
|
2018-10-31 01:43:02 +00:00
|
|
|
{
|
2019-02-04 21:26:05 +00:00
|
|
|
context.Generator.Emit(IsVirtual ? OpCodes.Callvirt : OpCodes.Call, Info);
|
2018-10-31 01:43:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|