IL2CPU
IL2CPU copied to clipboard
Review stack type interpretation
Currently, we use the real types to interpret the stack types and implement the ops. We should use the "basic CLI types" (III.1.1):
- A subset of the full numeric types (int32, int64, native int, and F).
- Object references (O) without distinction between the type of object referenced.
- Pointer types (native unsigned int and &) without distinction as to the type pointed to.
The operand type tables (III.1.5) are based on these types, so we should use them to check the stack types and implement the ops.
There are 2 options to implement this:
- Create a new class for stack types (maybe
StackType
), which holds the real type and the "basic CLI type", which would be evaluated in the constructor ofStackType
. - Use helper methods (like
TypeOnStackIsInt32
andTypeOnStackIsObjectRef
).
The option 1 seems the more object oriented.