using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Reflection.Metadata; using System.Text; namespace Cosmos.IL2CPU.ILOpCodes { public class OpDouble : ILOpCode { public readonly double Value; public OpDouble(Code aOpCode, int aPos, int aNextPos, double aValue, _ExceptionRegionInfo aCurrentExceptionRegion) : base(aOpCode, aPos, aNextPos, aCurrentExceptionRegion) { Value = aValue; } public override int GetNumberOfStackPops(MethodBase aMethod) { switch (OpCode) { case Code.Ldc_R8: return 0; default: throw new NotImplementedException("OpCode '" + OpCode + "' not implemented!"); } } public override int GetNumberOfStackPushes(MethodBase aMethod) { switch (OpCode) { case Code.Ldc_R8: return 1; default: throw new NotImplementedException("OpCode '" + OpCode + "' not implemented!"); } } protected override void DoInitStackAnalysis(MethodBase aMethod) { base.DoInitStackAnalysis(aMethod); switch (OpCode) { case Code.Ldc_R8: StackPushTypes[0] = typeof (Double); break; default: break; } } } }