| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This doesn't work yet, just a checkpoint. I'm going to bed now. It's going to be a long slog.
(Don't do anything with them yet.)
(This is a checkpoint, doesn't work yet.)
There was a problem hiding this comment.
I'm pushing the new version in a few minutes, after merging two tough commits from main. The pushed version will once again have the cases in ceval.c, I'll remove those later (right before merging).
Sorry, something went wrong.
| #define SET_TOP(v) (stack_pointer[-1] = (v)) | ||
| #define GETLOCAL(i) (frame->localsplus[i]) | ||
|
|
||
| #define inst(name, stack_effect) case name: |
There was a problem hiding this comment.
Good point. I added some more dummy arguments and labels, fixed the inst() macro, and I'm just copying all #includes from ceval.c...
Sorry, something went wrong.
| #define GETLOCAL(i) (frame->localsplus[i]) | ||
|
|
||
| #define inst(name, stack_effect) case name: | ||
| #define family(name) static int family_##name |
There was a problem hiding this comment.
Ah, that was a last-minute change, I had a + separator there first. I'll put it inside curlies and make the macro define an unsized array.
Sorry, something went wrong.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
|
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
Sorry, something went wrong.
|
(Wait, I haven't pushed yet. In a minute.) |
Sorry, something went wrong.
|
Now it's ready. |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @gvanrossum for commit 7a327aa 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
If you get a merge conflict, talk to Guido
|
I have one more commit (removing the cases from ceval.c) and then I'll merge. If you get a merge conflict after that, re-apply your changes to the instructions in ceval.c to bytecodes.c, and re-run make regen-cases. |
Sorry, something went wrong.
|
All buildbots passed except the three s390 ones. I'm not going to wait for those, I'm pushing the final commit (fddc08c) and once the regular CI passes I'll merge. Hopefully before midnight. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Overview
This is the first stage of a project to generate the interpreter, in particular the cases of the main switch. The references below explain the why. This PR introduces the following:
Two new files in the Python subdirectory, bytecodes.c and generated_cases.c.h. (UPDATE: cases.h -> generated_cases.c.h.)
A new bunch of tooling, in Tools/cases_generator. This includes:
Changes to ceval.c so that it uses #include "generated_cases.c.h". For now I've left the original switch cases in ceval.c, inside #else ... #endif, so that we can compare the original switch cases to the generated switch cases to validate the toolchain. However, I plan to rip these out either once the PR is (nearly) approved, or perhaps in a quick follow-up PR.
A new target in Makefile.pre.in to auto-generate generated_cases.c.h from bytecodes.c, using make regen-cases.
References
Metadata