gh-148380: remove all uses of _PyType_LookupByVersion in optimizer_bytecodes.c#148394
gh-148380: remove all uses of _PyType_LookupByVersion in optimizer_bytecodes.c#148394NekoAsakura wants to merge 2 commits intopython:mainfrom
_PyType_LookupByVersion in optimizer_bytecodes.c#148394Conversation
…imizer_bytecodes.c`
Oh dear, thanks for pointing that out. That's the one for I suggest we wait for #148378 to be done and then do that? |
|
Right, hold off then. Give me a kick once #148378 lands :) |
| 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); |
There was a problem hiding this comment.
Btw, It think this is bugged on main, there needs to be a watcher installed on the type for this path similar to _GUARD_TYPE_VERSION. would you like to open a PR to fix it?
There was a problem hiding this comment.
Sure! Which issue should I link to?
There was a problem hiding this comment.
Thank you. I think it's fine to open a new issue describing the bug.
|
The other PR is merged. I think you're already in the mist of changing _GUARD_TYPE_VERSION in #148528. So it's just _CHECK_ATTR_CLASS for this PR then. |
I couldn't add
_RECORD_TOStoLOAD_ATTR_CLASS_WITH_METACLASS_CHECKsince the recording slot's already taken by_RECORD_TOS_TYPE.cpython/Tools/cases_generator/analyzer.py
Lines 1135 to 1150 in e36f8db
So there's a minor optimisation regression on the metaclass path, but not much we can do about it.
As for naming, it's a right mix in the file, so I just went with what felt consistent.