bpo-45773: Stop "optimizing" certain jump patterns#29505
Conversation
markshannon
left a comment
There was a problem hiding this comment.
I'm not sure about the comments // It's okay if inst->i_target == target->i_target., or the asserts assert(inst->i_target != target->i_target);
I'm not saying that they are incorrect, but it is not obvious why they are true.
Could you elaborate?
Something else to consider is to create a jump_thread function which gets all the checks if one place (different targets, compatible line numbers). It should return 1 if successful.
We could then replace code from line 8253 to 8256 with i -= jump_thread(inst, target);
|
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be poked with soft cushions! |
|
I figured I'd give your If you think this is outside the scope of this PR, though, I can revert the latest changes and propose them separately. |
I agree, this does clean things up. |
|
Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
Sorry, @brandtbucher, I could not cleanly backport this to |
|
GH-29526 is a backport of this pull request to the 3.10 branch. |
https://bugs.python.org/issue45773