FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-98831: add variable stack effect support to cases generator by iritkatriel · Pull Request #101309 · python/cpython · GitHub

/ cpython Public

gh-98831: add variable stack effect support to cases generator - #101309

Merged
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:metadata
Jan 25, 2023
Merged

gh-98831: add variable stack effect support to cases generator#101309
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:metadata

Conversation

iritkatriel commented Jan 25, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

We’ll want something more efficient than this. Maybe generate a function with a switch statement for each value?

Comment thread Python/opcode_metadata.h Outdated

Copy link
Copy Markdown
Member

We’ll want something more efficient than this. Maybe generate a function with a switch statement for each value?

Yes. Read this after writing my response. :-)

gvanrossum left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Very nice, just one request and one suggestion.

Comment thread Tools/cases_generator/generate_cases.py Outdated
self.out.emit(f" case {instr.name}:")
self.out.emit(f" return {effect};")
self.out.emit(" default:")
self.out.emit(" Py_UNREACHABLE();")

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If you make this return -1; then you can drop all the cases that return -1, making the function much shorter.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There won't be any -1's when we finish. We could group all cases with the same value if we want.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ah, makes sense. LGTM then.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL