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"; string prefix = "\t\t";
if (x is Label) { if (x is Label) {
mOutputWriter.WriteLine(); mOutputWriter.WriteLine();
prefix = " "; prefix = "\t";
} }
mOutputWriter.WriteLine(prefix + x); mOutputWriter.WriteLine(prefix + x);
} }

View file

@ -3,24 +3,19 @@ using System.IO;
using Mono.Cecil; using Mono.Cecil;
using Mono.Cecil.Cil; using Mono.Cecil.Cil;
using CPU = Indy.IL2CPU.Assembler.X86; using CPU = Indy.IL2CPU.Assembler.X86;
using Asm = Indy.IL2CPU.Assembler;
namespace Indy.IL2CPU.IL.X86 { namespace Indy.IL2CPU.IL.X86 {
[OpCode(Code.Newobj)] [OpCode(Code.Newobj)]
public class Newobj: Op { public class Newobj: Op {
public readonly string CtorName;
public Newobj(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo) public Newobj(Mono.Cecil.Cil.Instruction aInstruction, MethodInformation aMethodInfo)
: base(aInstruction, 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() { public override void Assemble() {
//TODO: Call the other assemble Call(CtorName);
throw new NotImplementedException("This file has been autogenerated and not been changed afterwards!");
} }
} }
} }

View file

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