mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-30 04:40:14 +00:00
57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
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, System.Reflection.ExceptionHandlingClause aCurrentExceptionHandler)
|
|
: base(aOpCode, aPos, aNextPos, aCurrentExceptionHandler) {
|
|
Value = aValue;
|
|
}
|
|
|
|
public override int NumberOfStackPops
|
|
{
|
|
get
|
|
{
|
|
switch (OpCode)
|
|
{
|
|
case Code.Ldc_R8:
|
|
return 0;
|
|
default:
|
|
throw new NotImplementedException("OpCode '" + OpCode + "' not implemented!");
|
|
}
|
|
}
|
|
}
|
|
|
|
public override int NumberOfStackPushes
|
|
{
|
|
get
|
|
{
|
|
switch (OpCode)
|
|
{
|
|
case Code.Ldc_R8:
|
|
return 1;
|
|
default:
|
|
throw new NotImplementedException("OpCode '" + OpCode + "' not implemented!");
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void DoInitStackAnalysis()
|
|
{
|
|
base.DoInitStackAnalysis();
|
|
|
|
switch (OpCode)
|
|
{
|
|
case Code.Ldc_R8:
|
|
StackPushTypes[0] = typeof (Double);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|