本文整理汇总了C#中CodeGen.EmitGetHelper方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGen.EmitGetHelper方法的具体用法?C# CodeGen.EmitGetHelper怎么用?C# CodeGen.EmitGetHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGen
的用法示例。
在下文中一共展示了CodeGen.EmitGetHelper方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadArrayAndIndexes
void LoadArrayAndIndexes(CodeGen g)
{
array.EmitGet(g);
foreach (Operand op in indexes)
g.EmitGetHelper(op, Operand.GetType(op) == typeof(int) ? typeof(int) : typeof(long), false);
}
示例2: EmitSet
protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
{
OperandExtensions.SetLeakedState(this, false);
if (!_fi.IsStatic)
_target.EmitRef(g);
g.EmitGetHelper(value, GetReturnType(g.TypeMapper), allowExplicitConversion);
g.IL.Emit(_fi.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, _fi);
}
示例3: LoadArrayAndIndexes
void LoadArrayAndIndexes(CodeGen g)
{
if (_array.GetReturnType(g.TypeMapper).GetArrayRank() != _indexes.Length)
throw new ArgumentException(Properties.Messages.ErrIndexCountMismatch);
_array.EmitGet(g);
foreach (Operand op in _indexes)
g.EmitGetHelper(op, g.TypeMapper.MapType(Helpers.AreTypesEqual(GetType(op, g.TypeMapper), typeof(int), g.TypeMapper) ? typeof(int) : typeof(long)), false);
}
示例4: EmitSet
internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
{
PropertyInfo pi = (PropertyInfo)property.Method.Member;
MethodInfo mi = pi.GetSetMethod(true);
if (mi == null)
{
base.EmitSet(g, value, allowExplicitConversion);
return;
}
if (!mi.IsStatic)
target.EmitRef(g);
property.EmitArgs(g, indexes);
g.EmitGetHelper(value, Type, allowExplicitConversion);
g.EmitCallHelper(mi, target);
}
示例5: EmitGet
internal override void EmitGet(CodeGen g)
{
for (int i = 0; i < indexes.Length; i++)
g.EmitGetHelper(indexes[i], typeof(int), false);
if (indexes.Length == 1)
g.IL.Emit(OpCodes.Newarr, t);
else
{
Type[] argTypes = new Type[indexes.Length];
for (int i = 0; i < argTypes.Length; i++)
argTypes[i] = typeof(int);
ModuleBuilder mb = t.Module as ModuleBuilder;
if (mb != null)
g.IL.Emit(OpCodes.Newobj, mb.GetArrayMethod(Type, ".ctor", CallingConventions.HasThis, null, argTypes));
else
g.IL.Emit(OpCodes.Newobj, Type.GetConstructor(argTypes));
}
}
示例6: EmitGet
protected internal override void EmitGet(CodeGen g)
{
OperandExtensions.SetLeakedState(this, false);
for (int i = 0; i < _indexes.Length; i++)
g.EmitGetHelper(_indexes[i], g.TypeMapper.MapType(typeof(int)), false);
if (_indexes.Length == 1)
g.IL.Emit(OpCodes.Newarr, _t);
else
{
Type[] argTypes = new Type[_indexes.Length];
for (int i = 0; i < argTypes.Length; i++)
argTypes[i] = g.TypeMapper.MapType(typeof(int));
#if !PHONE8
ModuleBuilder mb = _t.Module as ModuleBuilder;
if (mb != null)
g.IL.Emit(OpCodes.Newobj, mb.GetArrayMethod(GetReturnType(g.TypeMapper), ".ctor", CallingConventions.HasThis, null, argTypes));
else
#endif
g.IL.Emit(OpCodes.Newobj, GetReturnType(g.TypeMapper).GetConstructor(argTypes));
}
}
示例7: EmitGet
protected internal override void EmitGet(CodeGen g)
{
OperandExtensions.SetLeakedState(this, false);
g.EmitGetHelper(_target, g.TypeMapper.MapType(typeof(object)), false);
g.IL.Emit(OpCodes.Ldftn, _method);
g.IL.Emit(OpCodes.Newobj, _delegateConstructor);
}
示例8: EmitSet
protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
{
OperandExtensions.SetLeakedState(this, false);
LoadArrayAndIndexes(g);
if (_indexes.Length == 1)
{
g.EmitStelemHelper(GetReturnType(g.TypeMapper), value, allowExplicitConversion);
}
else
{
g.EmitGetHelper(value, GetReturnType(g.TypeMapper), allowExplicitConversion);
g.EmitCallHelper(
(MethodBase)g.TypeMapper.TypeInfo.FindMethod(
_array.GetReturnType(g.TypeMapper),
"Set",
ArrayUtils.Combine(_indexes, value),
false).Method.Member,
_array);
}
}
示例9: EmitSet
protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
{
OperandExtensions.SetLeakedState(this, false);
PropertyInfo pi = (PropertyInfo)_property.Method.Member;
MethodInfo mi = pi.GetSetMethod(true);
if (mi == null)
{
base.EmitSet(g, value, allowExplicitConversion);
return;
}
if (!mi.IsStatic)
_target.EmitRef(g);
_property.EmitArgs(g, _indexes);
g.EmitGetHelper(value, GetReturnType(g.TypeMapper), allowExplicitConversion);
g.EmitCallHelper(mi, _target);
}
示例10: EmitGet
internal override void EmitGet(CodeGen g)
{
g.EmitGetHelper(op, t, true);
}
示例11: EmitGet
protected internal override void EmitGet(CodeGen g)
{
OperandExtensions.SetLeakedState(this, false);
g.EmitGetHelper(_op, _t, true);
}
示例12: EmitSet
internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
{
if (!fi.IsStatic)
target.EmitRef(g);
g.EmitGetHelper(value, Type, allowExplicitConversion);
g.IL.Emit(fi.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, fi);
}
示例13: EmitGet
internal override void EmitGet(CodeGen g)
{
g.EmitGetHelper(target, typeof(object), false);
g.IL.Emit(OpCodes.Ldftn, method);
g.IL.Emit(OpCodes.Newobj, delegateConstructor);
}