GH-104909: Split LOAD_ATTR_INSTANCE_VALUE into micro-ops (GH-106678)

This commit is contained in:
Mark Shannon 2023-07-13 16:36:19 +01:00 committed by GitHub
parent 32718f908c
commit 487861c6ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 46 deletions

View file

@ -1425,6 +1425,24 @@
break;
}
case _GUARD_TYPE_VERSION: {
PyObject *owner = stack_pointer[-1];
uint32_t type_version = (uint32_t)operand;
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR);
break;
}
case _CHECK_MANAGED_OBJECT_HAS_VALUES: {
PyObject *owner = stack_pointer[-1];
assert(Py_TYPE(owner)->tp_dictoffset < 0);
assert(Py_TYPE(owner)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner);
DEOPT_IF(!_PyDictOrValues_IsValues(dorv), LOAD_ATTR);
break;
}
case COMPARE_OP: {
static_assert(INLINE_CACHE_ENTRIES_COMPARE_OP == 1, "incorrect cache size");
PyObject *right = stack_pointer[-1];