gh-144145: Cleanups for object property tracking in JIT optimizer#144366
Closed
Fidget-Spinner wants to merge 4 commits intopython:mainfrom
Closed
gh-144145: Cleanups for object property tracking in JIT optimizer#144366Fidget-Spinner wants to merge 4 commits intopython:mainfrom
Fidget-Spinner wants to merge 4 commits intopython:mainfrom
Conversation
Member
Author
|
@cocolato can you review this please? |
cocolato
reviewed
Feb 1, 2026
| // Check escape | ||
| if (sym->descr.last_escape_index < ctx->last_escape_index) { | ||
| sym->descr.num_descrs = 0; | ||
| return _Py_uop_sym_new_unknown(ctx); |
Contributor
There was a problem hiding this comment.
Suggested change
| return _Py_uop_sym_new_unknown(ctx); | |
| sym->descr.num_descrs = 0; | |
| sym->descr.last_escape_index = uop_buffer_length(&ctx->out_buffer); |
Can we update the last_escape_index here to prevent subsequent set_attr calls from repeatedly clearing num_descrs?
| *(ctx->out_buffer.next++) = *this_instr; | ||
| } | ||
| // Track escapes - but skip when from init shim frame, since self hasn't escaped yet | ||
| bool is_init_shim = CURRENT_FRAME_IS_INIT_SHIM(); |
Contributor
There was a problem hiding this comment.
Suggested change
| bool is_init_shim = CURRENT_FRAME_IS_INIT_SHIM(); |
Perhaps we can remove the is_init_shim now.
Member
Author
There was a problem hiding this comment.
I think it's fine to just use the variable for now.
Contributor
|
Sorry for any undiscovered bugs, thanks for the fix! |
Contributor
|
Thanks, LGTM. |
Member
Author
Thanks! Please approve, and I will merge. |
Contributor
Sorry, I don't have approve permission. |
Contributor
|
It should close after we revert #144122. |
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.
So the previous PR set a good foundation and was always right as it depends on a runtime check. However, I just noticed some bugs that need cleanup:
DEOPT_IF(attr != NULL)completely__slots__object and its property in the Tier 2 optimizer #144145