summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-07-13 15:36:19 (GMT)
committerGitHub <noreply@github.com>2023-07-13 15:36:19 (GMT)
commit487861c6aef2fbcd92ccabb05ea1b57d18299b29 (patch)
tree8df9458534fd5be8bcce69f837f1954ee3f87731 /Python/executor_cases.c.h
parent32718f908cc92c474fd968912368b8a4500bd055 (diff)
downloadcpython-487861c6aef2fbcd92ccabb05ea1b57d18299b29.zip
cpython-487861c6aef2fbcd92ccabb05ea1b57d18299b29.tar.gz
cpython-487861c6aef2fbcd92ccabb05ea1b57d18299b29.tar.bz2
GH-104909: Split `LOAD_ATTR_INSTANCE_VALUE` into micro-ops (GH-106678)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 2c2dbf4..805ea06 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -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];