mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 04:48:53 +00:00
55 lines
No EOL
1.5 KiB
C#
55 lines
No EOL
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Indy.IL2CPU.IL {
|
|
// TODO: abstract this one out to a X86 specific one
|
|
public class MethodInformation {
|
|
public struct Variable {
|
|
public Variable(int aOffset, int aSize) {
|
|
Offset = aOffset;
|
|
Size = aSize;
|
|
VirtualAddress = "ebp - 0" + (Offset + Size + 0).ToString("X") + "h";
|
|
}
|
|
public readonly int Offset;
|
|
public readonly int Size;
|
|
public readonly string VirtualAddress;
|
|
}
|
|
|
|
public struct Argument {
|
|
public enum KindEnum {
|
|
In,
|
|
ByRef,
|
|
Out
|
|
}
|
|
public Argument(int aSize, int aOffset, KindEnum aKind) {
|
|
Size = aSize;
|
|
Offset = aOffset;
|
|
VirtualAddress = "ebp + 0" + (Offset + Size + 4).ToString("X") + "h";
|
|
Kind = aKind;
|
|
}
|
|
|
|
public readonly string VirtualAddress;
|
|
public readonly int Size;
|
|
public readonly int Offset;
|
|
public readonly KindEnum Kind;
|
|
}
|
|
|
|
public MethodInformation(string aLabelName, Variable[] aLocals, Argument[] aArguments, bool aHasReturnValue, bool aIsInstanceMethod, TypeInformation aTypeInfo) {
|
|
Locals = aLocals;
|
|
LabelName = aLabelName;
|
|
Arguments = aArguments;
|
|
HasReturnValue = aHasReturnValue;
|
|
IsInstanceMethod = aIsInstanceMethod;
|
|
TypeInfo = aTypeInfo;
|
|
}
|
|
|
|
public readonly string LabelName;
|
|
public readonly Variable[] Locals;
|
|
public readonly Argument[] Arguments;
|
|
public readonly bool HasReturnValue;
|
|
public readonly bool IsInstanceMethod;
|
|
public readonly TypeInformation TypeInfo;
|
|
}
|
|
} |