GH-98522: Add version number to code objects, to provide better version numbers for closures and comprehensions.#98525
Merged
markshannon merged 6 commits intopython:mainfrom Dec 9, 2022
Conversation
iritkatriel
reviewed
Nov 5, 2022
iritkatriel
reviewed
Nov 29, 2022
iritkatriel
reviewed
Nov 29, 2022
| extern PyCodeObject * | ||
| _Py_MakeShimCode(const _PyShimCodeDef *code); | ||
|
|
||
| extern uint32_t _Py_next_func_version; |
Member
There was a problem hiding this comment.
Is there a reason why this is called func_version and not code_version? I find it a bit confusing (note that in deepfreeze.py we now have _Py_next_func_version = {next_code_version}).
Member
Author
There was a problem hiding this comment.
It is primarily used as the version for functions.
https://github.com/python/cpython/blob/main/Python/bytecodes.c#L2976
Caching it in the code object is a further optimization.
✅ Deploy Preview for python-cpython-preview canceled.
|
iritkatriel
approved these changes
Dec 9, 2022
Member
Author
|
Address sanitizer test failing itself because its too slow 🤨 |
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.
Measured performance impact might be positive but is too close to noise to be meaningful.