This commit is contained in:
kudzu_cp 2009-09-09 18:59:54 +00:00
parent 1d146df185
commit 13ab61a6ac
2 changed files with 35 additions and 66 deletions

View file

@ -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)
{ : base(aAsmblr) {
public Conv_Ovf_I4(Cosmos.IL2CPU.Assembler 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);
// }
// }
// }
}
} }

View file

@ -127,9 +127,9 @@ namespace Cosmos.IL2CPU {
if (xEnabled) { if (xEnabled) {
// for PlugMethodAttribute: // for PlugMethodAttribute:
//TODO: public string Signature; //TODO: public string Signature;
//[PlugMethod(Signature = "System_Void__Indy_IL2CPU_Assembler_Assembler__cctor__")] //[PlugMethod(Signature = "System_Void__Indy_IL2CPU_Assembler_Assembler__cctor__")]
//TODO: public Type Assembler = null; //TODO: public Type Assembler = null;
// Scan the plug implementation // Scan the plug implementation
uint xUID = ExecuteInternal(xMethod, true); uint xUID = ExecuteInternal(xMethod, true);
@ -198,25 +198,25 @@ namespace Cosmos.IL2CPU {
} }
//TODO: Look for Field plugs //TODO: Look for Field plugs
} }
// register any "system" types:
QueueType(typeof(Array));
} }
ExecuteInternal( ( System.Reflection.MethodInfo )RuntimeEngineRefs.InitializeApplicationRef, true ); // Manually register certain system types
ExecuteInternal( ( System.Reflection.MethodInfo )RuntimeEngineRefs.FinalizeApplicationRef, true ); QueueType(typeof(Array));
// Pull in extra implementations, GC etc.
ExecuteInternal((System.Reflection.MethodInfo)RuntimeEngineRefs.InitializeApplicationRef, true);
ExecuteInternal((System.Reflection.MethodInfo)RuntimeEngineRefs.FinalizeApplicationRef, true);
////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"), true); ////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"), true);
ExecuteInternal( ( System.Reflection.MethodInfo )VTablesImplRefs.LoadTypeTableRef, true ); ExecuteInternal((System.Reflection.MethodInfo)VTablesImplRefs.LoadTypeTableRef, true);
ExecuteInternal( ( System.Reflection.MethodInfo )VTablesImplRefs.SetMethodInfoRef, true ); ExecuteInternal((System.Reflection.MethodInfo)VTablesImplRefs.SetMethodInfoRef, true);
ExecuteInternal( ( System.Reflection.MethodInfo )VTablesImplRefs.IsInstanceRef, true ); ExecuteInternal((System.Reflection.MethodInfo)VTablesImplRefs.IsInstanceRef, true);
ExecuteInternal( ( System.Reflection.MethodInfo )VTablesImplRefs.SetTypeInfoRef, true ); ExecuteInternal((System.Reflection.MethodInfo)VTablesImplRefs.SetTypeInfoRef, true);
ExecuteInternal( ( System.Reflection.MethodInfo )VTablesImplRefs.GetMethodAddressForTypeRef, true ); ExecuteInternal((System.Reflection.MethodInfo)VTablesImplRefs.GetMethodAddressForTypeRef, true);
ExecuteInternal( ( System.Reflection.MethodInfo )GCImplementationRefs.IncRefCountRef, true ); ExecuteInternal((System.Reflection.MethodInfo)GCImplementationRefs.IncRefCountRef, true);
ExecuteInternal( ( System.Reflection.MethodInfo )GCImplementationRefs.DecRefCountRef, true ); ExecuteInternal((System.Reflection.MethodInfo)GCImplementationRefs.DecRefCountRef, true);
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;
} }