mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-09 09:42:13 +00:00
This commit is contained in:
parent
1d146df185
commit
13ab61a6ac
2 changed files with 35 additions and 66 deletions
|
|
@ -1,44 +1,15 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Cosmos.IL2CPU.X86.IL
|
namespace Cosmos.IL2CPU.X86.IL {
|
||||||
{
|
|
||||||
[Cosmos.IL2CPU.OpCode(ILOpCode.Code.Conv_Ovf_I4)]
|
[Cosmos.IL2CPU.OpCode(ILOpCode.Code.Conv_Ovf_I4)]
|
||||||
public class Conv_Ovf_I4: ILOp
|
public class Conv_Ovf_I4 : ILOp {
|
||||||
{
|
public Conv_Ovf_I4(Cosmos.IL2CPU.Assembler aAsmblr)
|
||||||
public Conv_Ovf_I4(Cosmos.IL2CPU.Assembler aAsmblr):base(aAsmblr)
|
: base(aAsmblr) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Execute(MethodInfo aMethod, ILOpCode aOpCode) {
|
public override void Execute(MethodInfo aMethod, ILOpCode aOpCode) {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// using System;
|
|
||||||
// using System.IO;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// using CPU = Cosmos.IL2CPU.X86;
|
|
||||||
//
|
|
||||||
// namespace Indy.IL2CPU.IL.X86 {
|
|
||||||
// [OpCode(OpCodeEnum.Conv_Ovf_I4)]
|
|
||||||
// public class Conv_Ovf_I4: Op {
|
|
||||||
// private string mNextLabel;
|
|
||||||
// private string mCurLabel;
|
|
||||||
// private uint mCurOffset;
|
|
||||||
// private MethodInformation mMethodInformation;
|
|
||||||
// public Conv_Ovf_I4(ILReader aReader, MethodInformation aMethodInfo)
|
|
||||||
// : base(aReader, aMethodInfo) {
|
|
||||||
// mMethodInformation = aMethodInfo;
|
|
||||||
// mCurOffset = aReader.Position;
|
|
||||||
// mCurLabel = IL.Op.GetInstructionLabel(aReader);
|
|
||||||
// mNextLabel = IL.Op.GetInstructionLabel(aReader.NextPosition);
|
|
||||||
// }
|
|
||||||
// public override void DoAssemble() {
|
|
||||||
// EmitNotImplementedException(Assembler, GetServiceProvider(), "Conv_Ovf_I4: This has not been implemented at all yet!", mCurLabel, mMethodInformation, mCurOffset, mNextLabel);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,10 +198,12 @@ namespace Cosmos.IL2CPU {
|
||||||
}
|
}
|
||||||
//TODO: Look for Field plugs
|
//TODO: Look for Field plugs
|
||||||
}
|
}
|
||||||
// register any "system" types:
|
|
||||||
QueueType(typeof(Array));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manually register certain system types
|
||||||
|
QueueType(typeof(Array));
|
||||||
|
|
||||||
|
// Pull in extra implementations, GC etc.
|
||||||
ExecuteInternal((System.Reflection.MethodInfo)RuntimeEngineRefs.InitializeApplicationRef, true);
|
ExecuteInternal((System.Reflection.MethodInfo)RuntimeEngineRefs.InitializeApplicationRef, true);
|
||||||
ExecuteInternal((System.Reflection.MethodInfo)RuntimeEngineRefs.FinalizeApplicationRef, true);
|
ExecuteInternal((System.Reflection.MethodInfo)RuntimeEngineRefs.FinalizeApplicationRef, true);
|
||||||
////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"), true);
|
////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"), true);
|
||||||
|
|
@ -215,8 +217,6 @@ namespace Cosmos.IL2CPU {
|
||||||
ExecuteInternal((System.Reflection.MethodInfo)GCImplementationRefs.AllocNewObjectRef, true);
|
ExecuteInternal((System.Reflection.MethodInfo)GCImplementationRefs.AllocNewObjectRef, true);
|
||||||
|
|
||||||
// Scan from entry point of this program
|
// Scan from entry point of this program
|
||||||
//TODO: Now that we scan plugs first, we might need to put a jump
|
|
||||||
// in the asm to jump to the entry point?
|
|
||||||
ExecuteInternal(aStartMethod, false);
|
ExecuteInternal(aStartMethod, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -352,17 +352,15 @@ namespace Cosmos.IL2CPU {
|
||||||
var xMethod = new MethodInfo(aMethodBase, xResult, xMethodType, xPlug);
|
var xMethod = new MethodInfo(aMethodBase, xResult, xMethodType, xPlug);
|
||||||
mMethodsToProcess.Add(xMethod);
|
mMethodsToProcess.Add(xMethod);
|
||||||
|
|
||||||
//TODO: Might still need this one, see after we get assembly output again
|
// Queue Types directly related to method
|
||||||
//Im hoping the operand walking we have now will include this on its own.
|
QueueType(aMethodBase.DeclaringType);
|
||||||
//QueueType(aMethod.DeclaringType);
|
if (aMethodBase is System.Reflection.MethodInfo) {
|
||||||
|
QueueType(((System.Reflection.MethodInfo)aMethodBase).ReturnType);
|
||||||
|
}
|
||||||
|
foreach (var xParam in aMethodBase.GetParameters()) {
|
||||||
|
QueueType(xParam.ParameterType);
|
||||||
|
}
|
||||||
|
|
||||||
//var xMethodInfo = aMethod as MethodInfo;
|
|
||||||
//if (xMethodInfo != null) {
|
|
||||||
// QueueType(xMethodInfo.ReturnType);
|
|
||||||
//}
|
|
||||||
//foreach (var xParam in aMethod.GetParameters()) {
|
|
||||||
// QueueType(xParam.ParameterType);
|
|
||||||
//}
|
|
||||||
return xResult;
|
return xResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue