gh-148380: remove all uses of _PyType_LookupByVersion in optimizer_bytecodes.c#148394
Open
NekoAsakura wants to merge 2 commits intopython:mainfrom
Open
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#148394NekoAsakura wants to merge 2 commits intopython:mainfrom
Conversation
…imizer_bytecodes.c`
2 tasks
Member
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? |
Contributor
Author
|
Right, hold off then. Give my 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); |
Member
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?
Contributor
Author
There was a problem hiding this comment.
Sure! Which issue should I link to?
Member
There was a problem hiding this comment.
Thank you. I think it's fine to open a new issue describing the bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.