GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — gh-128563: Move labels in ceval.c to bytecodes.c by Fidget-Spinner · Pull Request #129112 · python/cpython Conversation
|
|
I don't think adding another code generator is the way to go. For code in labels we will, in the future, want to:
I'm not suggesting that we do any of the above in this PR. The simple code you generate is fine for now, but it needs to be a bit more closely integrated into the interpreter/JIT generators. Since labels exist outside the dispatch loop, we'll need to generate the dispatch loop as well. We can simply copy the few lines of code surrounding The tier 1 code generator would then generate:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Alright. I've moved the labels generator back into the tier 1 generator. We need to port over tier 2 in a separate PR as well. I've combined the switch-case generator into the cases generator as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good. One thing doesn't look right
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Adding the markers to the generated code for testing looks good, but the parsing in the test is a bit cumbersome.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| lines.pop(0) | ||
| while lines and lines[-1].startswith(("#", "\n")): | ||
| lines.pop(-1) | ||
| while lines and tier1_generator.INSTRUCTION_START_MARKER not in lines[0]: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You can replace this line by line processing, including the start and end comment stripping, by splitting the whole file on INSTRUCTION_START_MARKER and INSTRUCTION_START_MARKER, discarding the first and last parts.
text = temp_output.read() _, rest = text.split(INSTRUCTION_START_MARKER) actual, _ = rest.split(LABEL_START_MARKER)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good observation. Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…nGH-129112)" This reverts commit 87fb8b1.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.