◐ Shell
clean mode source ↗

gh-144145: Cleanups for object property tracking in JIT optimizer by Fidget-Spinner · Pull Request #144366 · python/cpython

// Check escape
if (sym->descr.last_escape_index < ctx->last_escape_index) {
sym->descr.num_descrs = 0;
return _Py_uop_sym_new_unknown(ctx);

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?

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();

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.

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.