a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
42 lines
1001 B
C#
42 lines
1001 B
C#
//
|
|
// 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);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|