本文整理汇总了C#中System.Reflection.Emit.LocalBuilder.SetLocalSymInfo方法的典型用法代码示例。如果您正苦于以下问题:C# LocalBuilder.SetLocalSymInfo方法的具体用法?C# LocalBuilder.SetLocalSymInfo怎么用?C# LocalBuilder.SetLocalSymInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.LocalBuilder
的用法示例。
在下文中一共展示了LocalBuilder.SetLocalSymInfo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreBuild
protected override void PreBuild()
{
var cg = CurrentContainer.GainGenerator();
Builder = cg.CreateLocal(DataType);
if (!string.IsNullOrWhiteSpace(Name))
{
Builder.SetLocalSymInfo(Name);
}
}
示例2: DeclareLocals
/// <summary>
/// Creates local variable declarations.
/// </summary>
/// <param name="il">The IL generator to use.</param>
/// <param name="method">The method to proxy.</param>
protected override void DeclareLocals(ILGenerator il, MethodInfo method)
{
base.DeclareLocals(il, method);
target = il.DeclareLocal(typeof(object));
#if DEBUG
target.SetLocalSymInfo("target");
#endif
}
示例3: SetLocalName
internal override void SetLocalName(LocalBuilder localBuilder, string name) {
localBuilder.SetLocalSymInfo(name);
}
示例4: Declare
internal void Declare(ILGenerator ilgen)
{
local = ilgen.DeclareLocal(type);
if (name != null)
{
local.SetLocalSymInfo(name);
}
}
示例5: DeclareLocals
/// <summary>
/// Creates local variable declarations.
/// </summary>
/// <param name="il">The IL generator to use.</param>
/// <param name="method">The method to proxy.</param>
protected virtual void DeclareLocals(ILGenerator il, MethodInfo method)
{
interceptors = il.DeclareLocal(typeof(IList));
targetType = il.DeclareLocal(typeof(Type));
arguments = il.DeclareLocal(typeof(Object[]));
#if NET_2_0
if (method.IsGenericMethodDefinition)
{
genericTargetMethod = il.DeclareLocal(typeof(MethodInfo));
genericOnProxyTargetMethod = il.DeclareLocal(typeof(MethodInfo));
}
#endif
if (methodReturnsValue)
{
returnValue = il.DeclareLocal(method.ReturnType);
}
#if DEBUG
interceptors.SetLocalSymInfo("interceptors");
targetType.SetLocalSymInfo("targetType");
arguments.SetLocalSymInfo("arguments");
#if NET_2_0
if (method.IsGenericMethodDefinition)
{
genericTargetMethod.SetLocalSymInfo("genericTargetMethod");
genericOnProxyTargetMethod.SetLocalSymInfo("genericOnProxyTargetMethod");
}
#endif
if (methodReturnsValue)
{
returnValue.SetLocalSymInfo("returnValue");
}
#endif
}
示例6: MaybSetLocalName
public void MaybSetLocalName(LocalBuilder lb, string name)
{
if (_isDebuggable)
lb.SetLocalSymInfo(name);
}
示例7: DeclareLocals
/// <summary>
/// Creates local variable declarations.
/// </summary>
/// <param name="il">The IL generator to use.</param>
/// <param name="method">The method to proxy.</param>
protected override void DeclareLocals(ILGenerator il, MethodInfo method)
{
base.DeclareLocals(il, method);
targetSource = il.DeclareLocal(typeof(ITargetSourceWrapper));
#if DEBUG
targetSource.SetLocalSymInfo("targetSource");
#endif
}
示例8: Declare
public virtual void Declare(ILGenerator il)
{
if (_local != null) {
throw new InvalidOperationException("Variable " + Name + " is already declared!");
}
_local = il.DeclareLocal(this.Type);
_local.SetLocalSymInfo(Name);
}
示例9: EmitInitHeapEnv
private void EmitInitHeapEnv()
{
if (!HasHeapEnv()) return;
mHeapEnvBuilder = mILGenerator.DeclareLocal(mHeapEnvTypeBuilder);
if (JITInterpreter_DS.Instance().HasSymbolInfo()) {
mHeapEnvBuilder.SetLocalSymInfo(HEAP_ENV_LOCAL_NAME);
}
var constructor = mHeapEnvTypeBuilder.DefineDefaultConstructor(MethodAttributes.Public);
mILGenerator.Emit(OpCodes.Newobj, constructor);
EmitStoreLocal(mILGenerator, mHeapEnvBuilder);
if (mLambdaNode.childrenFreeAddresses.Where(v => v.envIndex > 0).GetEnumerator().MoveNext()) {
var fieldBuilder = mHeapEnvTypeBuilder.DefineField(PREV_ENV_FIELD_NAME, mEnvTypeBuilder, FieldAttributes.Public);
mHeapEnvFieldBuilders[PREV_ENV_FIELD_NAME] = fieldBuilder;
JITInterpreter_DS.EmitLoadLocal(mILGenerator, mHeapEnvBuilder);
JITInterpreter_DS.EmitLoadThis(mILGenerator);
mILGenerator.Emit(OpCodes.Stfld, fieldBuilder);
}
var heapLocals = mLambdaNode.childrenFreeAddresses.Where(a=>a.envIndex == 0).Select(a=>a.index).OrderBy(a=>a).ToList();
foreach (var index in heapLocals) {
var fieldBuilder = mHeapEnvTypeBuilder.DefineField(mLambdaNode.locals[index], typeof(object), FieldAttributes.Public);
mHeapEnvFieldBuilders[mLambdaNode.locals[index]] = fieldBuilder;
if (index < mLambdaNode.formalCount) {
JITInterpreter_DS.EmitLoadLocal(mILGenerator, mHeapEnvBuilder);
JITInterpreter_DS.EmitLoadArg(mILGenerator, HasThisArgument(), mArgBuilders[index]);
mILGenerator.Emit(OpCodes.Stfld, fieldBuilder);
}
}
}