IL2CPU icon indicating copy to clipboard operation
IL2CPU copied to clipboard

Review stack type interpretation

Open jp2masa opened this issue 7 years ago • 1 comments

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:

  1. 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 of StackType.
  2. Use helper methods (like TypeOnStackIsInt32 and TypeOnStackIsObjectRef).

jp2masa avatar Nov 02 '17 12:11 jp2masa

The option 1 seems the more object oriented.

fanoI avatar Nov 03 '17 12:11 fanoI