gh-144145: Revert PR#144122 for performance and potential bugs. (GH-144391)

Revert "gh-144145: Track nullness of properties in the Tier 2 JIT optimizer (GH-144122)"

This reverts commit 1dc12b2883.
This commit is contained in:
Hai Zhu 2026-02-02 22:09:54 +08:00 committed by GitHub
parent c3b61ef73d
commit ebbb2ca81f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 902 additions and 1589 deletions

View file

@ -38,9 +38,6 @@ typedef struct _Py_UOpsAbstractFrame _Py_UOpsAbstractFrame;
#define sym_new_compact_int _Py_uop_sym_new_compact_int
#define sym_is_compact_int _Py_uop_sym_is_compact_int
#define sym_new_truthiness _Py_uop_sym_new_truthiness
#define sym_new_descr_object _Py_uop_sym_new_descr_object
#define sym_get_attr _Py_uop_sym_get_attr
#define sym_set_attr _Py_uop_sym_set_attr
#define sym_new_predicate _Py_uop_sym_new_predicate
#define sym_apply_predicate_narrowing _Py_uop_sym_apply_predicate_narrowing
@ -106,14 +103,6 @@ dummy_func(void) {
}
op(_STORE_ATTR_INSTANCE_VALUE, (offset/1, value, owner -- o)) {
JitOptRef old_value = sym_set_attr(ctx, owner, (uint16_t)offset, value);
if (sym_is_null(old_value)) {
ADD_OP(_STORE_ATTR_INSTANCE_VALUE_NULL, 0, offset);
}
o = owner;
}
op(_STORE_ATTR_INSTANCE_VALUE_NULL, (offset/1, value, owner -- o)) {
(void)value;
o = owner;
}
@ -136,14 +125,7 @@ dummy_func(void) {
}
op(_STORE_ATTR_SLOT, (index/1, value, owner -- o)) {
JitOptRef old_value = sym_set_attr(ctx, owner, (uint16_t)index, value);
if (sym_is_null(old_value)) {
ADD_OP(_STORE_ATTR_SLOT_NULL, 0, index);
}
o = owner;
}
op(_STORE_ATTR_SLOT_NULL, (index/1, value, owner -- o)) {
(void)index;
(void)value;
o = owner;
}
@ -767,7 +749,8 @@ dummy_func(void) {
}
op(_LOAD_ATTR_SLOT, (index/1, owner -- attr, o)) {
attr = sym_get_attr(ctx, owner, (uint16_t)index);
attr = sym_new_not_null(ctx);
(void)index;
o = owner;
}
@ -951,14 +934,10 @@ dummy_func(void) {
}
op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
(void)type_version;
(void)args;
callable = sym_new_not_null(ctx);
PyTypeObject *tp = _PyType_LookupByVersion(type_version);
if (tp != NULL) {
self_or_null = sym_new_descr_object(ctx, type_version);
} else {
self_or_null = sym_new_not_null(ctx);
}
self_or_null = sym_new_not_null(ctx);
}
op(_CREATE_INIT_FRAME, (init, self, args[oparg] -- init_frame)) {