2018-10-30 18:43:02 -07:00
|
|
|
using System.Reflection;
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
|
|
|
|
namespace ChocolArm64.Translation
|
|
|
|
{
|
|
|
|
struct ILOpCodeCall : IILEmit
|
|
|
|
{
|
2019-02-04 13:26:05 -08:00
|
|
|
public MethodInfo Info { get; private set; }
|
2018-10-30 18:43:02 -07:00
|
|
|
|
2019-02-04 13:26:05 -08:00
|
|
|
public bool IsVirtual { get; private set; }
|
|
|
|
|
|
|
|
public ILOpCodeCall(MethodInfo info, bool isVirtual)
|
2018-10-30 18:43:02 -07:00
|
|
|
{
|
2019-02-04 13:26:05 -08:00
|
|
|
Info = info;
|
|
|
|
IsVirtual = isVirtual;
|
2018-10-30 18:43:02 -07:00
|
|
|
}
|
|
|
|
|
2018-12-10 16:58:52 -08:00
|
|
|
public void Emit(ILMethodBuilder context)
|
2018-10-30 18:43:02 -07:00
|
|
|
{
|
2019-02-04 13:26:05 -08:00
|
|
|
context.Generator.Emit(IsVirtual ? OpCodes.Callvirt : OpCodes.Call, Info);
|
2018-10-30 18:43:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|