Exemplo n.º 1
0
        protected static void EmitValueTypeLoadAddress(FleeIlGenerator ilg, Type targetType)
        {
            var index = ilg.GetTempLocalIndex(targetType);

            Utility.EmitStoreLocal(ilg, index);
            ilg.Emit(OpCodes.Ldloca_S, (byte)index);
        }
Exemplo n.º 2
0
        private void EmitVirtualPropertyLoad(FleeIlGenerator ilg)
        {
            var index = ilg.GetTempLocalIndex(this.myPrevious.ResultType);

            Utility.EmitStoreLocal(ilg, index);
            EmitLoadVariables(ilg);
            ilg.Emit(OpCodes.Ldstr, this.myName);
            Utility.EmitLoadLocal(ilg, index);
            ImplicitConverter.EmitImplicitConvert(this.myPrevious.ResultType, typeof(object), ilg);
            var mi = VariableCollection.GetVirtualPropertyLoadMethod(this.ResultType);

            this.EmitMethodCall(mi, ilg);
        }
Exemplo n.º 3
0
        public override void Emit(FleeIlGenerator ilg, IServiceProvider services)
        {
            var index = ilg.GetTempLocalIndex(typeof(TimeSpan));

            Utility.EmitLoadLocalAddress(ilg, index);
            EmitLoad(this.myValue.Ticks, ilg);
            var ci = typeof(TimeSpan).GetConstructor(new[]
            {
                typeof(long)
            });

            ilg.Emit(OpCodes.Call, ci);
            Utility.EmitLoadLocal(ilg, index);
        }
Exemplo n.º 4
0
        public override void Emit(FleeIlGenerator ilg, IServiceProvider services)
        {
            var index = ilg.GetTempLocalIndex(typeof(decimal));

            Utility.EmitLoadLocalAddress(ilg, index);
            var bits = decimal.GetBits(this.myValue);

            EmitLoad(bits[0], ilg);
            EmitLoad(bits[1], ilg);
            EmitLoad(bits[2], ilg);
            var flags = bits[3];

            EmitLoad(flags >> 31 == -1, ilg);
            EmitLoad(flags >> 16, ilg);
            ilg.Emit(OpCodes.Call, ourConstructorInfo);
            Utility.EmitLoadLocal(ilg, index);
        }