Skip to content

Commit

Permalink
pythonGH-119258: Handle STORE_ATTR_WITH_HINT in tier two (pythonGH-11…
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored May 28, 2024
1 parent cfcc054 commit 5cd3ffd
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ dict_next_version(PyInterpreterState *interp)
((INTERP)->dict_state.global_version += DICT_VERSION_INCREMENT)
#endif

void
PyAPI_FUNC(void)
_PyDict_SendEvent(int watcher_bits,
PyDict_WatchEvent event,
PyDictObject *mp,
Expand Down
3 changes: 2 additions & 1 deletion Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2119,11 +2119,8 @@ dummy_func(
_GUARD_DORV_NO_DICT +
_STORE_ATTR_INSTANCE_VALUE;

inst(STORE_ATTR_WITH_HINT, (unused/1, type_version/2, hint/1, value, owner --)) {
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version);
assert(tp->tp_flags & Py_TPFLAGS_MANAGED_DICT);
op(_STORE_ATTR_WITH_HINT, (hint/1, value, owner --)) {
assert(Py_TYPE(owner)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
PyDictObject *dict = _PyObject_GetManagedDict(owner);
DEOPT_IF(dict == NULL);
assert(PyDict_CheckExact((PyObject *)dict));
Expand Down Expand Up @@ -2158,6 +2155,11 @@ dummy_func(
Py_DECREF(owner);
}

macro(STORE_ATTR_WITH_HINT) =
unused/1 +
_GUARD_TYPE_VERSION +
_STORE_ATTR_WITH_HINT;

op(_STORE_ATTR_SLOT, (index/1, value, owner --)) {
char *addr = (char *)owner + index;
STAT_INC(STORE_ATTR, hit);
Expand Down
62 changes: 61 additions & 1 deletion Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 43 additions & 37 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5cd3ffd

Please sign in to comment.