Пример #1
0
		protected override Expr VisitLoadArg (ExprLoadArg e)
		{
			this.Emit (e, () => {
				int index = e.Index;
				switch (index) {
				case 0:
					return this.il.Create (OpCodes.Ldarg_0);
				case 1:
					return this.il.Create (OpCodes.Ldarg_1);
				case 2:
					return this.il.Create (OpCodes.Ldarg_2);
				case 3:
					return this.il.Create (OpCodes.Ldarg_3);
				default:
					if (e.Index <= 255) {
						return this.il.Create (OpCodes.Ldarg_S, (byte) index);
					} else {
						return this.il.Create (OpCodes.Ldarg, index);
					}
				}
				// Required due to bug in compiler
				throw new NotSupportedException();
			});
			
			return e;
		}
Пример #2
0
		protected override Expr VisitLoadArg (ExprLoadArg e)
		{
			this.Emit (e, () => {
				int index = e.Index;
				switch (index) {
				case 0:
					return this.il.Create (OpCodes.Ldarg_0);
				case 1:
					return this.il.Create (OpCodes.Ldarg_1);
				case 2:
					return this.il.Create (OpCodes.Ldarg_2);
				case 3:
					return this.il.Create (OpCodes.Ldarg_3);
				default:
					if (e.Index <= 255) {
						return this.il.Create (OpCodes.Ldarg_S, (byte) index);
					} else {
						return this.il.Create (OpCodes.Ldarg, index);
					}
				}
			});
			
			return e;
		}
Пример #3
0
		protected virtual Expr VisitLoadArg (ExprLoadArg e)
		{
			return e;
		}