本文整理汇总了C#中System.Reflection.Emit.ILGenerator.Call方法的典型用法代码示例。如果您正苦于以下问题:C# ILGenerator.Call方法的具体用法?C# ILGenerator.Call怎么用?C# ILGenerator.Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.ILGenerator
的用法示例。
在下文中一共展示了ILGenerator.Call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendMessageHeaderCore
protected override void AppendMessageHeaderCore(
ILGenerator generator, ForEachLoop loop, MessageField field)
{
LocalBuilder length = generator.DeclareLocal(typeof(int));
loop.Create(body => {
body.Emit(OpCodes.Ldarg_1);
loop.LoadCurrentAs(FieldType);
field.AppendFieldLength(generator);
body.Emit(OpCodes.Ldloc, length.LocalIndex);
body.Emit(OpCodes.Add);
body.Emit(OpCodes.Stloc, length.LocalIndex);
});
generator.Emit(OpCodes.Ldloc, length.LocalIndex);
Label done = generator.DefineLabel();
generator.Emit(OpCodes.Brfalse, done);
generator.Emit(OpCodes.Ldarg_1);
generator.Emit(OpCodes.Ldc_I4, MessageTag.AsInt(field.Number, WireType.String));
generator.Call<MessageWriter>("WriteVarint", typeof(uint));
generator.Emit(OpCodes.Ldloc, length.LocalIndex);
generator.Call<MessageWriter>("WriteVarint", typeof(uint)).Pop();
generator.MarkLabel(done);
}
示例2: AppendWriteField
public override void AppendWriteField(ILGenerator il)
{
il.Call<MessageWriter>("WriteBytes", typeof(byte[]));
}
示例3: AppendWriteField
public override void AppendWriteField(ILGenerator il)
{
il.Call<MessageWriter>("WriteZigZag", FieldType);
}
示例4: AppendWriteField
public override void AppendWriteField(ILGenerator generator)
{
generator.Call<MessageWriter>("WriteZigZag", typeof(int));
}
示例5: AppendReadField
public override void AppendReadField(ILGenerator generator)
{
generator.Call<MessageReader>("ReadZigZag32");
}
示例6: AppendWriteField
public override void AppendWriteField(ILGenerator il)
{
il.Emit(OpCodes.Conv_I4);
il.Call<MessageWriter>("WriteZigZag", typeof(int));
}
示例7: AppendWriteField
public override void AppendWriteField(ILGenerator il)
{
il.Call<MessageWriter>("WriteVarint", typeof(int));
}
示例8: AppendWriteField
public override void AppendWriteField(ILGenerator generator)
{
generator.Call<MessageWriter>("WriteFixed", FieldType);
}
示例9: AppendReadField
public override void AppendReadField(ILGenerator generator)
{
generator.Call<MessageReader>("ReadFixed" + FieldType.Name);
}
示例10: SaveFromWillLoad
public void SaveFromWillLoad(ILGenerator ilGenerator, Action<ILGenerator> pushWriter, Action<ILGenerator> pushValue)
{
pushWriter(ilGenerator);
pushValue(ilGenerator);
ilGenerator.Call(_saver);
}
示例11: SkipLoad
public void SkipLoad(ILGenerator ilGenerator, Action<ILGenerator> pushReader)
{
pushReader(ilGenerator);
ilGenerator.Call(_skipper);
}
示例12: LoadToWillLoad
public void LoadToWillLoad(ILGenerator ilGenerator, Action<ILGenerator> pushReader)
{
pushReader(ilGenerator);
ilGenerator.Call(_loader);
}
示例13: LoadToSameHandler
public bool LoadToSameHandler(ILGenerator ilGenerator, Action<ILGenerator> pushReader, Action<ILGenerator> pushThis, Type implType, string destFieldName)
{
pushThis(ilGenerator);
pushReader(ilGenerator);
ilGenerator.Call(() => ((AbstractBufferedReader)null).ReadVUInt64());
var fieldInfo = implType.GetField("_FieldStorage_" + destFieldName);
ilGenerator.Stfld(fieldInfo);
return true;
}
示例14: SkipLoad
public void SkipLoad(ILGenerator ilGenerator, Action<ILGenerator> pushReader)
{
pushReader(ilGenerator);
ilGenerator.Call(() => ((AbstractBufferedReader)null).SkipVUInt64());
}
示例15: AppendReadField
public override void AppendReadField(ILGenerator il)
{
il.Call<MessageReader>("ReadString");
}