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

GH-111485: Factor out tier 2 code generation from the rest of the interpreter code generator #112968

Merged
merged 9 commits into from
Dec 12, 2023

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Dec 11, 2023

Tools/cases_generator/tier2_generator.py Show resolved Hide resolved
Tools/cases_generator/tier2_generator.py Show resolved Hide resolved
Tools/cases_generator/analyzer.py Show resolved Hide resolved
Python/executor_cases.c.h Outdated Show resolved Hide resolved
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.

Just a few nits. Please also use black on all files you touched.

Python/executor_cases.c.h Outdated Show resolved Hide resolved
Tools/cases_generator/analyzer.py Show resolved Hide resolved
Tools/cases_generator/uop_id_generator.py Outdated Show resolved Hide resolved
Tools/cases_generator/uop_id_generator.py Outdated Show resolved Hide resolved
@@ -138,145 +57,6 @@ def declare_variables(inst: Instruction, out: CWriter) -> None:
out.emit(f"{type}{var.name};\n")


def emit_to(out: CWriter, tkn_iter: Iterator[Token], end: str) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Did you make any changes to the code that you moved to generators_common.py or stack.py? Or is it strictly a move?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is strictly a move

Tools/cases_generator/tier2_generator.py Show resolved Hide resolved
Tools/cases_generator/tier2_generator.py Show resolved Hide resolved
@@ -17,3 +33,143 @@ def write_header(generator: str, source: str, outfile: TextIO) -> None:
// Do not edit!
"""
)


def emit_to(out: CWriter, tkn_iter: Iterator[Token], end: str) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

This could be a method on CWriter.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that, but it tracks the parentheses in the tkn_iter input, which seems out of scope for a writer.

Tools/cases_generator/tier2_generator.py Show resolved Hide resolved
@markshannon markshannon merged commit 0c55f27 into python:main Dec 12, 2023
38 checks passed
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@markshannon markshannon deleted the tier-2-code-gen branch August 6, 2024 10:18
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
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