-
-
Notifications
You must be signed in to change notification settings - Fork 34k
gh-144145: Track nullness of properties in the Tier 2 JIT optimizer #144122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,589
−902
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
dfd99d7
Add slots object property tracking for the Tier 2 JIT optimizer
cocolato 7bb2c20
use s_arena to save slots mapping
cocolato 20920fc
fix switch syntax error
cocolato 2e9c5a6
Merge branch 'main' into dev_143414
cocolato 5b4bd5f
fix arena struct
cocolato 6a828d7
support track escape
cocolato 90e4800
check null ptr
cocolato bf29c13
fix escape check
cocolato b80bce1
add _STORE_ATTR_SLOT_NULL && rename
cocolato ec50130
Merge branch 'main' into dev_143414
cocolato da39868
regen-cases
cocolato 7c0c815
don't track escape in init shim frame
cocolato 873ca91
fix lint
cocolato 8bd0ff9
Merge branch 'main' into dev_143414
cocolato 0a7cb9a
fix escape && add _STORE_ATTR_INSTANCE_VALUE_NULL
cocolato 2f8c2ce
📜🤖 Added by blurb_it.
blurb-it[bot] ddbb9c5
Delete Misc/NEWS.d/next/Core_and_Builtins/2026-01-30-09-42-30.gh-issu…
cocolato 9c91e86
📜🤖 Added by blurb_it.
blurb-it[bot] f74096b
add comment
cocolato a7f00bf
format comment
cocolato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to use this for both normal objects and objects with
__slots__, or do we need a separate symbol?Basically I'm asking if it's possible for an object to both have STORE_ATTR_INSTANCE_VALUE and STORE_ATTR_SLOT, as this will cause a index collision between the slots and offset. It it safe also with
STORE_ATTR_WITH_HINT, as can that can mix withSTORE_ATTR_INSTANCE_VALUE?If you think of an answer, please let me know, and we can add it as a comment in the code. otherwise, this is kind of scary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two never appear on the same object type because:
STORE_ATTR_INSTANCE_VALUEneedsPy_TPFLAGS_MANAGED_DICTflag.Therefore, there is no index collision between slot offsets and inline value offsets.
cpython/Python/specialize.c
Lines 665 to 669 in 5f57f69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, conflicts between
STORE_ATTR_INSTANCE_VALUEandSTORE_ATTR_WITH_HINTcan indeed occur. Perhaps a flag could be added to the index to distinguish between the two types?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we track
STORE_ATTR_WITH_HINTin this PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No lets ignore with hint for now.