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

Stack effect of jumping -- how to express in DSL #481

Closed
gvanrossum opened this issue Oct 12, 2022 · 3 comments
Closed

Stack effect of jumping -- how to express in DSL #481

gvanrossum opened this issue Oct 12, 2022 · 3 comments
Labels
epic-generator DSL-based code generator for the interpreter(s)

Comments

@gvanrossum
Copy link
Collaborator

Our new DSL can express variadic stack effects using array[oparg] and even caters for conditions (foo if (C-expression)). But four opcodes (SEND, JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP, FOR_ITER) have different stack effects depending on whether they jump. How should we express that? New syntax or a magic constant in C-expression above?

@markshannon

@markshannon
Copy link
Member

The short term answer is "don't worry about". It is simple enough to workaround in the tooling for now.

In the longer term we'll need to add JUMP_AND_POP() macros (or something like that) to complement the JUMPBY() macros we currently have. Plus the tools will need to understand these macros.

@gvanrossum
Copy link
Collaborator Author

I suppose we could just special-case an output stack effect of the form res if (jump) or res if (!jump).

@gvanrossum gvanrossum added the epic-generator DSL-based code generator for the interpreter(s) label Nov 16, 2022
@iritkatriel
Copy link
Collaborator

I think this is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic-generator DSL-based code generator for the interpreter(s)
Projects
None yet
Development

No branches or pull requests

3 participants