KEMBAR78
gh-119689: generate stack effect metadata for pseudo instructions by iritkatriel · Pull Request #119691 · python/cpython · GitHub
Skip to content

Conversation

@iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented May 28, 2024

@iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 28, 2024
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

LGTM, though I'm not sure what should happen to the jump argument.

* -1 -- maximal
*/
static int
stack_effect(int opcode, int oparg, int jump)
Copy link
Member

Choose a reason for hiding this comment

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

Is jump still used? The deleted SETUP cases use it, but I don't think the generated code uses it. Is it no longer needed? Could you remove the jump argument then? (All the callers are inside this file.)

Copy link
Member Author

Choose a reason for hiding this comment

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

jump is exposed in the c api and used from flowgraph.c.

Copy link
Member

Choose a reason for hiding this comment

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

I see, the key is IS_BLOCK_PUSH_OPCODE(opcode). Sorry I didn't get that at first.

@iritkatriel iritkatriel enabled auto-merge (squash) May 29, 2024 09:21
@iritkatriel iritkatriel merged commit c1e9647 into python:main May 29, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate stack effect for pseudo instructions

2 participants