mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-22 22:09:12 +00:00
This commit is contained in:
parent
494629ea2b
commit
42a470db28
3 changed files with 10 additions and 11 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue