This commit is contained in:
mterwoord_cp 2009-09-13 13:18:24 +00:00
parent b36d351023
commit 4067b02db9

View file

@ -150,27 +150,27 @@ namespace Cosmos.IL2CPU {
foreach (var xPlug in mPlugImplsInhrt) { foreach (var xPlug in mPlugImplsInhrt) {
} }
// // Pull in extra implementations, GC etc. // // Pull in extra implementations, GC etc.
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)RuntimeEngineRefs.InitializeApplicationRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)RuntimeEngineRefs.InitializeApplicationRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)RuntimeEngineRefs.FinalizeApplicationRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)RuntimeEngineRefs.FinalizeApplicationRef, false);
// ////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"), true); // ////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"), true);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.LoadTypeTableRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.LoadTypeTableRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.SetMethodInfoRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.SetMethodInfoRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.IsInstanceRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.IsInstanceRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.SetTypeInfoRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.SetTypeInfoRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.GetMethodAddressForTypeRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)VTablesImplRefs.GetMethodAddressForTypeRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)GCImplementationRefs.IncRefCountRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)GCImplementationRefs.IncRefCountRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)GCImplementationRefs.DecRefCountRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)GCImplementationRefs.DecRefCountRef, false);
// QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)GCImplementationRefs.AllocNewObjectRef, false); // QueueMethod(null, "Explicit Entry", (System.Reflection.MethodInfo)GCImplementationRefs.AllocNewObjectRef, false);
// // for now, to ease runtime exception throwing // // for now, to ease runtime exception throwing
// QueueMethod(null, "Explicit Entry", typeof(ExceptionHelper).GetMethod("ThrowNotImplemented", BindingFlags.Static | BindingFlags.Public), false); // QueueMethod(null, "Explicit Entry", typeof(ExceptionHelper).GetMethod("ThrowNotImplemented", BindingFlags.Static | BindingFlags.Public), false);
// //xScanner.Execute( ( System.Reflection.MethodInfo )RuntimeEngineRefs.InitializeApplicationRef ); // //xScanner.Execute( ( System.Reflection.MethodInfo )RuntimeEngineRefs.InitializeApplicationRef );
// //xScanner.Execute( ( System.Reflection.MethodInfo )RuntimeEngineRefs.FinalizeApplicationRef ); // //xScanner.Execute( ( System.Reflection.MethodInfo )RuntimeEngineRefs.FinalizeApplicationRef );
// ////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException")); // ////xScanner.QueueMethod(typeof(CosmosAssembler).GetMethod("PrintException"));
// //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.LoadTypeTableRef ); // //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.LoadTypeTableRef );
// //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.SetMethodInfoRef ); // //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.SetMethodInfoRef );
// //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.IsInstanceRef ); // //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.IsInstanceRef );
// //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.SetTypeInfoRef ); // //xScanner.Execute( ( System.Reflection.MethodInfo )VTablesImplRefs.SetTypeInfoRef );
// Start from entry point of this program // Start from entry point of this program
Queue(aStartMethod, null, "Entry Point"); Queue(aStartMethod, null, "Entry Point");
@ -181,15 +181,17 @@ namespace Cosmos.IL2CPU {
foreach (var xItem in mItems) { foreach (var xItem in mItems) {
if (xItem is MethodBase) { if (xItem is MethodBase) {
var xMethod = (MethodBase)xItem; var xMethod = (MethodBase)xItem;
// if (xMethod.Type != MethodInfo.TypeEnum.NeedsPlug) { //if (xMethod.Type != MethodInfo.TypeEnum.NeedsPlug) {
// ScanMethod(xMethod); // mAsmblr.ProcessMethod(xMethod);
// } else { //} else {
// // todo: make this nicer // // todo: make this nicer
// // methods will call the old name, while it's not emitted. that's why we emit a "forwarding label" here. // // methods will call the old name, while it's not emitted. that's why we emit a "forwarding label" here.
// mAsmblr.GenerateMethodForward(xMethod, xMethod.PlugMethod); // mAsmblr.GenerateMethodForward(xMethod, xMethod.PlugMethod);
} //}
//mAsmblr.ProcessMethod(xMethod,
} }
// mAsmblr.GenerateVMTCode(mTypes, mTypesSet, mKnownMethods); // mAsmblr.GenerateVMTCode(mTypes, mTypesSet, mKnownMethods);
}
} }
public void Dispose() { public void Dispose() {
@ -383,6 +385,7 @@ namespace Cosmos.IL2CPU {
Queue(xOpField.Value.DeclaringType, aMethod, "OpCode Value"); Queue(xOpField.Value.DeclaringType, aMethod, "OpCode Value");
if (xOpField.Value.IsStatic) { if (xOpField.Value.IsStatic) {
//TODO: Why do we add static fields, but not instance? //TODO: Why do we add static fields, but not instance?
// AW: instance fields are "added" always, as part of a type, but for static fields, we need to emit a datamember
// TODO: Add fields // TODO: Add fields
} }
} }