-
-
Notifications
You must be signed in to change notification settings - Fork 34k
gh-144145: Cleanups for object property tracking in JIT optimizer #144366
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
base: main
Are you sure you want to change the base?
Conversation
|
@cocolato can you review this please? |
| // Check escape | ||
| if (sym->descr.last_escape_index < ctx->last_escape_index) { | ||
| sym->descr.num_descrs = 0; | ||
| return _Py_uop_sym_new_unknown(ctx); |
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.
| 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?
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.
Done.
| *(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(); |
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.
| bool is_init_shim = CURRENT_FRAME_IS_INIT_SHIM(); |
Perhaps we can remove the is_init_shim now.
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.
I think it's fine to just use the variable for now.
|
Sorry for any undiscovered bugs, thanks for the fix! |
|
Thanks, LGTM. |
Thanks! Please approve, and I will merge. |
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