public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { if (operand != null) cil.ldstr (operand); else cil.ldstr (b_operand); }
public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method) { PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method); PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method); PEAPI.Finally phinally = new PEAPI.Finally (from, to); return phinally; }
public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method) { PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method); PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method); PEAPI.Fault fault = new PEAPI.Fault (from, to); return fault; }
public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method) { PEAPI.CILLabel label = this_block.GetFromLabel (code_gen, method); PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method); PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method); PEAPI.Filter filter = new PEAPI.Filter (label, from, to); return filter; }
public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method) { PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method); PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method); PEAPI.Catch katch; type_ref.Resolve (code_gen); katch = new PEAPI.Catch (type_ref.PeapiType, from, to); return katch; }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { PEAPI.CILLabel from = block.GetFromLabel (code_gen, meth); PEAPI.CILLabel to = block.GetToLabel (code_gen, meth); PEAPI.TryBlock try_block = new PEAPI.TryBlock (from, to); foreach (ISehClause clause in clause_list) try_block.AddHandler (clause.Resolve (code_gen, meth)); cil.AddTryBlock (try_block); }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { switch (op) { case MiscInstr.ldc_r8: cil.ldc_r8 (d_operand); break; case MiscInstr.ldc_r4: cil.ldc_r4 ((float) d_operand); break; case MiscInstr.ldc_i8: cil.ldc_i8 (l_operand); break; } }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { if (field_ref != null) { field_ref.Resolve (code_gen); cil.FieldInst (PEAPI.FieldOp.ldtoken, field_ref.PeapiField); } else if (method_ref != null) { method_ref.Resolve (code_gen); cil.MethInst (PEAPI.MethodOp.ldtoken, method_ref.PeapiMethod); } else if (type_ref != null) { type_ref.Resolve (code_gen); cil.TypeInst (PEAPI.TypeOp.ldtoken, type_ref.PeapiType); } }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { int count = 0; PEAPI.CILLabel[] label_array; if (label_list != null) { label_array = new PEAPI.CILLabel[label_list.Count]; foreach (object lab in label_list) { if (lab is LabelInfo) { label_array[count++] = ((LabelInfo)lab).Label; } else { throw new InternalErrorException ("offsets in switch statements."); } } } else { label_array = new PEAPI.CILLabel [0]; } cil.Switch (label_array); }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { PEAPI.Type[] param_array; PEAPI.CalliSig callisig; if (param != null) { param_array = new PEAPI.Type[param.Length]; int count = 0; foreach (BaseTypeRef typeref in param) { typeref.Resolve (code_gen); param_array[count++] = typeref.PeapiType; } } else { param_array = new PEAPI.Type[0]; } ret_type.Resolve (code_gen); callisig = new PEAPI.CalliSig (call_conv, ret_type.PeapiType, param_array); cil.calli (callisig); }
public override void Emit(CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { operand.Resolve(code_gen); cil.FieldInst(op, operand.PeapiField); }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { cil.Inst (op); }
public void AddMethodDef (MethodDef methoddef) { if (IsInterface && !methoddef.IsStatic && (!methoddef.IsVirtual || !methoddef.IsAbstract)) { Report.Warning (methoddef.StartLocation, "Non-virtual or non-abstract instance method in interface, set to such"); methoddef.Attributes |= PEAPI.MethAttr.Abstract | PEAPI.MethAttr.Virtual; } if (method_table [methoddef.Signature] != null) Report.Error (methoddef.StartLocation, "Duplicate method declaration: " + methoddef.Signature); method_table.Add (methoddef.Signature, methoddef); method_list.Add (methoddef); }
public void AddOverride (MethodDef body, BaseTypeRef parent, string name) { if (override_list == null) override_list = new ArrayList (); override_list.Add (new DictionaryEntry (body, new DictionaryEntry (parent, name))); }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { cil.Branch (op, label.Label); }
public PEAPI.CILLabel GetFromLabel (CodeGen code_gen, MethodDef method) { return from_label.Label; }
/// <summary> /// Add this instruction to the supplied codebuffer /// </summary> public abstract void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil);
public PEAPI.CILLabel GetToLabel (CodeGen code_gen, MethodDef method) { return to_label.Label; }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { operand.Resolve (code_gen); cil.MethInst (op, operand.PeapiMethod); }
public override void Emit (CodeGen code_gen, MethodDef meth, PEAPI.CILInstructions cil) { cil.emitbyte ((byte)value); }