-
Notifications
You must be signed in to change notification settings - Fork 50
Generating code for the ceval loop/switch #5
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
Comments
The main benefit is maintainability.
|
Another reason, is debugging and instrumentation. |
One thing Guido and I were discussing the other day is generating one copy of the eval loop with all the Python-level tracing/profiling machinery, and one without. We'd default to the latter and switch to the former when tracing is turned on. That could be facilitated by |
Currently, we seem to going down the manual route for adding new instructions. Which fine. |
Reopening, see #454 (comment) |
Of course this is a great idea, making it easier to experiment with opcodes; especially when multiple people are tweaking. |
We now have a working generator (see Tools/cases_generator). While there's a whole lot more to do, let's close this and discuss details in separate issues under the label epic-generator. |
I'm collecting ideas for discussion, and this is the first one.
@markshannon Can you clear up any misunderstandings in my summary of your idea here?
IIUC Mark's idea is that we'd replace the big switch (and perhaps the loop around it as well) with code generated by a script from "opcode definitions", a bit similar to the way Argument Clinic works. Not sure if the opcode definition would be inline as Argument Clinic does or if they would be C snippets contained in a separate file.
Somehow this would allow us to create a version of the main loop that doesn't have to check for tracing on every opcode.
Not sure of other benefits yet.
The text was updated successfully, but these errors were encountered: