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

Add virtual opcodes to the dis/opcodes modules #94216

Closed
iritkatriel opened this issue Jun 24, 2022 · 1 comment
Closed

Add virtual opcodes to the dis/opcodes modules #94216

iritkatriel opened this issue Jun 24, 2022 · 1 comment
Assignees
Labels
type-feature A feature request or enhancement

Comments

@iritkatriel
Copy link
Member

As we are exposing compiler optimisations to python for #93678, we also need the virtual opcodes to be available in python. We will add them to opcodes and that will make them available through dis.

The virtual opcodes have values outside the [0,255] range, so they will not obey the normal relationship with HAS_ARGUMENT. We will document that HAS_ARGUMENT is the threshold for non-virtual opcodes, and add a hasarg collection which includes the relevant virtual opcodes as well.

Fortunately the dis module is documented as unstable between python versions, so we don't need to worry too much about backward compatibility of this. However, it might be good to rename HAS_ARGUMENT to _HAS_ARGUMENT in order to push anyone who happens to be using it to use hasarg instead.

@iritkatriel iritkatriel added the type-feature A feature request or enhancement label Jun 24, 2022
@iritkatriel iritkatriel self-assigned this Jun 24, 2022
@iritkatriel
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant