Currently _GUARD_TYPE_VERSION looks like this in Python/bytecodes.c:
op(_GUARD_TYPE_VERSION, (type_version/2, owner -- owner)) {
PyTypeObject *tp = Py_TYPE(owner);
assert(type_version != 0);
DEOPT_IF(tp->tp_version_tag != type_version);
}
My question is about that assert. As I split more opcodes into uops, I find some variations of this -- a few opcodes didn't have such an assert, a few others have it after the DEOPT_IF call. Are there really places where the cache can contain a type_version field that is zero? And if so, should those match a zero tp_version_tag in the type?
@markshannon @brandtbucher
Linked PRs
Currently
_GUARD_TYPE_VERSIONlooks like this in Python/bytecodes.c:My question is about that
assert. As I split more opcodes into uops, I find some variations of this -- a few opcodes didn't have such anassert, a few others have it after theDEOPT_IFcall. Are there really places where the cache can contain atype_versionfield that is zero? And if so, should those match a zerotp_version_tagin the type?@markshannon @brandtbucher
Linked PRs