-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-98831: add variable stack effect support to cases generator #101309
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
Conversation
iritkatriel
commented
Jan 25, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Generate the interpreter #98831
We’ll want something more efficient than this. Maybe generate a function with a switch statement for each value? |
Yes. Read this after writing my response. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, just one request and one suggestion.
self.out.emit(f" case {instr.name}:") | ||
self.out.emit(f" return {effect};") | ||
self.out.emit(" default:") | ||
self.out.emit(" Py_UNREACHABLE();") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make this return -1;
then you can drop all the cases that return -1
, making the function much shorter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There won't be any -1's when we finish. We could group all cases with the same value if we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense. LGTM then.