mirror of
https://github.com/python/cpython.git
synced 2026-05-09 03:50:56 +00:00
gh-148380: remove all uses of _PyType_LookupByVersion in optimizer_bytecodes.c (GH-148394)
This commit is contained in:
parent
efcac6f281
commit
2ca6333065
5 changed files with 43 additions and 39 deletions
|
|
@ -229,8 +229,8 @@ dummy_func(void) {
|
|||
}
|
||||
|
||||
op(_CHECK_ATTR_CLASS, (type_version/2, owner -- owner)) {
|
||||
PyObject *type = (PyObject *)_PyType_LookupByVersion(type_version);
|
||||
if (type) {
|
||||
PyObject *type = sym_get_probable_value(owner);
|
||||
if (type != NULL && ((PyTypeObject *)type)->tp_version_tag == type_version) {
|
||||
if (type == sym_get_const(ctx, owner)) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
|
|
@ -246,7 +246,7 @@ dummy_func(void) {
|
|||
|
||||
op(_GUARD_TYPE_VERSION, (type_version/2, owner -- owner)) {
|
||||
assert(type_version);
|
||||
assert(this_instr[-1].opcode == _RECORD_TOS_TYPE);
|
||||
assert(this_instr[-1].opcode == _RECORD_TOS_TYPE || this_instr[-1].opcode == _RECORD_TOS);
|
||||
if (sym_matches_type_version(owner, type_version)) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue