Skip to content

bpo-47172: Make virtual opcodes negative. Make is_jump detect only actual jumps, use is_block_push for the exception block setup opcodes. #32200

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
merged 12 commits into from
Apr 1, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Mar 30, 2022

…l jumps, use is_block_push for the exception block setup opcodes.
@iritkatriel iritkatriel changed the title bpo-47172: Make virtual opcodes > 256. Make is_jump detect only actua… bpo-47172: Make virtual opcodes > 256. Make is_jump detect only actual jumps, use is_block_push for the exception block setup opcodes. Mar 30, 2022
Copy link
Member

@brandtbucher brandtbucher left a comment

Choose a reason for hiding this comment

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

Nice. I have a few questions/suggestions:

Python/compile.c Outdated
#define SETUP_WITH 253
#define POP_BLOCK 252
#define JUMP 251
#define SETUP_FINALLY 256
Copy link
Member

@markshannon markshannon Mar 31, 2022

Choose a reason for hiding this comment

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

Just an idea, but would it make sense for the virtual opcodes to be negative?
>0: Real
==0: Cache
<0: Virtual
It seems like a simpler scheme.

@iritkatriel iritkatriel changed the title bpo-47172: Make virtual opcodes > 256. Make is_jump detect only actual jumps, use is_block_push for the exception block setup opcodes. bpo-47172: Make virtual opcodes negative. Make is_jump detect only actual jumps, use is_block_push for the exception block setup opcodes. Mar 31, 2022
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Looks good. A couple of small suggestions

@markshannon
Copy link
Member

Thanks

@markshannon markshannon merged commit 997ba5d into python:main Apr 1, 2022
@iritkatriel iritkatriel deleted the sort_out_jumps_func branch April 1, 2022 15:08
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.

6 participants