Cosmos/source/Compiler/Indy.IL2CPU.X86/IL/x86/Ldelem.cs
2009-06-14 11:31:06 +00:00

34 lines
No EOL
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Indy.IL2CPU.Assembler;
using Indy.IL2CPU.Compiler;
namespace Indy.IL2CPU.IL.X86 {
[OpCode(OpCodeEnum.Ldelem)]
public class Ldelem: Op {
private Type mType;
//public static void ScanOp(ILReader aReader, MethodInformation aMethodInfo, SortedList<string, object> aMethodData)
//{
// Type xType = aReader.OperandValueType;
// if (xType == null)
// throw new Exception("Unable to determine Type!");
// Engine.RegisterType(xType);
//}
public Ldelem(ILReader aReader, MethodInformation aMethodInfo)
: base(aReader, aMethodInfo) {
mType = aReader.OperandValueType;
if (mType == null)
throw new Exception("Unable to determine Type!");
}
public override void DoAssemble() {
var xElementSize = GetService<IMetaDataInfoService>().GetFieldStorageSize(mType);
new Comment("Element size: " + xElementSize);
Ldelem_Ref.Assemble(Assembler, xElementSize);
}
}
}