⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@cocolato
Copy link
Contributor

@cocolato cocolato commented Jan 11, 2026

@python-cla-bot
Copy link

python-cla-bot bot commented Jan 11, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@cocolato
Copy link
Contributor Author

@Fidget-Spinner There may be many details that need fixing, and I hope you can give me some suggestions.

@cocolato
Copy link
Contributor Author

cocolato commented Jan 11, 2026

I haven't yet removed the cases of REPLACE_OP((inst+1),...), perhaps there's a better way to achieve this.

REPLACE_OP((this_instr+1), _EXIT_TRACE, 0, 0);

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is really valuable work. We definitely need this.


op(_GUARD_TOS_INT, (value -- value)) {
if (sym_is_compact_int(value)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these REPLACE_OP should be left untouched. As you already have a mechanism to copy over the current op if there's no ADD_OP called right :) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean we need the _NOP to appear in both the old buffer and the new buffer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you can tell the add_op function to skip if we see _NOP, and also tell the automatic add op check the same thing.

Copy link
Contributor Author

@cocolato cocolato Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you can tell the add_op function to skip if we see _NOP, and also tell the automatic add op check the same thing.

If i skip add _NOP to out_buffer in add_op, the original _GURAD_XX will be added automatically. If we use REPLACE_OP here, it will modify the original trace. So perhaps can use ADD_OP here?

bool insert_mode)
{
if (sym_matches_type(value, &PyBool_Type)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these REPLACE_OP should be left untouched as well. They should stay the same.

@cocolato
Copy link
Contributor Author

cocolato commented Jan 11, 2026

Thanks for taking the time to review this! I will rewrite them later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants