Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MethodInstr.cs « codegen « ilasm « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 62c291c8900ca52ef23e9b693d4937770a038fd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Mono.ILASM.MethodInstr
//
// Author(s):
//  Jackson Harper (Jackson@LatitudeGeo.com)
//
// (C) 2003 Jackson Harper, All rights reserved
//


using System;


namespace Mono.ILASM {

        public class MethodInstr : IInstr {

                private PEAPI.MethodOp op;
                private BaseMethodRef operand;

                public MethodInstr (PEAPI.MethodOp op, BaseMethodRef operand, Location loc)
			: base (loc)
                {
                        this.op = op;
                        this.operand = operand;

                        if (op == PEAPI.MethodOp.newobj || op == PEAPI.MethodOp.callvirt)
                                operand.CallConv |= PEAPI.CallConv.Instance;
                }

                public override void Emit (CodeGen code_gen, MethodDef meth,
					   PEAPI.CILInstructions cil)
                {
                        operand.Resolve (code_gen);
                        cil.MethInst (op, operand.PeapiMethod);
                }
        }

}