[issue43693] Logically merge cell and locals array. They are already contiguous in memory

Guido van Rossum report at bugs.python.org
Mon Apr 5 14:44:58 EDT 2021


Guido van Rossum <gvanrossum at gmail.com> added the comment:

To me it looks simpler though. The locals and cells are already stored in a single array, f_localsplus (which also contains the evaluation stack). There are various complications in ceval.c to translate cell indexes to indexes in this array (ein particular the extra local variable 'freevars', which weighs down the stack frame).

Making the interpreter simpler by moving things to the compiler also makes it easier for the C compiler to optimize the code of the interpreter better.

----------
nosy: +Guido.van.Rossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43693>
_______________________________________


More information about the Python-bugs-list mailing list