Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Where is the giant cpython switch case statement moved?

Not sure if it’s off topic but don’t know any better place to ask.
In cpython there was a very giant switch case statement for executing each opcode.
This switch case previously was placed in the _PyEval_EvalFrameDefault function.
Here is the link. The switch case statement starts here.
This was a core part of cpython and everyone who was interested in cpython internals, would probably explore it in detail. Recently I was searching for it and I couldn’t find it. In this version of _PyEval_EvalFrameDefault I can’t find it. It’s much shorter than the last one.
I even tried to find this switch statement by searching for opcodes in my IDE. But even that didn’t helped find where it is.
Can anyone who is aware of latest cpython development changes help me?
Thanks in advance.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It’s in Python/generated_cases.c.h, which gets inserted into _PyEval_EvalFrameDefault with an #include "generated_cases.c.h".

As you might guess from the name, generated_cases.c.h is generated code. You can see the code generator in Tools/cases_generator/generate_cases.py

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading