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

Leave skipping of next instruction to the cases generator, or don't skip at all #572

Closed
Fidget-Spinner opened this issue Mar 27, 2023 · 3 comments

Comments

@Fidget-Spinner
Copy link
Collaborator

We have "secret" super instructions like CALL_NO_KW_LIST_APPEND, and BINARY_OP_INPLACE_ADD_UNICODE, and some of the FOR_ITER family.

We should either add the instruction pointer effect to the DSL, or get rid of these outright, as they make alternative interpreters harder to implement.

@Fidget-Spinner
Copy link
Collaborator Author

Related to python/cpython#100982

@gvanrossum
Copy link
Collaborator

or get rid of these outright

Meaning get rid of the secret super-instructions? That seems problematic though (they exist for a reason). @Fidget-Spinner

To add instruction pointer effects to the DSL, we should have a default which behaves as the status quo. Maybe we could add keyword args to the DSL to make this and other options easier to add independently.

The main problem is that the generator tries to verify that all instructions in a family have the same stack and cache effects, and the secret super-instructions effectively violate the cache effect rule (since that's really the instruction pointer effect).

Maybe the solution is to have a "skip next instruction" flag that isn't considered part of the family effect.

@markshannon
Copy link
Member

We've add the SKIP_OVER macro so that these skips are explicit and the INLINE_CACHE_ENTRIES_... entries are no longer used in bytecodes.c. So it should be easy to identify these "secret superiinstructions"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants