New GitHub issue #100758 from iritkatriel:<br>

<hr>

<pre>
There are 3 places in the code where we prepare a frame for execution:

1. _PyFrame_PushUnchecked in pycore_frame.h
2. init_frame in frameobject.c
3. _PyEvalFramePushAndInit in ceval.c

All of these call the function _PyFrame_InitializeSpecials to set values from the code object to various fields on the frame. Two of them (2 and 3 above) also NULL the localsplus array.

When we will change the frame layout for the register machine, currently we need to update those three places. But if we add NULLing the locals to _PyFrame_InitializeSpecials (and rename it to something clearer) then we can just make our changes there. 

There isn't really a problem with NULLing the localsplus in _PyFrame_PushUnchecked - all the call sites follow up by setting some fields and NULLing the rest. So now we will NULL all fields and overwrite a few after returning from _PyFrame_InitializeSpecials. Will benchmark to make sure.

(Lesson learned from the register machine experiment).


</pre>

<hr>

<a href="https://github.com/python/cpython/issues/100758">View on GitHub</a>
<p>Labels: type-feature</p>
<p>Assignee: iritkatriel</p>