This commit is contained in:
mterwoord_cp 2007-09-03 15:08:37 +00:00
parent 494629ea2b
commit 42a470db28
3 changed files with 10 additions and 11 deletions

View file

@ -104,7 +104,7 @@ namespace Indy.IL2CPU.Assembler {
string prefix = "\t\t";
if (x is Label) {
mOutputWriter.WriteLine();
prefix = " ";
prefix = "\t";
}
mOutputWriter.WriteLine(prefix + x);
}

View file

@ -3,24 +3,19 @@ using System.IO;
using Mono.Cecil;
using Mono.Cecil.Cil;
using CPU = Indy.IL2CPU.Assembler.X86;
using Asm = Indy.IL2CPU.Assembler;
namespace Indy.IL2CPU.IL.X86 {
[OpCode(Code.Newobj)]
public class Newobj: Op {
public readonly string CtorName;
public Newobj(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, aMethodInfo) {
CtorName = new Asm.Label(((MethodReference)aInstruction.Operand).Name).Name;
}
/// <summary>
/// This overload takes the label name of the ctor
/// </summary>
/// <param name="aCtor"></param>
public void Assemble(string aCtor) {
new CPU.JumpAlways(aCtor);
}
public override void Assemble() {
//TODO: Call the other assemble
throw new NotImplementedException("This file has been autogenerated and not been changed afterwards!");
Call(CtorName);
}
}
}

View file

@ -139,6 +139,10 @@ namespace Indy.IL2CPU {
if (xMethodDef != null) {
QueueMethod(xMethodDef);
}
var xCtorDef = xReferencedType.Constructors.GetConstructor(false, xMethodReference.Parameters);
if (xCtorDef != null) {
QueueMethod(xCtorDef);
}
break;
}
}