This commit is contained in:
kudzu_cp 2009-07-25 03:30:56 +00:00
parent a878d651a3
commit 9bc82a9289
4 changed files with 18 additions and 10 deletions

View file

@ -8,5 +8,7 @@ namespace Cosmos.IL2CPU.Profiler {
public ILOpProfiler(ILOpCode aOpCode) public ILOpProfiler(ILOpCode aOpCode)
: base(aOpCode) { : base(aOpCode) {
} }
public override void Assemble() { }
} }
} }

View file

@ -8,5 +8,9 @@ namespace Cosmos.IL2CPU.X86 {
protected ILOpX86(ILOpCode aOpCode):base(aOpCode) protected ILOpX86(ILOpCode aOpCode):base(aOpCode)
{ {
} }
//TODO: remove this when all descendants implement this
public override void Assemble() {
}
} }
} }

View file

@ -6,13 +6,10 @@ using System.Text;
namespace Cosmos.IL2CPU { namespace Cosmos.IL2CPU {
public abstract class ILOp { public abstract class ILOp {
public readonly ILOpCode OpCode; public readonly ILOpCode OpCode;
protected ILOp(ILOpCode aOpCode) protected ILOp(ILOpCode aOpCode) {
{
if (aOpCode == null)
{
throw new ArgumentNullException("aOpCode");
}
OpCode = aOpCode; OpCode = aOpCode;
} }
public abstract void Assemble();
} }
} }

View file

@ -116,15 +116,20 @@ namespace Cosmos.IL2CPU {
} else { } else {
xCtor = mILOpsHi[xOpCodeVal & 0xFF]; xCtor = mILOpsHi[xOpCodeVal & 0xFF];
} }
// TODO: Remove this if when all shortcut espansions are working again // TODO: Remove this if when all shortcut expansions are working again
if (xCtor != null) { if (xCtor != null) {
var xILOp = xCtor.Invoke(new object[] { xOpCode }); var xILOp = xCtor.Invoke(new object[] { xOpCode });
// What to pass to execute? Passing whole scanner may be inappropriate
// Op needs info about branch targets for example
// are all branches within method? Maybe ILOpCode can include offset and
// ILOp can reconcile from that and no need to pass anything?
//xILOp.Execute(this);
} }
} }
} }
} }
public void QueueMethod(MethodBase aMethod) { protected void QueueMethod(MethodBase aMethod) {
if (!mMethodsSet.Contains(aMethod)) { if (!mMethodsSet.Contains(aMethod)) {
mMethodsSet.Add(aMethod); mMethodsSet.Add(aMethod);
mMethods.Add(aMethod); mMethods.Add(aMethod);
@ -139,7 +144,7 @@ namespace Cosmos.IL2CPU {
} }
} }
public void QueueStaticField(FieldInfo aFieldInfo) { protected void QueueStaticField(FieldInfo aFieldInfo) {
if (!mFieldsSet.Contains(aFieldInfo)) { if (!mFieldsSet.Contains(aFieldInfo)) {
if (!aFieldInfo.IsStatic) { if (!aFieldInfo.IsStatic) {
throw new Exception("Cannot queue instance fields!"); throw new Exception("Cannot queue instance fields!");
@ -150,7 +155,7 @@ namespace Cosmos.IL2CPU {
} }
} }
public void QueueType(Type aType) { protected void QueueType(Type aType) {
if (aType != null) { if (aType != null) {
if (!mTypesSet.Contains(aType)) { if (!mTypesSet.Contains(aType)) {
mTypesSet.Add(aType); mTypesSet.Add(aType);