GeezerVison is showing github.com — gh-101799: implement PREP_RERAISE_STAR as an intrinsic function by iritkatriel · Pull Request #101800 · python/cpython
Conversation
iritkatriel
commented
Feb 10, 2023
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick comment: Why not add a CALL_INTRINSIC_2 opcode (assuming we expect more of these)? The variable stack effect based on comparison with an arbitrary constant feels a little fragile. Maybe it would feel less arbitrary if the constant was actually 128 (i.e., bit 7, 0x80).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Quick comment: Why not add a CALL_INTRINSIC_2 opcode (assuming we expect more of these)? The variable stack effect based on comparison with an arbitrary constant feels a little fragile. Maybe it would feel less arbitrary if the constant was actually 128 (i.e., bit 7, 0x80).
I considered this, the down side is we have two opcodes for non-perf-critical stuff. I don't have a strong opinion either way. @markshannon ?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Is FORMAT_VALUE performance critical? It could be replaced by a couple of intrinsic functions.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Is FORMAT_VALUE performance critical? It could be replaced by a couple of intrinsic functions.
Possibly. Most of it could become a helper function. This would lose the fast path for f"aaa{foo}zzz" if foo is exactly a Unicode string, but I'm not sure how important that really is.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Usually we want to do dispatching in the dispatch loop, not within instructions.
However, the point of the CALL_INTRINSIC instruction is to reduce the umber of instructions, so its less clear cut.
On balance, I still think we want two instructions. The extra test and branch is messy; two instructions would make for clearer code and we aren't that short of opcodes.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Regarding FORMAT_VALUE, I refer you to the venerable #6132 which split FORMAT_VALUE into CONVERT_VALUE, FORMAT_SIMPLE and FORMAT_WITH_SPEC.
CONVERT_VALUE could be replaced with CALL_INSTINSIC_1 and FORMAT_WITH_SPEC could be replaced with CALL_INSTINSIC_2. FORMAT_SIMPLE is simple enough, and probably common enough, that it merits its own instruction.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|