GH-119258: Handle STORE_ATTR_WITH_HINT in tier two (GH-119481)

This commit is contained in:
Brandt Bucher 2024-05-28 12:47:54 -07:00 committed by GitHub
parent cfcc054dee
commit 5cd3ffd6b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 137 additions and 61 deletions

View file

@ -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));
@ -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);