X Tutup
The Wayback Machine - https://web.archive.org/web/20220404141752/https://github.com/python/cpython/pull/32200
Skip to content
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

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

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 requested a review from brandtbucher Mar 30, 2022
@iritkatriel iritkatriel requested a review from markshannon as a code owner Mar 30, 2022
@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

Nice. I have a few questions/suggestions:

Python/compile.c Outdated Show resolved Hide resolved
Python/compile.c Outdated Show resolved Hide resolved
Python/compile.c Show resolved Hide resolved
Python/compile.c Show resolved Hide resolved
Python/compile.c Outdated Show resolved Hide resolved
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

Looks good. A couple of small suggestions

Python/compile.c Show resolved Hide resolved
Python/compile.c Outdated Show resolved Hide resolved
@markshannon
Copy link
Member

@markshannon markshannon commented Apr 1, 2022

Thanks

@markshannon markshannon merged commit 997ba5d into python:main Apr 1, 2022
11 checks passed
@iritkatriel iritkatriel deleted the sort_out_jumps_func branch Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
X Tutup