本文整理汇总了C#中IKVM.Internal.CodeEmitter.LazyEmitPop方法的典型用法代码示例。如果您正苦于以下问题:C# CodeEmitter.LazyEmitPop方法的具体用法?C# CodeEmitter.LazyEmitPop怎么用?C# CodeEmitter.LazyEmitPop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKVM.Internal.CodeEmitter
的用法示例。
在下文中一共展示了CodeEmitter.LazyEmitPop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Generate
internal override void Generate(CodeGenContext context, CodeEmitter ilgen)
{
ilgen.LazyEmitPop();
}
示例2: EmitSetImpl
protected override void EmitSetImpl(CodeEmitter ilgen)
{
// when constant static final fields are updated, the JIT normally doesn't see that (because the
// constant value is inlined), so we emulate that behavior by emitting a Pop
ilgen.LazyEmitPop();
}
示例3: DoEmit
private static void DoEmit(DynamicTypeWrapper.FinishContext context, TypeWrapper wrapper, CodeEmitter ilgen, FieldWrapper field)
{
ConstructorBuilder cb;
bool exists;
lock (map)
{
exists = map.TryGetValue(field, out cb);
}
if (!exists)
{
// note that we don't need to lock here, because we're running as part of FinishCore, which is already protected by a lock
TypeWrapper arfuTypeWrapper = ClassLoaderWrapper.LoadClassCritical("ikvm.internal.IntrinsicAtomicReferenceFieldUpdater");
TypeBuilder tb = wrapper.TypeAsBuilder.DefineNestedType("__<ARFU>_" + field.Name + field.Signature.Replace('.', '/'), TypeAttributes.NestedPrivate | TypeAttributes.Sealed, arfuTypeWrapper.TypeAsBaseType);
EmitCompareAndSet("compareAndSet", tb, field.GetField());
EmitGet(tb, field.GetField());
EmitSet("set", tb, field.GetField());
cb = tb.DefineConstructor(MethodAttributes.Assembly, CallingConventions.Standard, Type.EmptyTypes);
lock (map)
{
map.Add(field, cb);
}
CodeEmitter ctorilgen = CodeEmitter.Create(cb);
ctorilgen.Emit(OpCodes.Ldarg_0);
MethodWrapper basector = arfuTypeWrapper.GetMethodWrapper("<init>", "()V", false);
basector.Link();
basector.EmitCall(ctorilgen);
ctorilgen.Emit(OpCodes.Ret);
context.RegisterPostFinishProc(delegate
{
arfuTypeWrapper.Finish();
tb.CreateType();
});
}
ilgen.LazyEmitPop();
ilgen.LazyEmitPop();
ilgen.LazyEmitPop();
ilgen.Emit(OpCodes.Newobj, cb);
}