-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Move entry_table to separated header file. #493
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
Thanks, but could you please rename the new file to 'vmtable.h' (or 'vmentrytable.h')? |
Done. |
Move entry_table to separated header file.
Well, we should not try to mimic CPython. Vice versa, we should strive for original, as clean-room as possible implementation. No specific comments on file splitting (I usually like that), but "GOTOS" imho sounds and looks worse than "GOTO". |
Well, I didn't look at CPython's code on my initial patch, but still find that separated that entry table is a good thing. |
Whenever I see a chunk of code that "looks" auto-generated with lots of repeated values, like
my initial instinct is to write a small script to actually auto-generate it. But in this case I'll resist scratching this particular itch ;) (see where I got carried away in #481 with overcomplicating things) - I guess Would it make sense for |
A script for generating that would be cool, I'll create a PR for that later. |
You read https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md ? ;-). See commit history of that for comments discussing that requirement. |
-1. It's not hard to keep that file up to date manually, especially now that @dpgeorge announced that all bytecode implemented. We already autogenerate some stuff, may have real need to autogenerate more. Don't make us being lost in autogenerations and meta-levels. KISS |
Ah, thanks for helping me to fill in the gaps in my understanding :) |
I would say no autogeneration on this. I want the py/ core to stay as simple as possible in terms of build process, so that it can be easily included in other projects (and so I/we don't have heaps of requests for help from others who are trying to embed uPy!). Byte codes are not going to change. And the order of the byte codes as they are written in vmentrytable.h don't have to match the numerical order of the byte codes. That's the magic of [..] array initialisation. |
Like what CPython did.
Also change the name MICROPY_USE_COMPUTED_GOTO to MICROPY_USE_COMPUTED_GOTOS (like Cpython)