Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review stack type interpretation #23

Open
jp2masa opened this issue Nov 2, 2017 · 1 comment
Open

Review stack type interpretation #23

jp2masa opened this issue Nov 2, 2017 · 1 comment

Comments

@jp2masa
Copy link
Member

jp2masa commented Nov 2, 2017

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).
@fanoI
Copy link
Contributor

fanoI commented Nov 3, 2017

The option 1 seems the more object oriented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants