| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| _PyOptimizer_BackEdge(_PyInterpreterFrame *frame, _Py_CODEUNIT *src, _Py_CODEUNIT *dest, PyObject **stack_pointer) | ||
| { | ||
| PyCodeObject *code = (PyCodeObject *)frame->f_executable; | ||
| assert(PyCode_Check(code)); |
There was a problem hiding this comment.
should this assert come before the cast?
Sorry, something went wrong.
There was a problem hiding this comment.
Doesn't matter. The cast doesn't do anything until it is used.
Sorry, something went wrong.
The `_PyInterpreterFrame` struct was changed in python/cpython#105727 to store the code object in `f_executable` instead of `f_code`. Fixes ```cpp /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h: In function ‘_PyGen_GetCode’: (diff) /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h:403:17: error: ‘_PyInterpreterFrame’ has no member named ‘f_code’ (diff) 403 | return frame->f_code; (diff) | ^~ (diff) ```
| Back | FazBrowse Home | New Git URL |
This is incomplete implementation of #100987. A full implementation will need a bit more discussion between producers of frames, Cython, MyPyc, etc and consumers, PySpy, Austin, etc.
Rather than wait for a full specification, this PR implements a limited version, as CPython is also a producer and consumer of frames, and we need this to simplify and speed optimizations.
Without this PR we need to create fake code objects for shims and other "artificial" frames, such as those introduced when specializing calls and operators.
This is a more limited version of #103010