80 lines
3.3 KiB
C#
80 lines
3.3 KiB
C#
using System;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace System.Runtime.CompilerServices
|
|
{
|
|
/// <summary>Represents the runtime state of a dynamically generated method.</summary>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x0200004B RID: 75
|
|
public class ExecutionScope
|
|
{
|
|
// Token: 0x0600044D RID: 1101 RVA: 0x00014648 File Offset: 0x00012848
|
|
private ExecutionScope(CompilationContext context, int compilation_unit)
|
|
{
|
|
this.context = context;
|
|
this.compilation_unit = compilation_unit;
|
|
this.Globals = context.GetGlobals();
|
|
}
|
|
|
|
// Token: 0x0600044E RID: 1102 RVA: 0x00014678 File Offset: 0x00012878
|
|
internal ExecutionScope(CompilationContext context)
|
|
: this(context, 0)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600044F RID: 1103 RVA: 0x00014684 File Offset: 0x00012884
|
|
internal ExecutionScope(CompilationContext context, int compilation_unit, ExecutionScope parent, object[] locals)
|
|
: this(context, compilation_unit)
|
|
{
|
|
this.Parent = parent;
|
|
this.Locals = locals;
|
|
}
|
|
|
|
/// <summary>Creates a delegate that can be used to execute a dynamically generated method.</summary>
|
|
/// <returns>A <see cref="T:System.Delegate" /> that can execute a dynamically generated method.</returns>
|
|
/// <param name="indexLambda">The index of the object that stores information about associated lambda expression of the dynamic method.</param>
|
|
/// <param name="locals">An array that contains the hoisted local variables from the parent context.</param>
|
|
// Token: 0x06000450 RID: 1104 RVA: 0x000146A0 File Offset: 0x000128A0
|
|
public Delegate CreateDelegate(int indexLambda, object[] locals)
|
|
{
|
|
return this.context.CreateDelegate(indexLambda, new ExecutionScope(this.context, indexLambda, this, locals));
|
|
}
|
|
|
|
/// <summary>Creates an array to store the hoisted local variables.</summary>
|
|
/// <returns>An array to store hoisted local variables.</returns>
|
|
// Token: 0x06000451 RID: 1105 RVA: 0x000146BC File Offset: 0x000128BC
|
|
public object[] CreateHoistedLocals()
|
|
{
|
|
return this.context.CreateHoistedLocals(this.compilation_unit);
|
|
}
|
|
|
|
/// <summary>Frees a specified expression tree of external parameter references by replacing the parameter with its current value.</summary>
|
|
/// <returns>An expression tree that does not contain external parameter references.</returns>
|
|
/// <param name="expression">An expression tree to free of external parameter references.</param>
|
|
/// <param name="locals">An array that contains the hoisted local variables.</param>
|
|
// Token: 0x06000452 RID: 1106 RVA: 0x000146D0 File Offset: 0x000128D0
|
|
public Expression IsolateExpression(Expression expression, object[] locals)
|
|
{
|
|
return this.context.IsolateExpression(this, locals, expression);
|
|
}
|
|
|
|
/// <summary>Represents the non-trivial constants and locally executable expressions that are referenced by a dynamically generated method.</summary>
|
|
// Token: 0x040000FD RID: 253
|
|
public object[] Globals;
|
|
|
|
/// <summary>Represents the hoisted local variables from the parent context.</summary>
|
|
// Token: 0x040000FE RID: 254
|
|
public object[] Locals;
|
|
|
|
/// <summary>Represents the execution scope of the calling delegate.</summary>
|
|
// Token: 0x040000FF RID: 255
|
|
public ExecutionScope Parent;
|
|
|
|
// Token: 0x04000100 RID: 256
|
|
internal CompilationContext context;
|
|
|
|
// Token: 0x04000101 RID: 257
|
|
internal int compilation_unit;
|
|
}
|
|
}
|