Skip to content

gh-119689: generate stack effect metadata for pseudo instructions#119691

Merged
iritkatriel merged 5 commits intopython:mainfrom
iritkatriel:pseudo-stack
May 29, 2024
Merged

gh-119689: generate stack effect metadata for pseudo instructions#119691
iritkatriel merged 5 commits intopython:mainfrom
iritkatriel:pseudo-stack

Conversation

@iritkatriel
Copy link
Copy Markdown
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
Copy Markdown
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.

@@ -703,51 +703,22 @@ compiler_set_qualname(struct compiler *c)
static int
stack_effect(int opcode, int oparg, int jump)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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