本文整理汇总了C#中CodeGen.EmitPropertyGet方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGen.EmitPropertyGet方法的具体用法?C# CodeGen.EmitPropertyGet怎么用?C# CodeGen.EmitPropertyGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGen
的用法示例。
在下文中一共展示了CodeGen.EmitPropertyGet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitGetStorageFromContext
public override void EmitGetStorageFromContext(CodeGen cg)
{
cg.EmitCodeContext();
cg.EmitPropertyGet(typeof(CodeContext), "Scope");
cg.EmitCall(typeof(RuntimeHelpers).GetMethod("GetStorageData").MakeGenericMethod(StorageType));
}
示例2: EmitNewEnvironment
public override void EmitNewEnvironment(CodeGen cg)
{
ConstructorInfo ctor = EnvironmentType.GetConstructor(new Type[] {StorageType});
// emit: dict.Tuple[.Item000...].Item000 = dict, and then leave dict on the stack
cg.EmitNew(ctor);
cg.Emit(OpCodes.Dup);
Slot tmp = cg.GetLocalTmp(EnvironmentType);
tmp.EmitSet(cg);
cg.EmitPropertyGet(EnvironmentType, "Data");
var fld = StorageType.GetField("$parent$");
//cg.EmitFieldGet(fld);
tmp.EmitGet(cg);
cg.EmitFieldSet(fld);
cg.FreeLocalTmp(tmp);
}
示例3: EmitNestedTupleInit
private static void EmitNestedTupleInit(CodeGen cg, Type storageType)
{
if (Tuple.GetSize(storageType) > Tuple.MaxSize)
{
Slot tmp = cg.GetLocalTmp(storageType);
tmp.EmitSet(cg);
Type[] nestedTuples = storageType.GetGenericArguments();
for (int i = 0; i < nestedTuples.Length; i++)
{
Type t = nestedTuples[i];
if (t.IsSubclassOf(typeof(Tuple)))
{
tmp.EmitGet(cg);
cg.EmitNew(t.GetConstructor(ArrayUtils.EmptyTypes));
cg.EmitPropertySet(storageType, String.Format("Item{0:D3}", i));
tmp.EmitGet(cg);
cg.EmitPropertyGet(storageType, String.Format("Item{0:D3}", i));
EmitNestedTupleInit(cg, t);
}
}
cg.FreeLocalTmp(tmp);
}
else
{
int capacity = 0;
foreach (Type t in storageType.GetGenericArguments())
{
if (t == typeof(None))
{
break;
}
capacity++;
}
cg.EmitInt(capacity);
cg.EmitCall(typeof(RuntimeHelpers), "UninitializeEnvironmentTuple");
}
}
示例4: Emit
public override void Emit(CodeGen cg) {
// emit "this", if any
EmitInstance(cg);
if (ScriptDomainManager.Options.LightweightDebugging && Span.IsValid)
{
cg.EmitConstant(SpanToLong(Span));
cg.EmitCall(Debugging.DebugMethods.ExpressionIn);
}
EmitLocation(cg);
switch (_member.MemberType) {
case MemberTypes.Field:
FieldInfo field = (FieldInfo)_member;
cg.EmitFieldGet(field);
break;
case MemberTypes.Property:
PropertyInfo property = (PropertyInfo)_member;
cg.EmitPropertyGet(property);
break;
default:
Debug.Assert(false, "Invalid member type");
break;
}
if (ScriptDomainManager.Options.LightweightDebugging && Span.IsValid)
{
cg.EmitConstant(SpanToLong(Span));
cg.EmitCall(Debugging.DebugMethods.ExpressionOut);
}
}
示例5: EmitGetRaw
public void EmitGetRaw(CodeGen cg)
{
_wrapper.EmitGet(cg);
cg.EmitPropertyGet(typeof(ModuleGlobalWrapper), "RawValue");
}
示例6: EmitGet
public override void EmitGet(CodeGen cg)
{
_wrapper.EmitGet(cg);
cg.EmitPropertyGet(typeof(ModuleGlobalWrapper), "CurrentValue");
}