Cosmos/source/Cosmos.IL2CPU/IL/Constrained.cs
2016-09-03 00:40:33 -05:00

34 lines
977 B
C#

using System;
using System.Reflection;
using Cosmos.Assembler;
using Cosmos.IL2CPU.ILOpCodes;
namespace Cosmos.IL2CPU.X86.IL
{
[OpCode(ILOpCode.Code.Constrained)]
public class Constrained : ILOp
{
public Constrained(Assembler.Assembler aAsmblr) : base(aAsmblr)
{
}
public override void Execute(MethodInfo aMethod, ILOpCode aOpCode)
{
var xOpType = aOpCode as OpType;
DoExecute(Assembler, aMethod, aOpCode, xOpType, DebugEnabled);
}
private void DoExecute(Assembler.Assembler assembler, MethodInfo aMethod, ILOpCode aOpCode, OpType aTargetType, bool debugEnabled)
{
new Comment(assembler, $"Type = {aTargetType.Value}");
if (aTargetType.Value.BaseType == typeof(ValueType))
{
}
else if (aTargetType.Value.BaseType == typeof(object))
{
throw new NotImplementedException($"Constrained not implemented for {aTargetType.Value}");
}
}
}
}