Microsoft\Scripting\Ast\BlockExpression.cs (33)
49public ReadOnlyCollection<ParameterExpression> Variables {
100public BlockExpression Update(IEnumerable<ParameterExpression> variables, IEnumerable<Expression> expressions) {
122internal virtual ParameterExpression GetVariable(int index) {
132internal virtual ReadOnlyCollection<ParameterExpression> GetOrMakeVariables() {
133return EmptyReadOnlyCollection<ParameterExpression>.Instance;
146internal virtual BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
208internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
245internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
284internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
325internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
358internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
366private IList<ParameterExpression> _variables; // list of variables or ReadOnlyCollection if the user has accessed the readonly collection
368internal ScopeExpression(IList<ParameterExpression> variables) {
378internal override ParameterExpression GetVariable(int index) {
382internal override ReadOnlyCollection<ParameterExpression> GetOrMakeVariables() {
386protected IList<ParameterExpression> VariablesList {
393internal IList<ParameterExpression> ReuseOrValidateVariables(ReadOnlyCollection<ParameterExpression> variables) {
407internal Scope1(IList<ParameterExpression> variables, Expression body)
429internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
440internal ScopeN(IList<ParameterExpression> variables, IList<Expression> body)
459internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
470internal ScopeWithType(IList<ParameterExpression> variables, IList<Expression> expressions, Type type)
479internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables, Expression[] args) {
700return Block(EmptyReadOnlyCollection<ParameterExpression>.Instance, expressions);
721return Block(type, EmptyReadOnlyCollection<ParameterExpression>.Instance, expressions);
730public static BlockExpression Block(IEnumerable<ParameterExpression> variables, params Expression[] expressions) {
741public static BlockExpression Block(Type type, IEnumerable<ParameterExpression> variables, params Expression[] expressions) {
751public static BlockExpression Block(IEnumerable<ParameterExpression> variables, IEnumerable<Expression> expressions) {
767public static BlockExpression Block(Type type, IEnumerable<ParameterExpression> variables, IEnumerable<Expression> expressions) {
797internal static void ValidateVariables(ReadOnlyCollection<ParameterExpression> varList, string collectionName) {
803var set = new Set<ParameterExpression>(count);
805ParameterExpression v = varList[i];
Microsoft\Scripting\Ast\CatchBlock.cs (10)
39private readonly ParameterExpression _var;
43internal CatchBlock(Type test, ParameterExpression variable, Expression body, Expression filter) {
53public ParameterExpression Variable {
97public CatchBlock Update(ParameterExpression variable, Expression filter, Expression body) {
121/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param>
124public static CatchBlock Catch(ParameterExpression variable, Expression body) {
145/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param>
149public static CatchBlock Catch(ParameterExpression variable, Expression body, Expression filter) {
158/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param>
163public static CatchBlock MakeCatchBlock(Type type, ParameterExpression variable, Expression body, Expression filter) {
Microsoft\Scripting\Ast\LambdaExpression.cs (52)
50private readonly ReadOnlyCollection<ParameterExpression> _parameters;
59ReadOnlyCollection<ParameterExpression> parameters
90public ReadOnlyCollection<ParameterExpression> Parameters {
191internal Expression(Expression body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
226public Expression<TDelegate> Update(Expression body, IEnumerable<ParameterExpression> parameters) {
244internal static LambdaExpression Create(Expression body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters) {
256internal static LambdaExpression CreateLambda(Type delegateType, Expression body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters) {
287/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
289public static Expression<TDelegate> Lambda<TDelegate>(Expression body, params ParameterExpression[] parameters) {
290return Lambda<TDelegate>(body, false, (IEnumerable<ParameterExpression>)parameters);
299/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
301public static Expression<TDelegate> Lambda<TDelegate>(Expression body, bool tailCall, params ParameterExpression[] parameters) {
302return Lambda<TDelegate>(body, tailCall, (IEnumerable<ParameterExpression>)parameters);
310/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
312public static Expression<TDelegate> Lambda<TDelegate>(Expression body, IEnumerable<ParameterExpression> parameters) {
322/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
324public static Expression<TDelegate> Lambda<TDelegate>(Expression body, bool tailCall, IEnumerable<ParameterExpression> parameters) {
333/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
336public static Expression<TDelegate> Lambda<TDelegate>(Expression body, String name, IEnumerable<ParameterExpression> parameters) {
346/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
349public static Expression<TDelegate> Lambda<TDelegate>(Expression body, String name, bool tailCall, IEnumerable<ParameterExpression> parameters) {
360/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
362public static LambdaExpression Lambda(Expression body, params ParameterExpression[] parameters) {
363return Lambda(body, false, (IEnumerable<ParameterExpression>)parameters);
371/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
373public static LambdaExpression Lambda(Expression body, bool tailCall, params ParameterExpression[] parameters) {
374return Lambda(body, tailCall, (IEnumerable<ParameterExpression>)parameters);
381/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
383public static LambdaExpression Lambda(Expression body, IEnumerable<ParameterExpression> parameters) {
392/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
394public static LambdaExpression Lambda(Expression body, bool tailCall, IEnumerable<ParameterExpression> parameters) {
402/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
405public static LambdaExpression Lambda(Type delegateType, Expression body, params ParameterExpression[] parameters) {
414/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
417public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, params ParameterExpression[] parameters) {
425/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
428public static LambdaExpression Lambda(Type delegateType, Expression body, IEnumerable<ParameterExpression> parameters) {
437/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
440public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, IEnumerable<ParameterExpression> parameters) {
448/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
451public static LambdaExpression Lambda(Expression body, string name, IEnumerable<ParameterExpression> parameters) {
461/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
463public static LambdaExpression Lambda(Expression body, string name, bool tailCall, IEnumerable<ParameterExpression> parameters) {
471var set = new Set<ParameterExpression>(parameterList.Count);
473var param = parameterList[i];
493/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
497public static LambdaExpression Lambda(Type delegateType, Expression body, string name, IEnumerable<ParameterExpression> parameters) {
511/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="P:Parameters"/> collection. </param>
513public static LambdaExpression Lambda(Type delegateType, Expression body, string name, bool tailCall, IEnumerable<ParameterExpression> parameters) {
520private static void ValidateLambdaArgs(Type delegateType, ref Expression body, ReadOnlyCollection<ParameterExpression> parameters) {
543var set = new Set<ParameterExpression>(pis.Length);
545ParameterExpression pex = parameters[i];
Microsoft\Scripting\Compiler\CompilerScope.cs (24)
79internal readonly Dictionary<ParameterExpression, VariableStorageKind> Definitions = new Dictionary<ParameterExpression, VariableStorageKind>();
85internal Dictionary<ParameterExpression, int> ReferenceCount;
109private readonly Dictionary<ParameterExpression, Storage> _locals = new Dictionary<ParameterExpression, Storage>();
116Definitions = new Dictionary<ParameterExpression, VariableStorageKind>(variables.Count);
117foreach (var v in variables) {
177internal void EmitVariableAccess(LambdaCompiler lc, ReadOnlyCollection<ParameterExpression> vars) {
182foreach (var variable in vars) {
219internal void AddLocal(LambdaCompiler gen, ParameterExpression variable) {
223internal void EmitGet(ParameterExpression variable) {
227internal void EmitSet(ParameterExpression variable) {
231internal void EmitAddressOf(ParameterExpression variable) {
235private Storage ResolveVariable(ParameterExpression variable) {
243private Storage ResolveVariable(ParameterExpression variable, HoistedLocals hoistedLocals) {
308foreach (ParameterExpression v in _hoistedLocals.Variables) {
364private bool ShouldCache(ParameterExpression v, int refCount) {
371private bool ShouldCache(ParameterExpression v) {
380private void CacheBoxToLocal(LambdaCompiler lc, ParameterExpression v) {
396var v = locals.SelfVariable;
412foreach (ParameterExpression v in GetVariables()) {
432private IList<ParameterExpression> GetVariables() {
437var list = new List<ParameterExpression>(vars);
444private static IList<ParameterExpression> GetVariables(object scope) {