Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tidy up
  • Loading branch information
markshannon committed May 6, 2024
commit d7bbf67a38c066ca5ea6455e1452013503f6b4c5
3 changes: 2 additions & 1 deletion Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ framelocalsproxy_setitem(PyObject *self, PyObject *key, PyObject *value)
if (PyUnicode_CheckExact(key)) {
int i = framelocalsproxy_getkeyindex(frame, key, false);
if (i >= 0) {
_PyLocals_Kind kind = _PyLocals_GetKind(co->co_localspluskinds, i);
_Py_Executors_InvalidateDependency(PyInterpreterState_Get(), co, 1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way I solved the _Py_TIER2 dependency elsewhere is to put this call itself inside #ifdef _Py_TIER2. Then you don't need the dummy version you added to optimizer.c.


_PyLocals_Kind kind = _PyLocals_GetKind(co->co_localspluskinds, i);
PyObject *oldvalue = fast[i];
PyObject *cell = NULL;
if (kind == CO_FAST_FREE) {
Expand Down
1 change: 1 addition & 0 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@ _Py_Executors_InvalidateAll(PyInterpreterState *interp, int is_invalidation)
}

#else

void
_Py_Executors_InvalidateDependency(PyInterpreterState *interp, void *obj, int is_invalidation)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super keen on having a dummy version here -- and if we do this we should probably make a few more dummy versions and remove the occasional #if _Py_TIER2 sprinkled around elsewhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you prefer this in optimizer.h

#else
#define _Py_Executors_InvalidateDependency(A, B, C) ((void)0)
#endif _Py_TIER2

and leave optimizer.c alone?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's better. Though if this is what Brandt asks about maybe we should split it and put that bugfix in beta1 even if the f_locals bugfix goes to beta2.

{
Expand Down