You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 3 places in the code where we prepare a frame for execution:
_PyFrame_PushUnchecked in pycore_frame.h
init_frame in frameobject.c
_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).
Uh oh!
There was an error while loading. Please reload this page.
There are 3 places in the code where we prepare a frame for execution:
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).
Linked PRs
The text was updated successfully, but these errors were encountered: