EmitLdcI8() 추상적인 개인적인 메소드

abstract private EmitLdcI8 ( FluentEmitter method ) : FluentEmitter
method FluentEmitter
리턴 FluentEmitter
예제 #1
0
        public FluentEmitter Starg(MagicNumberArgument value, params string[] names)
        {
            if (names == null)
            {
                throw new ArgumentNullException(nameof(names));
            }

            var count = names.Length;

            var paramgroups = names
                              .Select(GetParameter)
                              .GroupBy(p => p.ParameterType.GetILType())
                              .OrderBy(pgroup => pgroup.Sum(p => p.Index));

            foreach (var paramgroup in paramgroups)
            {
                var isfirst = true;
                foreach (var param in paramgroup.OrderBy(p => p.Index))
                {
                    if (isfirst)
                    {
                        switch (param.ParameterType.GetILType())
                        {
                        case ILType.I4: value.EmitLdcI4(this); break;

                        case ILType.I8: value.EmitLdcI8(this); break;

                        case ILType.R8: value.EmitLdcR8(this); break;

                        case ILType.R4: value.EmitLdcR4(this); break;

                        default:
                            throw new NotSupportedException(
                                      "variable type must be primitive valuetype in system namespace and convertible to I4, I8, R4 or R8");
                        }
                        isfirst = false;
                    }
                    else
                    {
                        Dup();
                    }
                }
                foreach (var param in paramgroup)
                {
                    Starg((uint)param.Index);
                }
            }

            return(this);
        }
예제 #2
0
		public FluentEmitter Ret(MagicNumberArgument value)
		{
		    // ReSharper disable once SwitchStatementMissingSomeCases
			switch (ReturnType.GetILType())
			{
				case ILType.I4: value.EmitLdcI4(this); break;
				case ILType.I8: value.EmitLdcI8(this); break;
				case ILType.R8: value.EmitLdcR8(this); break;
				case ILType.R4: value.EmitLdcR4(this); break;
				default:
					throw new NotSupportedException(
						"return type must be primitive valuetype and convertible to I4, I8, R4 or R8");
			}
			return Ret();
		}
예제 #3
0
        public FluentEmitter Ret(MagicNumberArgument value)
        {
            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (ReturnType.GetILType())
            {
            case ILType.I4: value.EmitLdcI4(this); break;

            case ILType.I8: value.EmitLdcI8(this); break;

            case ILType.R8: value.EmitLdcR8(this); break;

            case ILType.R4: value.EmitLdcR4(this); break;

            default:
                throw new NotSupportedException(
                          "return type must be primitive valuetype and convertible to I4, I8, R4 or R8");
            }
            return(Ret());
        }
예제 #4
0
		public FluentEmitter Starg(MagicNumberArgument value, params string[] names)
		{
			if (names == null)
				throw new ArgumentNullException(nameof(names));

			var count = names.Length;

			var paramgroups = names
				.Select(GetParameter)
				.GroupBy(p => p.ParameterType.GetILType())
				.OrderBy(pgroup => pgroup.Sum(p => p.Index));

			foreach (var paramgroup in paramgroups)
			{
				var isfirst = true;
				foreach (var param in paramgroup.OrderBy(p => p.Index))
				{
					if (isfirst)
					{
						switch (param.ParameterType.GetILType())
						{
							case ILType.I4: value.EmitLdcI4(this); break;
							case ILType.I8: value.EmitLdcI8(this); break;
							case ILType.R8: value.EmitLdcR8(this); break;
							case ILType.R4: value.EmitLdcR4(this); break;
							default:
								throw new NotSupportedException(
							   "variable type must be primitive valuetype in system namespace and convertible to I4, I8, R4 or R8");
						}
						isfirst = false;
					}
					else
						Dup();
				}
				foreach (var param in paramgroup)
				{
					Starg((uint)param.Index);
				}
			}

			return this;
		}