aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Translation/ILOpCodeCall.cs
blob: c046aeeb750d469a5ef541789c6ea6b43e84643a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Reflection;
using System.Reflection.Emit;

namespace ChocolArm64.Translation
{
    struct ILOpCodeCall : IILEmit
    {
        public MethodInfo Info { get; private set; }

        public bool IsVirtual { get; private set; }

        public ILOpCodeCall(MethodInfo info, bool isVirtual)
        {
            Info      = info;
            IsVirtual = isVirtual;
        }

        public void Emit(ILMethodBuilder context)
        {
            context.Generator.Emit(IsVirtual ? OpCodes.Callvirt : OpCodes.Call, Info);
        }
    }
}