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-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative #32215
Conversation
Are you completely sure it is impossible for the compiler to generate a backwards branch for these instructions? I can't produce a case now, but I can create a case that could jump backwards with the right compiler change.
compiles to:
The compiler could, in theory, retarget the branch at instruction 18 so that it jumps to 8. |
We could handle this in the assembler, I guess.
Would become
As long as backward jumps are rare (and they will be), then this wouldn't add any real overhead. |
I put an assertion and all tests passed. But yeah, we can make it more rubust as you suggest. |
There is the problem of how to test this, since we don't know how to currently make the compiler create a backwards jump with this opcode. |
Closing and reopening to kick the bots. |
If you want to schedule another build, you need to add the " |
If you want to schedule another build, you need to add the " |
Buildbots are happy. |
https://bugs.python.org/issue47120